Skip to content

Commit 6bf3804

Browse files
authored
Build: Allow to specify browser sets to TestSwarm tasks
This will make it easier to e.g. now exclude Edge Legacy when testing against jQuery 4.x. Closes gh-1936
1 parent dadde72 commit 6bf3804

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

build/tasks/testswarm.js

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,19 @@ var versions = {
4747
"Widget": "widget/widget.html"
4848
};
4949

50-
function submit( commit, runs, configFile, extra, done ) {
50+
function submit( commit, runs, configFile, browserSets, extra, done ) {
5151
var testName,
5252
testswarm = require( "testswarm" ),
5353
config = grunt.file.readJSON( configFile ).jqueryui,
54-
browserSets = config.browserSets,
5554
commitUrl = "https://github.com/jquery/jquery-ui/commit/" + commit;
5655

56+
browserSets = browserSets || config.browserSets;
57+
if ( browserSets[ 0 ] === "[" ) {
58+
59+
// We got an array, parse it
60+
browserSets = JSON.parse( browserSets );
61+
}
62+
5763
if ( extra ) {
5864
extra = " (" + extra + ")";
5965
}
@@ -84,23 +90,23 @@ function submit( commit, runs, configFile, extra, done ) {
8490
} );
8591
}
8692

87-
grunt.registerTask( "testswarm", function( commit, configFile ) {
93+
grunt.registerTask( "testswarm", function( commit, configFile, browserSets ) {
8894
var test,
8995
latestTests = {};
9096
for ( test in tests ) {
9197
latestTests[ test ] = tests[ test ] + "?nojshint=true";
9298
}
93-
submit( commit, latestTests, configFile, "", this.async() );
99+
submit( commit, latestTests, configFile, browserSets, "", this.async() );
94100
} );
95101

96-
grunt.registerTask( "testswarm-multi-jquery", function( commit, configFile, minor ) {
102+
grunt.registerTask( "testswarm-multi-jquery", function( commit, configFile, minor, browserSets ) {
97103
var allTests = {};
98104
versions[ minor ].split( " " ).forEach( function( version ) {
99105
for ( var test in tests ) {
100106
allTests[ test + "-" + version ] = tests[ test ] + "?nojshint=true&jquery=" + version;
101107
}
102108
} );
103-
submit( commit, allTests, configFile, "core " + minor, this.async() );
109+
submit( commit, allTests, configFile, browserSets, "core " + minor, this.async() );
104110
} );
105111

106112
};

0 commit comments

Comments
 (0)