]> source.dussan.org Git - jquery.git/commitdiff
Build: Update testswarm task to node-testswarm 1.x API
authorJörn Zaefferer <joern.zaefferer@gmail.com>
Wed, 5 Jun 2013 13:58:33 +0000 (15:58 +0200)
committerJörn Zaefferer <joern.zaefferer@gmail.com>
Wed, 5 Jun 2013 14:07:45 +0000 (16:07 +0200)
Gruntfile.js
package.json

index 5e909f423a63960f52a0994b9ffbb10e604b4158..4a024a472d96ae8f1de8daddfc186dc4c9f31e8d 100644 (file)
@@ -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() {
index a798d144910fcfe610805a6cb6a161a89dbcc9c0..4b79529469fe08df7454d48dea053ecd3625446c 100644 (file)
@@ -31,7 +31,7 @@
                "grunt-contrib-uglify": "0.2.0",
                "grunt": "0.4.1",
                "gzip-js": "0.3.1",
-               "testswarm": "0.2.2",
+               "testswarm": "~1.1.0",
                "archiver": "~0.4.2"
        },
        "keywords": []