mirror of
https://github.com/jquery/jquery.git
synced 2024-11-23 02:54:22 +00:00
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.
This commit is contained in:
parent
c29e9c4db1
commit
aa951a3184
@ -2,14 +2,16 @@ module.exports = function( grunt ) {
|
|||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
grunt.registerTask( "testswarm", function( commit, configFile, browserSets, timeout ) {
|
grunt.registerTask( "testswarm", function( commit, configFile, projectName ) {
|
||||||
var jobName,
|
var jobName, config, tests,
|
||||||
testswarm = require( "testswarm" ),
|
testswarm = require( "testswarm" ),
|
||||||
runs = {},
|
runs = {},
|
||||||
done = this.async(),
|
done = this.async(),
|
||||||
pull = /PR-(\d+)/.exec( commit ),
|
pull = /PR-(\d+)/.exec( commit );
|
||||||
config = grunt.file.readJSON( configFile ).jquery,
|
|
||||||
tests = grunt.config([ this.name, "tests" ]);
|
projectName = projectName || "jquery";
|
||||||
|
config = grunt.file.readJSON( configFile )[ projectName ];
|
||||||
|
tests = grunt.config([ this.name, "tests" ]);
|
||||||
|
|
||||||
if ( pull ) {
|
if ( pull ) {
|
||||||
jobName = "Pull <a href='https://github.com/jquery/jquery/pull/" +
|
jobName = "Pull <a href='https://github.com/jquery/jquery/pull/" +
|
||||||
@ -36,8 +38,10 @@ module.exports = function( grunt ) {
|
|||||||
name: jobName,
|
name: jobName,
|
||||||
runs: runs,
|
runs: runs,
|
||||||
runMax: config.runMax,
|
runMax: config.runMax,
|
||||||
browserSets: browserSets || [ "popular-no-old-ie", "ios" ],
|
browserSets: projectName === "jquery" ?
|
||||||
timeout: timeout || 1000 * 60 * 30
|
[ "popular-no-old-ie", "ios" ] :
|
||||||
|
"weekly-no-old-ie",
|
||||||
|
timeout: projectName === "jquery" ? 1000 * 60 * 30 : 1000 * 60 * 60 * 4
|
||||||
}, function( err, passed ) {
|
}, function( err, passed ) {
|
||||||
if ( err ) {
|
if ( err ) {
|
||||||
grunt.log.error( err );
|
grunt.log.error( err );
|
||||||
|
Loading…
Reference in New Issue
Block a user