Skip to content

Commit ca38a94

Browse files
committed
Migrate to node-testswarm 1.x, necessary for current TestSwarm
1 parent a1c5eee commit ca38a94

File tree

2 files changed

+25
-15
lines changed

2 files changed

+25
-15
lines changed

Gruntfile.js

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,8 @@ module.exports = function(grunt) {
110110
grunt.registerTask( "testswarm", function( commit, configFile ) {
111111
var jobName,
112112
testswarm = require( "testswarm" ),
113-
testUrls = [],
113+
runs = {},
114+
done = this.async(),
114115
pull = /PR-(\d+)/.exec( commit ),
115116
config = grunt.file.readJSON( configFile ).jquerymigrate,
116117
tests = grunt.config("tests");
@@ -125,25 +126,34 @@ module.exports = function(grunt) {
125126

126127
tests.forEach(function( test ) {
127128
var plugin_jquery = test.split("+");
128-
testUrls.push( config.testUrl + commit + "/test/index.html?plugin=" +
129-
plugin_jquery[0] + "&jquery=" + plugin_jquery[1]);
129+
runs[test] = config.testUrl + commit + "/test/index.html?plugin=" +
130+
plugin_jquery[0] + "&jquery=" + plugin_jquery[1];
130131
});
131132

132133
// TODO: create separate job for git/git2 so we can do different browsersets
133-
testswarm({
134+
testswarm.createClient( {
134135
url: config.swarmUrl,
135136
pollInterval: 10000,
136137
timeout: 1000 * 60 * 30,
137-
done: this.async()
138-
}, {
139-
authUsername: config.authUsername,
140-
authToken: config.authToken,
141-
jobName: jobName,
142-
runMax: config.runMax,
143-
"runNames[]": tests,
144-
"runUrls[]": testUrls,
145-
"browserSets[]": "popular-no-old-ie"
146-
});
138+
} )
139+
.addReporter( testswarm.reporters.cli )
140+
.auth( {
141+
id: config.authUsername,
142+
token: config.authToken
143+
} )
144+
.addjob(
145+
{
146+
name: jobName,
147+
runs: runs,
148+
runMax: config.runMax,
149+
browserSets: "popular-no-old-ie"
150+
}, function( err, passed ) {
151+
if ( err ) {
152+
grunt.log.error( err );
153+
}
154+
done( passed );
155+
}
156+
)
147157
});
148158

149159
// Update manifest for jQuery plugin registry

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"grunt-contrib-jshint": "~0.2.0",
3333
"grunt-contrib-uglify": "~0.1.2",
3434
"grunt": "0.4.1",
35-
"testswarm": "0.2.2"
35+
"testswarm": "~1.1.0"
3636
},
3737
"keywords": []
3838
}

0 commit comments

Comments
 (0)