Skip to content

Commit

Permalink
trying to fix travis + sauce check for PRs and forks
Browse files Browse the repository at this point in the history
  • Loading branch information
boneskull committed May 23, 2016
1 parent 0dde0fa commit f8a3d86
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ module.exports = function(config) {
// Execute `CI=1 make test-browser`, once you've set the SAUCE_USERNAME and
// SAUCE_ACCESS_KEY env vars.
// also, we can't run SauceLabs tests on PRs from forks.
if (process.env.CI && !process.env.TRAVIS_PULL_REQUEST) {
if (process.env.CI) {
if (!(process.env.SAUCE_USERNAME || process.env.SAUCE_ACCESS_KEY)) {
throw new Error('Must set SAUCE_USERNAME and SAUCE_ACCESS_KEY '
+ 'environment variables!');
Expand Down Expand Up @@ -88,11 +88,14 @@ module.exports = function(config) {
};

if (process.env.TRAVIS) {
// correlate build/tunnel with Travis
cfg.sauceLabs.build = 'TRAVIS #' + process.env.TRAVIS_BUILD_NUMBER
+ ' (' + process.env.TRAVIS_BUILD_ID + ')';
cfg.sauceLabs.tunnelIdentifier = process.env.TRAVIS_JOB_NUMBER;
cfg.sauceLabs.startConnect = false;
if (process.env.TRAVIS_REPO_SLUG === 'mochajs/mocha'
&& process.env.TRAVIS_PULL_REQUEST === 'false') {
// correlate build/tunnel with Travis
cfg.sauceLabs.build = 'TRAVIS #' + process.env.TRAVIS_BUILD_NUMBER
+ ' (' + process.env.TRAVIS_BUILD_ID + ')';
cfg.sauceLabs.tunnelIdentifier = process.env.TRAVIS_JOB_NUMBER;
cfg.sauceLabs.startConnect = false;
}
} else {
// otherwise just make something up
cfg.sauceLabs.build = require('os').hostname() + ' (' + Date.now() + ')';
Expand Down

0 comments on commit f8a3d86

Please sign in to comment.