Github
This repository
This repository
All repositories
Browse code

Build: Update testswarm task to node-testswarm 1.x API

commit 8643ac77fbd7508651639a41eced5338c1738c12 1 parent 6b46fde
authored

Showing 2 changed files with 26 additions and 15 deletions. Show Diff Stats Hide Diff Stats

  1. 39  Gruntfile.js
  2. 2  package.json
39  Gruntfile.js
... ... @@ -163,7 +163,8 @@ module.exports = function( grunt ) {
163 163    grunt.registerTask( "testswarm", function( commit, configFile ) {
164 164      var jobName,
165 165        testswarm = require( "testswarm" ),
166   -      testUrls = [],
  166 +      runs = {},
  167 +      done = this.async(),
167 168        pull = /PR-(\d+)/.exec( commit ),
168 169        config = grunt.file.readJSON( configFile ).jquery,
169 170        tests = grunt.config([ this.name, "tests" ]);
... ... @@ -177,23 +178,33 @@ module.exports = function( grunt ) {
177 178      }
178 179  
179 180      tests.forEach(function( test ) {
180   -      testUrls.push( config.testUrl + commit + "/test/index.html?module=" + test );
  181 +      runs[test] = config.testUrl + commit + "/test/index.html?module=" + test;
181 182      });
182 183  
183   -    testswarm({
  184 +    // TODO: create separate job for git/git2 so we can do different browsersets
  185 +    testswarm.createClient( {
184 186        url: config.swarmUrl,
185 187        pollInterval: 10000,
186   -      timeout: 1000 * 60 * 30,
187   -      done: this.async()
188   -    }, {
189   -      authUsername: config.authUsername,
190   -      authToken: config.authToken,
191   -      jobName: jobName,
192   -      runMax: config.runMax,
193   -      "runNames[]": tests,
194   -      "runUrls[]": testUrls,
195   -      "browserSets[]": "popular-no-old-ie"
196   -    });
  188 +      timeout: 1000 * 60 * 30
  189 +    } )
  190 +    .addReporter( testswarm.reporters.cli )
  191 +    .auth( {
  192 +      id: config.authUsername,
  193 +      token: config.authToken
  194 +    })
  195 +    .addjob(
  196 +      {
  197 +        name: jobName,
  198 +        runs: runs,
  199 +        runMax: config.runMax,
  200 +        browserSets: "popular-no-old-ie"
  201 +      }, function( err, passed ) {
  202 +        if ( err ) {
  203 +          grunt.log.error( err );
  204 +        }
  205 +        done( passed );
  206 +      }
  207 +    );
197 208    });
198 209  
199 210    grunt.registerTask( "selector", "Build Sizzle-based selector module", function() {
2  package.json
... ... @@ -31,7 +31,7 @@
31 31      "grunt-contrib-uglify": "0.2.0",
32 32      "grunt": "0.4.1",
33 33      "gzip-js": "0.3.1",
34   -    "testswarm": "0.2.2",
  34 +    "testswarm": "~1.1.0",
35 35      "archiver": "~0.4.2"
36 36    },
37 37    "keywords": []

0 notes on commit 8643ac7

Please sign in to comment.
Something went wrong with that request. Please try again.