mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-06 17:47:49 +00:00
Cleanup travis.yml, tweak how pull requests are handled in saucelabs.js, and tweak timing tests in test/test.js.
This commit is contained in:
10
.travis.yml
10
.travis.yml
@@ -44,6 +44,8 @@ branches:
|
|||||||
only:
|
only:
|
||||||
- master
|
- master
|
||||||
before_install:
|
before_install:
|
||||||
|
- "[ $BUILD != false ] && [ $BUILD != 'compat' ] && MAKE=true || true"
|
||||||
|
- "[ $SAUCELABS != false ] && npm i ecstatic request sauce-tunnel || true"
|
||||||
- "[ $BIN == 'istanbul' ] && npm i -g istanbul || true"
|
- "[ $BIN == 'istanbul' ] && npm i -g istanbul || true"
|
||||||
- "[ $BIN == 'narwhal' ] && wget https://github.com/280north/narwhal/archive/v0.3.2.zip && sudo unzip v0.3.2 -d /opt/ && rm v0.3.2.zip || true"
|
- "[ $BIN == 'narwhal' ] && wget https://github.com/280north/narwhal/archive/v0.3.2.zip && sudo unzip v0.3.2 -d /opt/ && rm v0.3.2.zip || true"
|
||||||
- "[ $BIN == 'narwhal' ] && sudo ln -s /opt/narwhal-0.3.2/bin/narwhal /usr/local/bin/narwhal && sudo chmod +x /usr/local/bin/narwhal || true"
|
- "[ $BIN == 'narwhal' ] && sudo ln -s /opt/narwhal-0.3.2/bin/narwhal /usr/local/bin/narwhal && sudo chmod +x /usr/local/bin/narwhal || true"
|
||||||
@@ -51,13 +53,11 @@ before_install:
|
|||||||
- "[ $BIN == 'rhino' ] && echo -e '#!/bin/sh\\njava -jar /opt/rhino-1.7R5/js.jar $@' | sudo tee /usr/local/bin/rhino && sudo chmod +x /usr/local/bin/rhino || true"
|
- "[ $BIN == 'rhino' ] && echo -e '#!/bin/sh\\njava -jar /opt/rhino-1.7R5/js.jar $@' | sudo tee /usr/local/bin/rhino && sudo chmod +x /usr/local/bin/rhino || true"
|
||||||
- "[ $BIN == 'ringo' ] && wget http://ringojs.org/downloads/ringojs-0.9.zip && sudo unzip ringojs-0.9 -d /opt && rm ringojs-0.9.zip || true"
|
- "[ $BIN == 'ringo' ] && wget http://ringojs.org/downloads/ringojs-0.9.zip && sudo unzip ringojs-0.9 -d /opt && rm ringojs-0.9.zip || true"
|
||||||
- "[ $BIN == 'ringo' ] && sudo ln -s /opt/ringojs-0.9/bin/ringo /usr/local/bin/ringo && sudo chmod +x /usr/local/bin/ringo || true"
|
- "[ $BIN == 'ringo' ] && sudo ln -s /opt/ringojs-0.9/bin/ringo /usr/local/bin/ringo && sudo chmod +x /usr/local/bin/ringo || true"
|
||||||
- "[ $SAUCELABS != false ] && npm i ecstatic request sauce-tunnel || true"
|
- "[ $MAKE != false ] && git clone --depth=10 --branch=master git://github.com/lodash/lodash-cli.git ./node_modules/lodash-cli || true"
|
||||||
script:
|
|
||||||
- "[ $BIN == 'istanbul' ] && $BIN cover ./test/test.js || true"
|
|
||||||
- "[ $BUILD != false ] && [ $BUILD != 'compat' ] && MAKE=true || true"
|
|
||||||
- "[ $MAKE != false ] && git clone --depth=1 --branch=master git://github.com/lodash/lodash-cli.git ./node_modules/lodash-cli || true"
|
|
||||||
- "[ $MAKE != false ] && mkdir ./node_modules/lodash-cli/node_modules && cd ./node_modules/lodash-cli/node_modules/ && ln -s ../../../ ./lodash && cd ../ && npm i . && cd ../../ || true"
|
- "[ $MAKE != false ] && mkdir ./node_modules/lodash-cli/node_modules && cd ./node_modules/lodash-cli/node_modules/ && ln -s ../../../ ./lodash && cd ../ && npm i . && cd ../../ || true"
|
||||||
- "[ $MAKE != false ] && node ./node_modules/lodash-cli/bin/lodash $BUILD -o ./dist/lodash.$BUILD.js || true"
|
- "[ $MAKE != false ] && node ./node_modules/lodash-cli/bin/lodash $BUILD -o ./dist/lodash.$BUILD.js || true"
|
||||||
|
script:
|
||||||
|
- "[ $BIN == 'istanbul' ] && $BIN cover ./test/test.js || true"
|
||||||
- "[ $BUILD != false ] && cd ./test || true"
|
- "[ $BUILD != false ] && cd ./test || true"
|
||||||
- "[ $BUILD == false ] && true || $BIN $OPTION ./test.js ../dist/lodash.$BUILD.js"
|
- "[ $BUILD == false ] && true || $BIN $OPTION ./test.js ../dist/lodash.$BUILD.js"
|
||||||
- "[ $BUILD == false ] && true || $BIN $OPTION ./test.js ../dist/lodash.$BUILD.min.js"
|
- "[ $BUILD == false ] && true || $BIN $OPTION ./test.js ../dist/lodash.$BUILD.min.js"
|
||||||
|
|||||||
@@ -16,6 +16,11 @@
|
|||||||
accessKey = process.env.SAUCE_ACCESS_KEY,
|
accessKey = process.env.SAUCE_ACCESS_KEY,
|
||||||
tunnelId = 'lodash_' + process.env.TRAVIS_JOB_NUMBER;
|
tunnelId = 'lodash_' + process.env.TRAVIS_JOB_NUMBER;
|
||||||
|
|
||||||
|
if (!accessKey) {
|
||||||
|
console.error('Testing skipped for pull requests');
|
||||||
|
process.exit(0);
|
||||||
|
}
|
||||||
|
|
||||||
var runnerPathname = (function() {
|
var runnerPathname = (function() {
|
||||||
var args = process.argv;
|
var args = process.argv;
|
||||||
return args.length > 2
|
return args.length > 2
|
||||||
@@ -85,20 +90,19 @@
|
|||||||
mount(req, res);
|
mount(req, res);
|
||||||
}).listen(port);
|
}).listen(port);
|
||||||
|
|
||||||
// set up sauce connect so we can use this server from saucelabs
|
// set up Sauce Connect so we can use this server from Sauce Labs
|
||||||
var tunnelTimeout = 10000,
|
var tunnelTimeout = 10000,
|
||||||
tunnel = new SauceTunnel(username, accessKey, tunnelId, true, tunnelTimeout);
|
tunnel = new SauceTunnel(username, accessKey, tunnelId, true, tunnelTimeout);
|
||||||
|
|
||||||
console.log('Opening sauce connect tunnel...');
|
console.log('Opening Sauce Connect tunnel...');
|
||||||
|
|
||||||
tunnel.start(function(success) {
|
tunnel.start(function(success) {
|
||||||
if (success) {
|
if (success) {
|
||||||
console.log('Sauce connect tunnel opened');
|
console.log('Sauce Connect tunnel opened');
|
||||||
runTests();
|
runTests();
|
||||||
} else {
|
} else {
|
||||||
// fail without an exit code for pull requests
|
console.error('Failed to open Sauce Connect tunnel');
|
||||||
console.error('Failed to open sauce connect tunnel');
|
process.exit(2);
|
||||||
process.exit(0);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -195,7 +199,7 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('Shutting down sauce connect tunnel...');
|
console.log('Shutting down Sauce Connect tunnel...');
|
||||||
|
|
||||||
tunnel.stop(function() {
|
tunnel.stop(function() {
|
||||||
process.exit(failingTests.length ? 1 : 0);
|
process.exit(failingTests.length ? 1 : 0);
|
||||||
|
|||||||
@@ -259,7 +259,7 @@
|
|||||||
|
|
||||||
asyncTest('supports loading ' + basename + ' in a web worker', 1, function() {
|
asyncTest('supports loading ' + basename + ' in a web worker', 1, function() {
|
||||||
if (Worker && !isModularize) {
|
if (Worker && !isModularize) {
|
||||||
var limit = 1000,
|
var limit = 2000,
|
||||||
start = new Date;
|
start = new Date;
|
||||||
|
|
||||||
var attempt = function() {
|
var attempt = function() {
|
||||||
@@ -5443,7 +5443,6 @@
|
|||||||
|
|
||||||
test('supports not passing a `max` argument', 1, function() {
|
test('supports not passing a `max` argument', 1, function() {
|
||||||
var actual = _.random(5),
|
var actual = _.random(5),
|
||||||
limit = 60,
|
|
||||||
start = new Date;
|
start = new Date;
|
||||||
|
|
||||||
ok(_.some(array, function() {
|
ok(_.some(array, function() {
|
||||||
@@ -6902,7 +6901,7 @@
|
|||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
ok(count > lastCount);
|
ok(count > lastCount);
|
||||||
QUnit.start();
|
QUnit.start();
|
||||||
}, 192);
|
}, 256);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
skipTest(2);
|
skipTest(2);
|
||||||
|
|||||||
Reference in New Issue
Block a user