diff options
author | Jörn Zaefferer <joern.zaefferer@gmail.com> | 2013-06-05 15:58:33 +0200 |
---|---|---|
committer | Jörn Zaefferer <joern.zaefferer@gmail.com> | 2013-06-05 16:07:45 +0200 |
commit | f22b0745ada5af7fd163ec3809496e1d09269f35 (patch) | |
tree | 7fc294236b5612ef14666adb62eec680b9725058 /Gruntfile.js | |
parent | 4ad18e0b2a93beeed1984a4e7335274251197500 (diff) | |
download | jquery-f22b0745ada5af7fd163ec3809496e1d09269f35.tar.gz jquery-f22b0745ada5af7fd163ec3809496e1d09269f35.zip |
Build: Update testswarm task to node-testswarm 1.x API
Diffstat (limited to 'Gruntfile.js')
-rw-r--r-- | Gruntfile.js | 38 |
1 files changed, 24 insertions, 14 deletions
diff --git a/Gruntfile.js b/Gruntfile.js index 5e909f423..4a024a472 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -159,7 +159,8 @@ module.exports = function( grunt ) { grunt.registerTask( "testswarm", function( commit, configFile ) { var jobName, testswarm = require( "testswarm" ), - testUrls = [], + runs = {}, + done = this.async(), pull = /PR-(\d+)/.exec( commit ), config = grunt.file.readJSON( configFile ).jquery, tests = grunt.config([ this.name, "tests" ]); @@ -173,23 +174,32 @@ module.exports = function( grunt ) { } tests.forEach(function( test ) { - testUrls.push( config.testUrl + commit + "/test/index.html?module=" + test ); + runs[test] = config.testUrl + commit + "/test/index.html?module=" + test; }); - testswarm({ + testswarm.createClient( { url: config.swarmUrl, pollInterval: 10000, - timeout: 1000 * 60 * 30, - done: this.async() - }, { - authUsername: config.authUsername, - authToken: config.authToken, - jobName: jobName, - runMax: config.runMax, - "runNames[]": tests, - "runUrls[]": testUrls, - "browserSets[]": config.browserSets - }); + timeout: 1000 * 60 * 30 + } ) + .addReporter( testswarm.reporters.cli ) + .auth( { + id: config.authUsername, + token: config.authToken + }) + .addjob( + { + name: jobName, + runs: runs, + runMax: config.runMax, + browserSets: config.browserSets + }, function( err, passed ) { + if ( err ) { + grunt.log.error( err ); + } + done( passed ); + } + ); }); grunt.registerTask( "selector", "Build Sizzle-based selector module", function() { |