]> source.dussan.org Git - jquery.git/commitdiff
Build: Allow to specify timeout in the testswarm task
authorMichał Gołębiowski <m.goleb@gmail.com>
Tue, 11 Mar 2014 20:12:39 +0000 (21:12 +0100)
committerMichał Gołębiowski <m.goleb@gmail.com>
Tue, 11 Mar 2014 20:12:39 +0000 (21:12 +0100)
build/tasks/testswarm.js

index 9a69b2253d8d075127bbc10ed05c900d0a048153..135a3cc7efa2b0e6a180a78f1b9ad0121fe4cd0d 100644 (file)
@@ -2,7 +2,7 @@ module.exports = function( grunt ) {
 
        "use strict";
 
-       grunt.registerTask( "testswarm", function( commit, configFile, browserSets ) {
+       grunt.registerTask( "testswarm", function( commit, configFile, browserSets, timeout ) {
                var jobName,
                        testswarm = require( "testswarm" ),
                        runs = {},
@@ -11,10 +11,6 @@ module.exports = function( grunt ) {
                        config = grunt.file.readJSON( configFile ).jquery,
                        tests = grunt.config([ this.name, "tests" ]);
 
-               if ( !browserSets ) {
-                       browserSets = [ "popular-no-old-ie", "ios" ];
-               }
-
                if ( pull ) {
                        jobName = "Pull <a href='https://github.com/jquery/jquery/pull/" +
                                pull[ 1 ] + "'>#" + pull[ 1 ] + "</a>";
@@ -30,7 +26,7 @@ module.exports = function( grunt ) {
                testswarm.createClient( {
                        url: config.swarmUrl,
                        pollInterval: 10000,
-                       timeout: 1000 * 60 * 30
+                       timeout: timeout || 1000 * 60 * 30
                } )
                .addReporter( testswarm.reporters.cli )
                .auth( {
@@ -42,7 +38,7 @@ module.exports = function( grunt ) {
                                name: jobName,
                                runs: runs,
                                runMax: config.runMax,
-                               browserSets: browserSets
+                               browserSets: browserSets || [ "popular-no-old-ie", "ios" ]
                        }, function( err, passed ) {
                                if ( err ) {
                                        grunt.log.error( err );