diff --git a/.travis.yml b/.travis.yml index 51b3651ee..dad82767b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -44,6 +44,8 @@ branches: only: - master 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 == '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" @@ -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 == '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" - - "[ $SAUCELABS != false ] && npm i ecstatic request sauce-tunnel || 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 ] && git clone --depth=10 --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 ] && 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 ] && true || $BIN $OPTION ./test.js ../dist/lodash.$BUILD.js" - "[ $BUILD == false ] && true || $BIN $OPTION ./test.js ../dist/lodash.$BUILD.min.js" diff --git a/test/saucelabs.js b/test/saucelabs.js index d8aa3853b..af2fe6af0 100644 --- a/test/saucelabs.js +++ b/test/saucelabs.js @@ -16,6 +16,11 @@ accessKey = process.env.SAUCE_ACCESS_KEY, tunnelId = 'lodash_' + process.env.TRAVIS_JOB_NUMBER; + if (!accessKey) { + console.error('Testing skipped for pull requests'); + process.exit(0); + } + var runnerPathname = (function() { var args = process.argv; return args.length > 2 @@ -85,20 +90,19 @@ mount(req, res); }).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, tunnel = new SauceTunnel(username, accessKey, tunnelId, true, tunnelTimeout); - console.log('Opening sauce connect tunnel...'); + console.log('Opening Sauce Connect tunnel...'); tunnel.start(function(success) { if (success) { - console.log('Sauce connect tunnel opened'); + console.log('Sauce Connect tunnel opened'); runTests(); } else { - // fail without an exit code for pull requests - console.error('Failed to open sauce connect tunnel'); - process.exit(0); + console.error('Failed to open Sauce Connect tunnel'); + process.exit(2); } }); @@ -195,7 +199,7 @@ }); } - console.log('Shutting down sauce connect tunnel...'); + console.log('Shutting down Sauce Connect tunnel...'); tunnel.stop(function() { process.exit(failingTests.length ? 1 : 0); diff --git a/test/test.js b/test/test.js index baa94663d..88f7272b3 100644 --- a/test/test.js +++ b/test/test.js @@ -259,7 +259,7 @@ asyncTest('supports loading ' + basename + ' in a web worker', 1, function() { if (Worker && !isModularize) { - var limit = 1000, + var limit = 2000, start = new Date; var attempt = function() { @@ -5443,7 +5443,6 @@ test('supports not passing a `max` argument', 1, function() { var actual = _.random(5), - limit = 60, start = new Date; ok(_.some(array, function() { @@ -6902,7 +6901,7 @@ setTimeout(function() { ok(count > lastCount); QUnit.start(); - }, 192); + }, 256); } else { skipTest(2);