Skip to content

Commit

Permalink
Add optional singleMachineToTest
Browse files Browse the repository at this point in the history
  • Loading branch information
aars committed Sep 14, 2015
1 parent d337453 commit 679fb08
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion run-all-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,16 @@ var path = require('path');
require('json5/lib/require');


module.exports = function (mpPath, beforeRunningAnyTests, eachTestSuite, done){
module.exports = function (mpPath, singleMachineToTest, beforeRunningAnyTests, eachTestSuite, done){
// Support optional singleMachineToTest
if (arguments.length < 4) {
singleMachineToTest = false;
done = arguments[3];
eachTestSuite = arguments[2];
beforeRunningAnyTests = arguments[1];
} else {
console.warn('Testing single machine:', singleMachineToTest);
}

// Use provided machinepack path
var mainPath = path.resolve(mpPath);
Expand Down Expand Up @@ -39,6 +48,14 @@ module.exports = function (mpPath, beforeRunningAnyTests, eachTestSuite, done){
return done(new Error(util.format('Encountered error loading or parsing pack\'s package.json file (located at `%s`). Details:\n',packageJsonPath, e)));
}

if (singleMachineToTest) {
if (machineIdentities.indexOf(singleMachineToTest) == -1) {
return done(new Error(util.format('Unknown machine "%s"', singleMachineToTest)));
}

machineIdentities = [singleMachineToTest];
}

var missingSuites = [];
async.map(machineIdentities, function (machineIdentity, next_machineSuite){

Expand Down

0 comments on commit 679fb08

Please sign in to comment.