]> source.dussan.org Git - jquery.git/commitdiff
Build: Refactor testswarm Grunt task options
authorMichał Gołębiowski <m.goleb@gmail.com>
Sun, 16 Mar 2014 03:09:12 +0000 (04:09 +0100)
committerMichał Gołębiowski <m.goleb@gmail.com>
Sun, 16 Mar 2014 03:14:03 +0000 (04:14 +0100)
Add a possibility to specify the project name. Infer browserSets & timeout
out of it instead of defining it in the Jenkins configuration.

build/tasks/testswarm.js

index 3de7a089b551604e6932fa07cfee35540f4e24f0..c4839ae603ef6c5aa27474fb5ecfbd7ac2586964 100644 (file)
@@ -2,14 +2,16 @@ module.exports = function( grunt ) {
 
        "use strict";
 
-       grunt.registerTask( "testswarm", function( commit, configFile, browserSets, timeout ) {
-               var jobName,
+       grunt.registerTask( "testswarm", function( commit, configFile, projectName ) {
+               var jobName, config, tests,
                        testswarm = require( "testswarm" ),
                        runs = {},
                        done = this.async(),
-                       pull = /PR-(\d+)/.exec( commit ),
-                       config = grunt.file.readJSON( configFile ).jquery,
-                       tests = grunt.config([ this.name, "tests" ]);
+                       pull = /PR-(\d+)/.exec( commit );
+
+               projectName = projectName || "jquery";
+               config = grunt.file.readJSON( configFile )[ projectName ];
+               tests = grunt.config([ this.name, "tests" ]);
 
                if ( pull ) {
                        jobName = "Pull <a href='https://github.com/jquery/jquery/pull/" +
@@ -36,8 +38,10 @@ module.exports = function( grunt ) {
                                name: jobName,
                                runs: runs,
                                runMax: config.runMax,
-                               browserSets: browserSets || [ "popular-no-old-ie", "ios" ],
-                               timeout: timeout || 1000 * 60 * 30
+                               browserSets: projectName === "jquery" ?
+                                       [ "popular-no-old-ie", "ios" ] :
+                                       "weekly-no-old-ie",
+                               timeout: projectName === "jquery" ? 1000 * 60 * 30 : 1000 * 60 * 60 * 4
                        }, function( err, passed ) {
                                if ( err ) {
                                        grunt.log.error( err );