Skip to content
This repository has been archived by the owner on Jul 29, 2024. It is now read-only.

Commit

Permalink
feat(launcher): launcher outputs a final summary of how the browsers did
Browse files Browse the repository at this point in the history
  • Loading branch information
juliemr committed Mar 13, 2014
1 parent 74bc02f commit 0c4ef69
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 5 deletions.
19 changes: 17 additions & 2 deletions lib/launcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ var noLineLog_ = function(stuff) {
process.stdout.write(launcherPrefix + stuff);
}


var reportHeader_ = function(childFork) {
var capability = childFork.capability;
var eol = require('os').EOL;
Expand Down Expand Up @@ -70,7 +69,19 @@ var init = function(argv) {
if (remaining) {
noLineLog_(remaining + ' instance(s) of WebDriver still running');
}
}
};

var logSummary = function() {
childForks.forEach(function(childFork) {
var shortChildName = childFork.capability.browserName +
(childFork.runNumber ? ' #' + childFork.runNumber : '');
if (childFork.failedCount) {
log_(shortChildName + ' failed ' + childFork.failedCount + ' test(s)');
} else {
log_(shortChildName + ' passed');
}
});
};

if (config.multiCapabilities.length) {
if (config.debug) {
Expand Down Expand Up @@ -160,6 +171,9 @@ var init = function(argv) {
case 'testFail':
process.stdout.write('F');
break;
case 'testsDone':
childFork.failedCount = m.failedCount;
break;
}
});

Expand Down Expand Up @@ -189,6 +203,7 @@ var init = function(argv) {
}

process.on('exit', function(code) {
logSummary();
process.exit(launcherExitCode);
});
};
Expand Down
4 changes: 2 additions & 2 deletions lib/runFromLauncher.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ process.on('message', function(m) {
event: 'testFail'
});
});
runner.on('testsDone', function(results) {
runner.on('testsDone', function(failedCount) {
process.send({
event: 'testsDone',
results: results
failedCount: failedCount
});
});

Expand Down
2 changes: 1 addition & 1 deletion lib/runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ Runner.prototype.run = function() {

// 3) Teardown
}).then(function(result) {
self.emit('testsDone', result);
self.emit('testsDone', result.failedCount);
testResult = result;
if (self.driverprovider_.updateJob) {
return self.driverprovider_.updateJob({
Expand Down

0 comments on commit 0c4ef69

Please sign in to comment.