Build: Also update the testswarm tasks itself

This commit is contained in:
Jörn Zaefferer 2013-06-11 18:55:13 +02:00
parent 0b3d689d33
commit 62b30d04b3

View File

@ -4,6 +4,7 @@ module.exports = function( grunt ) {
var versions = { var versions = {
"git": "git", "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.8": "1.8.0 1.8.1 1.8.2 1.8.3",
"1.7": "1.7 1.7.1 1.7.2", "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" "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" "Widget": "widget/widget.html"
}; };
function submit( commit, tests, configFile, version, done ) { function submit( commit, runs, configFile, extra, done ) {
var test, var testName,
testswarm = require( "testswarm" ), testswarm = require( "testswarm" ),
config = grunt.file.readJSON( configFile ).jqueryui, config = grunt.file.readJSON( configFile ).jqueryui,
testBase = config.testUrl + commit + "/tests/unit/", commitUrl = "https://github.com/jquery/jquery-ui/commit/" + commit;
testUrls = [];
for ( test in tests ) { if ( extra ) {
testUrls.push( testBase + tests[ test ] ); extra = " " + extra;
} }
version = version ? ( version + " " ) : "";
testswarm({ for ( testName in runs ) {
runs[ testName ] = config.testUrl + commit + "/tests/unit/" + runs[ testName ];
}
testswarm.createClient({
url: config.swarmUrl, url: config.swarmUrl,
pollInterval: 10000, pollInterval: 10000,
timeout: 1000 * 60 * 45, timeout: 1000 * 60 * 45
done: done })
}, { .addReporter( testswarm.reporters.cli )
authUsername: config.authUsername, .auth({
authToken: config.authToken, id: config.authUsername,
jobName: 'jQuery UI 1-9 ' + version + '#<a href="https://github.com/jquery/jquery-ui/commit/' + commit + '">' + commit.substr( 0, 10 ) + '</a>', token: config.authToken
})
.addjob({
name: "jQuery UI 1-9 #<a href='" + commitUrl + "'>" + commit.substr( 0, 10 ) + "</a>" + extra,
runs: runs,
runMax: config.runMax, runMax: config.runMax,
"runNames[]": Object.keys(tests), browserSets: config.browserSets
"runUrls[]": testUrls, }, function( error, passed ) {
"browserSets[]": ["popular"] 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; 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() );
}); });
}; };