Upgrade to node-testswarm 1.0. -alpha works well, tested with QUnit already.

This commit is contained in:
Jörn Zaefferer 2013-02-01 18:44:51 +01:00
parent 7bbda71a32
commit 0e0d51dced
2 changed files with 28 additions and 21 deletions

View File

@ -33,30 +33,37 @@ var versions = {
"Widget": "widget/widget.html" "Widget": "widget/widget.html"
}; };
function submit( commit, tests, configFile, version, done ) { function submit( commit, runs, configFile, version, 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/",
testUrls = [];
for ( test in tests ) {
testUrls.push( testBase + tests[ test ] );
}
version = version ? ( version + " " ) : ""; 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 ' + version + '#<a href="https://github.com/jquery/jquery-ui/commit/' + commit + '">' + commit.substr( 0, 10 ) + '</a>', token: config.authToken
} )
.addjob(
{
name: 'jQuery UI ' + version + '#<a href="https://github.com/jquery/jquery-ui/commit/' + commit + '">' + commit.substr( 0, 10 ) + '</a>',
runs: runs,
runMax: config.runMax, runMax: config.runMax,
"runNames[]": Object.keys( tests ), browserSets: config.browserSets
"runUrls[]": testUrls, }, function( err, passed ) {
"browserSets[]": config.browserSets if ( err ) {
}); grunt.log.error( err );
}
done( passed );
}
);
} }
grunt.registerTask( "testswarm", function( commit, configFile ) { grunt.registerTask( "testswarm", function( commit, configFile ) {

View File

@ -60,7 +60,7 @@
"grunt-junit": "0.1.5", "grunt-junit": "0.1.5",
"grunt-git-authors": "1.0.0", "grunt-git-authors": "1.0.0",
"rimraf": "2.0.1", "rimraf": "2.0.1",
"testswarm": "0.3.0" "testswarm": "1.0.0-alpha"
}, },
"keywords": [] "keywords": []
} }