@@ -4,7 +4,7 @@ module.exports = function( grunt ) {
44
55var versions = {
66 "git" : "git" ,
7- "1.9" : "1.9.0" ,
7+ "1.9" : "1.9.0 1.9.1 " ,
88 "1.8" : "1.8.0 1.8.1 1.8.2 1.8.3" ,
99 "1.7" : "1.7 1.7.1 1.7.2" ,
1010 "1.6" : "1.6 1.6.1 1.6.2 1.6.3 1.6.4"
@@ -34,31 +34,37 @@ var versions = {
3434 "Widget" : "widget/widget.html"
3535 } ;
3636
37- function submit ( commit , tests , configFile , version , done ) {
38- var test ,
37+ function submit ( commit , runs , configFile , version , done ) {
38+ var testName ,
3939 testswarm = require ( "testswarm" ) ,
40- config = grunt . file . readJSON ( configFile ) . jqueryui ,
41- testBase = config . testUrl + commit + "/tests/unit/" ,
42- testUrls = [ ] ;
43- for ( test in tests ) {
44- testUrls . push ( testBase + tests [ test ] ) ;
45- }
40+ config = grunt . file . readJSON ( configFile ) . jqueryui ;
4641 version = version ? ( version + " " ) : "" ;
47- testswarm ( {
42+ for ( testName in runs ) {
43+ runs [ testName ] = config . testUrl + commit + "/tests/unit/" + runs [ testName ] ;
44+ }
45+ testswarm . createClient ( {
4846 url : config . swarmUrl ,
4947 pollInterval : 10000 ,
50- timeout : 1000 * 60 * 45 ,
51- done : done
52- } , {
53- authUsername : config . authUsername ,
54- authToken : config . authToken ,
55- // TODO don't merge this to master, or undo it
56- jobName : 'jQuery UI / Selectmenu ' + version + '#<a href="https://github.com/jquery/jquery-ui/commit/' + commit + '">' + commit . substr ( 0 , 10 ) + '</a>' ,
57- runMax : config . runMax ,
58- "runNames[]" : Object . keys ( tests ) ,
59- "runUrls[]" : testUrls ,
60- "browserSets[]" : config . browserSets
61- } ) ;
48+ timeout : 1000 * 60 * 45
49+ } )
50+ . addReporter ( testswarm . reporters . cli )
51+ . auth ( {
52+ id : config . authUsername ,
53+ token : config . authToken
54+ } )
55+ . addjob (
56+ {
57+ name : 'jQuery UI ' + version + '#<a href="https://github.com/jquery/jquery-ui/commit/' + commit + '">' + commit . substr ( 0 , 10 ) + '</a>' ,
58+ runs : runs ,
59+ runMax : config . runMax ,
60+ browserSets : config . browserSets
61+ } , function ( err , passed ) {
62+ if ( err ) {
63+ grunt . log . error ( err ) ;
64+ }
65+ done ( passed ) ;
66+ }
67+ ) ;
6268}
6369
6470grunt . registerTask ( "testswarm" , function ( commit , configFile ) {
0 commit comments