Skip to content

Commit 0e0d51d

Browse files
committed
Upgrade to node-testswarm 1.0. -alpha works well, tested with QUnit already.
1 parent 7bbda71 commit 0e0d51d

File tree

2 files changed

+28
-21
lines changed

2 files changed

+28
-21
lines changed

build/tasks/testswarm.js

Lines changed: 27 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -33,30 +33,37 @@ var versions = {
3333
"Widget": "widget/widget.html"
3434
};
3535

36-
function submit( commit, tests, configFile, version, done ) {
37-
var test,
36+
function submit( commit, runs, configFile, version, done ) {
37+
var testName,
3838
testswarm = require( "testswarm" ),
39-
config = grunt.file.readJSON( configFile ).jqueryui,
40-
testBase = config.testUrl + commit + "/tests/unit/",
41-
testUrls = [];
42-
for ( test in tests ) {
43-
testUrls.push( testBase + tests[ test ] );
44-
}
39+
config = grunt.file.readJSON( configFile ).jqueryui;
4540
version = version ? ( version + " " ) : "";
46-
testswarm({
41+
for ( testName in runs ) {
42+
runs[ testName] = config.testUrl + commit + "/tests/unit/" + runs[ testName ];
43+
}
44+
testswarm.createClient( {
4745
url: config.swarmUrl,
4846
pollInterval: 10000,
49-
timeout: 1000 * 60 * 45,
50-
done: done
51-
}, {
52-
authUsername: config.authUsername,
53-
authToken: config.authToken,
54-
jobName: 'jQuery UI ' + version + '#<a href="https://github.com/jquery/jquery-ui/commit/' + commit + '">' + commit.substr( 0, 10 ) + '</a>',
55-
runMax: config.runMax,
56-
"runNames[]": Object.keys( tests ),
57-
"runUrls[]": testUrls,
58-
"browserSets[]": config.browserSets
59-
});
47+
timeout: 1000 * 60 * 45
48+
} )
49+
.addReporter( testswarm.reporters.cli )
50+
.auth( {
51+
id: config.authUsername,
52+
token: config.authToken
53+
} )
54+
.addjob(
55+
{
56+
name: 'jQuery UI ' + version + '#<a href="https://github.com/jquery/jquery-ui/commit/' + commit + '">' + commit.substr( 0, 10 ) + '</a>',
57+
runs: runs,
58+
runMax: config.runMax,
59+
browserSets: config.browserSets
60+
}, function( err, passed ) {
61+
if ( err ) {
62+
grunt.log.error( err );
63+
}
64+
done( passed );
65+
}
66+
);
6067
}
6168

6269
grunt.registerTask( "testswarm", function( commit, configFile ) {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
"grunt-junit": "0.1.5",
6161
"grunt-git-authors": "1.0.0",
6262
"rimraf": "2.0.1",
63-
"testswarm": "0.3.0"
63+
"testswarm": "1.0.0-alpha"
6464
},
6565
"keywords": []
6666
}

0 commit comments

Comments
 (0)