Skip to content

Commit b657473

Browse files
committed
Grunt: Refactor testswarm task and add an experimental testswarm-multi-jquery task for testing across jQuery versions
1 parent 8e541f1 commit b657473

File tree

1 file changed

+46
-28
lines changed

1 file changed

+46
-28
lines changed

build/tasks/testswarm.js

Lines changed: 46 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,38 @@
1+
/*jshint node: true */
12
module.exports = function( grunt ) {
23

3-
grunt.registerTask( "testswarm", function( commit, configFile ) {
4+
var tests = {
5+
"Accordion": "accordion/accordion.html",
6+
"Accordion_deprecated": "accordion/accordion_deprecated.html",
7+
"Autocomplete": "autocomplete/autocomplete.html",
8+
"Button": "button/button.html",
9+
"Core": "core/core.html",
10+
//"datepicker/datepicker.html",
11+
//"dialog/dialog.html",
12+
//"draggable/draggable.html",
13+
//"droppable/droppable.html",
14+
"Effects": "effects/effects.html",
15+
"Menu": "menu/menu.html",
16+
"Position": "position/position.html",
17+
"Position_deprecated": "position/position_deprecated.html",
18+
"Progressbar": "progressbar/progressbar.html",
19+
//"resizable/resizable.html",
20+
//"selectable/selectable.html",
21+
//"slider/slider.html",
22+
//"sortable/sortable.html",
23+
"Spinner": "spinner/spinner.html",
24+
"Tabs": "tabs/tabs.html",
25+
"Tabs_deprecated": "tabs/tabs_deprecated.html",
26+
"Tooltip": "tooltip/tooltip.html",
27+
"Widget": "widget/widget.html"
28+
};
29+
30+
function submit( commit, tests, configFile ) {
431
var test,
532
testswarm = require( "testswarm" ),
633
config = grunt.file.readJSON( configFile ).jqueryui,
734
testBase = config.testUrl + commit + "/tests/unit/",
8-
testUrls = [],
9-
tests = {
10-
"Accordion": "accordion/accordion.html",
11-
"Accordion_deprecated": "accordion/accordion_deprecated.html",
12-
"Autocomplete": "autocomplete/autocomplete.html",
13-
"Button": "button/button.html",
14-
"Core": "core/core.html",
15-
//"datepicker/datepicker.html",
16-
//"dialog/dialog.html",
17-
//"draggable/draggable.html",
18-
//"droppable/droppable.html",
19-
"Effects": "effects/effects.html",
20-
"Menu": "menu/menu.html",
21-
"Position": "position/position.html",
22-
"Position_deprecated": "position/position_deprecated.html",
23-
"Progressbar": "progressbar/progressbar.html",
24-
//"resizable/resizable.html",
25-
//"selectable/selectable.html",
26-
//"slider/slider.html",
27-
//"sortable/sortable.html",
28-
"Spinner": "spinner/spinner.html",
29-
"Tabs": "tabs/tabs.html",
30-
"Tabs_deprecated": "tabs/tabs_deprecated.html",
31-
"Tooltip": "tooltip/tooltip.html",
32-
"Widget": "widget/widget.html"
33-
};
35+
testUrls = [];
3436
for ( test in tests ) {
3537
testUrls.push( testBase + tests[ test ] + "?nojshint=true" );
3638
}
@@ -40,14 +42,30 @@ grunt.registerTask( "testswarm", function( commit, configFile ) {
4042
timeout: 1000 * 60 * 30,
4143
done: this.async()
4244
}, {
43-
authUsername: "jqueryui",
45+
authUsername: config.authUsername,
4446
authToken: config.authToken,
4547
jobName: 'jQuery UI commit #<a href="https://github.com/jquery/jquery-ui/commit/' + commit + '">' + commit.substr( 0, 10 ) + '</a>',
4648
runMax: config.runMax,
4749
"runNames[]": Object.keys(tests),
4850
"runUrls[]": testUrls,
4951
"browserSets[]": ["popular"]
5052
});
53+
}
54+
55+
grunt.registerTask( "testswarm", function( commit, configFile ) {
56+
submit( commit, tests, configFile );
57+
});
58+
59+
grunt.registerTask( "testswarm-multi-jquery", function( commit, configFile ) {
60+
var test,
61+
allTests = {};
62+
for ( test in tests ) {
63+
allTests[ test + "-1.6.3" ] = tests[ test ] + "?nojshint=true&jquery=1.6.3";
64+
}
65+
for ( test in tests ) {
66+
allTests[ test + "-1.7.2" ] = tests[ test ] + "?nojshint=true&jquery=1.7.2";
67+
}
68+
submit( commit, allTests, configFile );
5169
});
5270

5371
};

0 commit comments

Comments
 (0)