Skip to content
Permalink
Browse files

Build: Refactor testswarm Grunt task options

Add a possibility to specify the project name. Infer browserSets & timeout
out of it instead of defining it in the Jenkins configuration.
  • Loading branch information...
mgol committed Mar 16, 2014
1 parent c29e9c4 commit aa951a3184fc02551bfcb8381cdac28298432419
Showing with 11 additions and 7 deletions.
  1. +11 −7 build/tasks/testswarm.js
@@ -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 );

0 comments on commit aa951a3

Please sign in to comment.
You can’t perform that action at this time.