Skip to content

Commit

Permalink
Added a base for running saucelabs tests from grunt. closes videojs#1215
Browse files Browse the repository at this point in the history
  • Loading branch information
gkatsev authored and paullryan committed Jul 17, 2014
1 parent c090b3e commit 56f2fe5
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ CHANGELOG
* Exposed the vertical option for slider controls ([view](https://github.com/videojs/video.js/pull/1303))
* Fixed an error when disposing a tech using manual timeupdates ([view](https://github.com/videojs/video.js/pull/1312))
* Exported missing Player API methods (remainingTime, supportsFullScreen, enterFullWindow, exitFullWindow, preload) ([view](https://github.com/videojs/video.js/pull/1328))
* Added a base for running saucelabs tests from grunt ([view](https://github.com/videojs/video.js/pull/1215))

--------------------

Expand Down
25 changes: 24 additions & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
module.exports = function(grunt) {
var pkg, s3, semver, version, verParts, uglify;
var pkg, s3, semver, version, verParts, uglify, exec;

semver = require('semver');
pkg = grunt.file.readJSON('package.json');
uglify = require('uglify-js');
exec = require('child_process').exec;

try {
s3 = grunt.file.readJSON('.s3config.json');
Expand Down Expand Up @@ -373,6 +374,28 @@ module.exports = function(grunt) {
}
});

grunt.registerTask('saucelabs', function() {
var done = this.async();

if (this.args[0] == 'connect') {
exec('curl https://gist.githubusercontent.com/santiycr/5139565/raw/sauce_connect_setup.sh | bash',
function(error, stdout, stderr) {
if (error) {
grunt.log.error(error);
return done();
}

grunt.verbose.error(stderr.toString());
grunt.verbose.writeln(stdout.toString());
grunt.task.run(['karma:saucelabs']);
done();
});
} else {
grunt.task.run(['karma:saucelabs']);
done();
}
});

var fs = require('fs'),
gzip = require('zlib').gzip;

Expand Down

0 comments on commit 56f2fe5

Please sign in to comment.