grunt.registerTask( "testswarm", function( commit, configFile ) {
var jobName,
testswarm = require( "testswarm" ),
- testUrls = [],
+ runs = {},
+ done = this.async(),
pull = /PR-(\d+)/.exec( commit ),
config = grunt.file.readJSON( configFile ).jquery,
tests = grunt.config([ this.name, "tests" ]);
}
tests.forEach(function( test ) {
- testUrls.push( config.testUrl + commit + "/test/index.html?module=" + test );
+ runs[test] = config.testUrl + commit + "/test/index.html?module=" + test;
});
- testswarm({
+ // TODO: create separate job for git/git2 so we can do different browsersets
+ testswarm.createClient( {
url: config.swarmUrl,
pollInterval: 10000,
- timeout: 1000 * 60 * 30,
- done: this.async()
- }, {
- authUsername: config.authUsername,
- authToken: config.authToken,
- jobName: jobName,
- runMax: config.runMax,
- "runNames[]": tests,
- "runUrls[]": testUrls,
- "browserSets[]": "popular-no-old-ie"
- });
+ timeout: 1000 * 60 * 30
+ } )
+ .addReporter( testswarm.reporters.cli )
+ .auth( {
+ id: config.authUsername,
+ token: config.authToken
+ })
+ .addjob(
+ {
+ name: jobName,
+ runs: runs,
+ runMax: config.runMax,
+ browserSets: "popular-no-old-ie"
+ }, function( err, passed ) {
+ if ( err ) {
+ grunt.log.error( err );
+ }
+ done( passed );
+ }
+ );
});
grunt.registerTask( "selector", "Build Sizzle-based selector module", function() {