]> source.dussan.org Git - jquery.git/commitdiff
Build: use browserSets from config file; allow to override
authorMichał Gołębiowski <m.goleb@gmail.com>
Tue, 15 Apr 2014 09:34:02 +0000 (11:34 +0200)
committerMichał Gołębiowski <m.goleb@gmail.com>
Tue, 15 Apr 2014 09:45:22 +0000 (11:45 +0200)
(cherry-picked from 7869891a97eae93699cc239274e73e53daedf781)

build/tasks/testswarm.js

index f6fd8e750f2e2335829888bf5a71ae369efc380c..91abf2794fa82b98fae6cf352366a0e0b9fefa2f 100644 (file)
@@ -2,7 +2,8 @@ module.exports = function( grunt ) {
 
        "use strict";
 
-       grunt.registerTask( "testswarm", function( commit, configFile, projectName ) {
+       grunt.registerTask( "testswarm", function( commit, configFile, projectName, browserSets,
+                       timeout ) {
                var jobName, config, tests,
                        testswarm = require( "testswarm" ),
                        runs = {},
@@ -11,6 +12,12 @@ module.exports = function( grunt ) {
 
                projectName = projectName || "jquery";
                config = grunt.file.readJSON( configFile )[ projectName ];
+               browserSets = browserSets || config.browserSets;
+               if ( browserSets[ 0 ] === "[" ) {
+                       // We got an array, parse it
+                       browserSets = JSON.parse( browserSets );
+               }
+               timeout = timeout || 1000 * 60 * 30;
                tests = grunt.config([ this.name, "tests" ]);
 
                if ( pull ) {
@@ -38,10 +45,8 @@ module.exports = function( grunt ) {
                                name: jobName,
                                runs: runs,
                                runMax: config.runMax,
-                               browserSets: projectName === "jqueryweekly" ?
-                                       "weekly" :
-                                       [ "popular", "ios" ],
-                               timeout: projectName === "jqueryweekly" ? 1000 * 60 * 60 : 1000 * 60 * 30
+                               browserSets: browserSets,
+                               timeout: timeout
                        }, function( err, passed ) {
                                if ( err ) {
                                        grunt.log.error( err );