]> source.dussan.org Git - jquery-ui.git/commitdiff
Build: Also update the testswarm tasks itself
authorJörn Zaefferer <joern.zaefferer@gmail.com>
Tue, 11 Jun 2013 16:55:13 +0000 (18:55 +0200)
committerJörn Zaefferer <joern.zaefferer@gmail.com>
Tue, 11 Jun 2013 16:55:13 +0000 (18:55 +0200)
build/tasks/testswarm.js

index 5d74255159116ae9387d2198ba341118a58d24e9..c7aeea1de563690396fc0f7b4b250c9a79bce9d6 100644 (file)
@@ -4,6 +4,7 @@ module.exports = function( grunt ) {
 
 var versions = {
                "git": "git",
+               "1.9": "1.9.0 1.9.1",
                "1.8": "1.8.0 1.8.1 1.8.2 1.8.3",
                "1.7": "1.7 1.7.1 1.7.2",
                "1.6": "1.6 1.6.1 1.6.2 1.6.3 1.6.4"
@@ -34,29 +35,39 @@ var versions = {
                "Widget": "widget/widget.html"
        };
 
-function submit( commit, tests, configFile, version, done ) {
-       var test,
+function submit( commit, runs, configFile, extra, done ) {
+       var testName,
                testswarm = require( "testswarm" ),
                config = grunt.file.readJSON( configFile ).jqueryui,
-               testBase = config.testUrl + commit + "/tests/unit/",
-               testUrls = [];
-       for ( test in tests ) {
-               testUrls.push( testBase + tests[ test ] );
+               commitUrl = "https://github.com/jquery/jquery-ui/commit/" + commit;
+
+       if ( extra ) {
+               extra = " " + extra;
        }
-       version = version ? ( version + " " ) : "";
-       testswarm({
+
+       for ( testName in runs ) {
+               runs[ testName ] = config.testUrl + commit + "/tests/unit/" + runs[ testName ];
+       }
+       testswarm.createClient({
                url: config.swarmUrl,
                pollInterval: 10000,
-               timeout: 1000 * 60 * 45,
-               done: done
-       }, {
-               authUsername: config.authUsername,
-               authToken: config.authToken,
-               jobName: 'jQuery UI 1-9 ' + version + '#<a href="https://github.com/jquery/jquery-ui/commit/' + commit + '">' + commit.substr( 0, 10 ) + '</a>',
+               timeout: 1000 * 60 * 45
+       })
+       .addReporter( testswarm.reporters.cli )
+       .auth({
+               id: config.authUsername,
+               token: config.authToken
+       })
+       .addjob({
+               name: "jQuery UI 1-9 #<a href='" + commitUrl + "'>" + commit.substr( 0, 10 ) + "</a>" + extra,
+               runs: runs,
                runMax: config.runMax,
-               "runNames[]": Object.keys(tests),
-               "runUrls[]": testUrls,
-               "browserSets[]": ["popular"]
+               browserSets: config.browserSets
+       }, function( error, passed ) {
+               if ( error ) {
+                       grunt.log.error( error );
+               }
+               done( passed );
        });
 }
 
@@ -76,7 +87,7 @@ grunt.registerTask( "testswarm-multi-jquery", function( commit, configFile, mino
                        allTests[ test + "-" + version ] = tests[ test ] + "?nojshint=true&jquery=" + version;
                }
        });
-       submit( commit, allTests, configFile, minor + " core", this.async() );
+       submit( commit, allTests, configFile, "core " + minor, this.async() );
 });
 
 };