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

Commit 0c4ef69

Browse files
committed
feat(launcher): launcher outputs a final summary of how the browsers did
1 parent 74bc02f commit 0c4ef69

File tree

3 files changed

+20
-5
lines changed

3 files changed

+20
-5
lines changed

lib/launcher.js

+17-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ var noLineLog_ = function(stuff) {
2121
process.stdout.write(launcherPrefix + stuff);
2222
}
2323

24-
2524
var reportHeader_ = function(childFork) {
2625
var capability = childFork.capability;
2726
var eol = require('os').EOL;
@@ -70,7 +69,19 @@ var init = function(argv) {
7069
if (remaining) {
7170
noLineLog_(remaining + ' instance(s) of WebDriver still running');
7271
}
73-
}
72+
};
73+
74+
var logSummary = function() {
75+
childForks.forEach(function(childFork) {
76+
var shortChildName = childFork.capability.browserName +
77+
(childFork.runNumber ? ' #' + childFork.runNumber : '');
78+
if (childFork.failedCount) {
79+
log_(shortChildName + ' failed ' + childFork.failedCount + ' test(s)');
80+
} else {
81+
log_(shortChildName + ' passed');
82+
}
83+
});
84+
};
7485

7586
if (config.multiCapabilities.length) {
7687
if (config.debug) {
@@ -160,6 +171,9 @@ var init = function(argv) {
160171
case 'testFail':
161172
process.stdout.write('F');
162173
break;
174+
case 'testsDone':
175+
childFork.failedCount = m.failedCount;
176+
break;
163177
}
164178
});
165179

@@ -189,6 +203,7 @@ var init = function(argv) {
189203
}
190204

191205
process.on('exit', function(code) {
206+
logSummary();
192207
process.exit(launcherExitCode);
193208
});
194209
};

lib/runFromLauncher.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@ process.on('message', function(m) {
4141
event: 'testFail'
4242
});
4343
});
44-
runner.on('testsDone', function(results) {
44+
runner.on('testsDone', function(failedCount) {
4545
process.send({
4646
event: 'testsDone',
47-
results: results
47+
failedCount: failedCount
4848
});
4949
});
5050

lib/runner.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ Runner.prototype.run = function() {
413413

414414
// 3) Teardown
415415
}).then(function(result) {
416-
self.emit('testsDone', result);
416+
self.emit('testsDone', result.failedCount);
417417
testResult = result;
418418
if (self.driverprovider_.updateJob) {
419419
return self.driverprovider_.updateJob({

0 commit comments

Comments
 (0)