Skip to content

Commit

Permalink
ci(saucelabs): skip SauceLabs tests faster on Travis
Browse files Browse the repository at this point in the history
Shamelessly copied from nename0's contribution to PouchDB.
  • Loading branch information
ptitjes committed Nov 28, 2017
1 parent ed633e0 commit 188783d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
7 changes: 7 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ node_js:
sudo: false

before_install:
# Skip SauceLabs tests in Pull Request
- |
if [[ $TRAVIS_SECURE_ENV_VARS == "false" ]] && [[ $CLIENT == saucelabs:* ]]; then
echo "Not running test, cannot connect to SauceLabs in Pull Request"
travis_terminate 0
fi
# Install PhantomJS and cache it
# See https://github.com/Medium/phantomjs#continuous-integration
- "export PHANTOMJS_VERSION=2.1.1"
Expand Down
13 changes: 6 additions & 7 deletions bin/run-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,14 @@ function buildKarmaConf(client) {
platform: tmp[3] || null,
};

if (process.env.TRAVIS &&
client.runner === 'saucelabs' &&
process.env.TRAVIS_SECURE_ENV_VARS === 'false') {
console.error('Not running test, cannot connect to saucelabs');
return null;
}

if (client.runner === 'saucelabs') {

// This should already be handled in .travis.yml
if (process.env.TRAVIS && process.env.TRAVIS_SECURE_ENV_VARS === 'false') {
console.error('Not running test, cannot connect to SauceLabs in Pull Request');
return null;
}

// Standard SauceLabs configuration
options.sauceLabs = {
testName: 'pouchdb-authentication tests',
Expand Down

0 comments on commit 188783d

Please sign in to comment.