@@ -33,30 +33,37 @@ var versions = {
33
33
"Widget" : "widget/widget.html"
34
34
} ;
35
35
36
- function submit ( commit , tests , configFile , version , done ) {
37
- var test ,
36
+ function submit ( commit , runs , configFile , version , done ) {
37
+ var testName ,
38
38
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 ;
45
40
version = version ? ( version + " " ) : "" ;
46
- testswarm ( {
41
+ for ( testName in runs ) {
42
+ runs [ testName ] = config . testUrl + commit + "/tests/unit/" + runs [ testName ] ;
43
+ }
44
+ testswarm . createClient ( {
47
45
url : config . swarmUrl ,
48
46
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
+ ) ;
60
67
}
61
68
62
69
grunt . registerTask ( "testswarm" , function ( commit , configFile ) {
0 commit comments