From: Jörn Zaefferer Date: Fri, 1 Feb 2013 17:44:51 +0000 (+0100) Subject: Upgrade to node-testswarm 1.0. -alpha works well, tested with QUnit already. X-Git-Tag: 1.10.1~24 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=0e0d51dced3b4ec1da72e543fd4e5161f285a5ee;p=jquery-ui.git Upgrade to node-testswarm 1.0. -alpha works well, tested with QUnit already. --- diff --git a/build/tasks/testswarm.js b/build/tasks/testswarm.js index cbc502bc3..f02c13138 100644 --- a/build/tasks/testswarm.js +++ b/build/tasks/testswarm.js @@ -33,30 +33,37 @@ var versions = { "Widget": "widget/widget.html" }; -function submit( commit, tests, configFile, version, done ) { - var test, +function submit( commit, runs, configFile, version, 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 ] ); - } + config = grunt.file.readJSON( configFile ).jqueryui; 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 ' + version + '#' + commit.substr( 0, 10 ) + '', - runMax: config.runMax, - "runNames[]": Object.keys( tests ), - "runUrls[]": testUrls, - "browserSets[]": config.browserSets - }); + timeout: 1000 * 60 * 45 + } ) + .addReporter( testswarm.reporters.cli ) + .auth( { + id: config.authUsername, + token: config.authToken + } ) + .addjob( + { + name: 'jQuery UI ' + version + '#' + commit.substr( 0, 10 ) + '', + runs: runs, + runMax: config.runMax, + browserSets: config.browserSets + }, function( err, passed ) { + if ( err ) { + grunt.log.error( err ); + } + done( passed ); + } + ); } grunt.registerTask( "testswarm", function( commit, configFile ) { diff --git a/package.json b/package.json index e02dac05b..15fe7daff 100644 --- a/package.json +++ b/package.json @@ -60,7 +60,7 @@ "grunt-junit": "0.1.5", "grunt-git-authors": "1.0.0", "rimraf": "2.0.1", - "testswarm": "0.3.0" + "testswarm": "1.0.0-alpha" }, "keywords": [] }