Gruntfile: Remove project prefix from TestSwarm job name, close gh-1387
[jquery.git] / build / tasks / testswarm.js
blob449963818337e257e7706c386ccea16b35ca06b5
1 module.exports = function( grunt ) {
3 "use strict";
5 grunt.registerTask( "testswarm", function( commit, configFile ) {
6 var jobName,
7 testswarm = require( "testswarm" ),
8 runs = {},
9 done = this.async(),
10 pull = /PR-(\d+)/.exec( commit ),
11 config = grunt.file.readJSON( configFile ).jquery,
12 tests = grunt.config([ this.name, "tests" ]);
14 if ( pull ) {
15 jobName = "Pull <a href='https://github.com/jquery/jquery/pull/" +
16 pull[ 1 ] + "'>#" + pull[ 1 ] + "</a>";
17 } else {
18 jobName = "Commit <a href='https://github.com/jquery/jquery/commit/" +
19 commit + "'>" + commit.substr( 0, 10 ) + "</a>";
22 tests.forEach(function( test ) {
23 runs[ test ] = config.testUrl + commit + "/test/index.html?module=" + test;
24 });
26 testswarm.createClient( {
27 url: config.swarmUrl,
28 pollInterval: 10000,
29 timeout: 1000 * 60 * 30
30 } )
31 .addReporter( testswarm.reporters.cli )
32 .auth( {
33 id: config.authUsername,
34 token: config.authToken
36 .addjob(
38 name: jobName,
39 runs: runs,
40 runMax: config.runMax,
41 browserSets: "popular-no-old-ie"
42 }, function( err, passed ) {
43 if ( err ) {
44 grunt.log.error( err );
46 done( passed );
49 });