@@ -110,7 +110,8 @@ module.exports = function(grunt) {
110
110
grunt . registerTask ( "testswarm" , function ( commit , configFile ) {
111
111
var jobName ,
112
112
testswarm = require ( "testswarm" ) ,
113
- testUrls = [ ] ,
113
+ runs = { } ,
114
+ done = this . async ( ) ,
114
115
pull = / P R - ( \d + ) / . exec ( commit ) ,
115
116
config = grunt . file . readJSON ( configFile ) . jquerymigrate ,
116
117
tests = grunt . config ( "tests" ) ;
@@ -125,25 +126,34 @@ module.exports = function(grunt) {
125
126
126
127
tests . forEach ( function ( test ) {
127
128
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 ] ;
130
131
} ) ;
131
132
132
133
// TODO: create separate job for git/git2 so we can do different browsersets
133
- testswarm ( {
134
+ testswarm . createClient ( {
134
135
url : config . swarmUrl ,
135
136
pollInterval : 10000 ,
136
137
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
+ )
147
157
} ) ;
148
158
149
159
// Update manifest for jQuery plugin registry
0 commit comments