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 8fde66e
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion run-all-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,15 @@ 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 < 5 || _.isFunction(singleMachineToTest)) {
done = arguments[3];
eachTestSuite = arguments[2];
beforeRunningAnyTests = arguments[1];

singleMachineToTest = false;
}

// Use provided machinepack path
var mainPath = path.resolve(mpPath);
Expand Down Expand Up @@ -39,6 +47,16 @@ 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) {
console.warn('Testing single machine:', 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 8fde66e

Please sign in to comment.