Skip to content

Commit

Permalink
Merge pull request moment#1391 from ichernev/tests/fix-prs
Browse files Browse the repository at this point in the history
Fix PRs failing in travis
  • Loading branch information
ichernev committed Dec 31, 2013
2 parents f6c3d03 + 32c1c34 commit 76f79da
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,8 @@ module.exports = function (grunt) {

// travis build task
grunt.registerTask('build:travis', [
'jshint', 'test:node', 'test:travis-sauce-browser'
'jshint', 'test:node', 'check-sauce-creds',
'test:travis-sauce-browser'
]);

// Task to be run when releasing a new version
Expand Down
14 changes: 14 additions & 0 deletions tasks/check_sauce_creds.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
module.exports = function (grunt) {

// Pull Requests do not have secure variables enabled for security reasons.
// Use this task before launching travis-sauce-browser task, so it would
// exit early and won't try connecting to saucelabs without credentials.
grunt.registerTask('check-sauce-creds', function () {
if (process.env.SAUCE_USERNAME === undefined) {
grunt.log.writeln("No sauce credentials found");
grunt.task.clearQueue();
} else {
grunt.log.writeln("Sauce credentials found");
}
});
};

0 comments on commit 76f79da

Please sign in to comment.