diff options
author | Michał Gołębiowski-Owczarek <m.goleb@gmail.com> | 2020-09-25 09:40:33 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-25 09:40:33 +0200 |
commit | 6bf38048f30886ae0545bb48df7c5a2011dff2b0 (patch) | |
tree | 38503667704c794da594e6bfa49ce9d687577f44 | |
parent | dadde722a40ee41bd721e7d4609ee190815055c2 (diff) | |
download | jquery-ui-6bf38048f30886ae0545bb48df7c5a2011dff2b0.tar.gz jquery-ui-6bf38048f30886ae0545bb48df7c5a2011dff2b0.zip |
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
-rw-r--r-- | build/tasks/testswarm.js | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/build/tasks/testswarm.js b/build/tasks/testswarm.js index 1df08d622..85d4af07f 100644 --- a/build/tasks/testswarm.js +++ b/build/tasks/testswarm.js @@ -47,13 +47,19 @@ var versions = { "Widget": "widget/widget.html" }; -function submit( commit, runs, configFile, extra, done ) { +function submit( commit, runs, configFile, browserSets, extra, done ) { var testName, testswarm = require( "testswarm" ), config = grunt.file.readJSON( configFile ).jqueryui, - browserSets = config.browserSets, commitUrl = "https://github.com/jquery/jquery-ui/commit/" + commit; + browserSets = browserSets || config.browserSets; + if ( browserSets[ 0 ] === "[" ) { + + // We got an array, parse it + browserSets = JSON.parse( browserSets ); + } + if ( extra ) { extra = " (" + extra + ")"; } @@ -84,23 +90,23 @@ function submit( commit, runs, configFile, extra, done ) { } ); } -grunt.registerTask( "testswarm", function( commit, configFile ) { +grunt.registerTask( "testswarm", function( commit, configFile, browserSets ) { var test, latestTests = {}; for ( test in tests ) { latestTests[ test ] = tests[ test ] + "?nojshint=true"; } - submit( commit, latestTests, configFile, "", this.async() ); + submit( commit, latestTests, configFile, browserSets, "", this.async() ); } ); -grunt.registerTask( "testswarm-multi-jquery", function( commit, configFile, minor ) { +grunt.registerTask( "testswarm-multi-jquery", function( commit, configFile, minor, browserSets ) { var allTests = {}; versions[ minor ].split( " " ).forEach( function( version ) { for ( var test in tests ) { allTests[ test + "-" + version ] = tests[ test ] + "?nojshint=true&jquery=" + version; } } ); - submit( commit, allTests, configFile, "core " + minor, this.async() ); + submit( commit, allTests, configFile, browserSets, "core " + minor, this.async() ); } ); }; |