@@ -86,17 +86,14 @@ var init = function(configFile, additionalConfig) {
86
86
break ;
87
87
case 'testsDone' :
88
88
self . reporter . testsDone ( m . failedCount ) ;
89
- if ( typeof testsDoneCallback === 'function' ) {
90
- testsDoneCallback ( ) ;
91
- }
92
89
break ;
93
90
}
94
91
} ) ;
95
92
96
93
this . process . on ( 'error' , function ( err ) {
97
94
self . reporter . flush ( ) ;
98
95
log_ ( 'Runner Process(' + self . process . pid + ') Error: ' + err ) ;
99
- runnerErrorCount += 1 ;
96
+ runnerErrorCount += 1 ;
100
97
} ) ;
101
98
102
99
this . process . on ( 'exit' , function ( code ) {
@@ -105,6 +102,10 @@ var init = function(configFile, additionalConfig) {
105
102
log_ ( 'Runner Process Exited With Error Code: ' + code ) ;
106
103
runnerErrorCount += 1 ;
107
104
}
105
+ self . reporter . exitCode = code ;
106
+ if ( typeof testsDoneCallback === 'function' ) {
107
+ testsDoneCallback ( ) ;
108
+ }
108
109
log_ ( scheduler . countActiveTasks ( ) +
109
110
' instance(s) of WebDriver still running' ) ;
110
111
} ) ;
@@ -195,21 +196,32 @@ var reporter = {
195
196
} ,
196
197
197
198
reportSummary : function ( ) {
198
- var totalFailures = 0 ;
199
+ var specFailures = 0 ;
200
+ var processFailures = 0 ;
199
201
this . taskReporters_ . forEach ( function ( taskReporter ) {
200
202
var capability = taskReporter . task . capability ;
201
203
var shortName = ( capability . browserName ) ? capability . browserName : '' ;
202
204
shortName += ( capability . version ) ? capability . version : '' ;
203
205
shortName += ( ' #' + taskReporter . task . taskId ) ;
204
206
if ( taskReporter . failedCount ) {
205
207
log_ ( shortName + ' failed ' + taskReporter . failedCount + ' test(s)' ) ;
206
- totalFailures += taskReporter . failedCount ;
208
+ specFailures += taskReporter . failedCount ;
209
+ } else if ( taskReporter . exitCode != 0 ) {
210
+ log_ ( shortName + ' failed with exit code: ' + taskReporter . exitCode ) ;
211
+ processFailures += 1 ;
207
212
} else {
208
213
log_ ( shortName + ' passed' ) ;
209
214
}
210
215
} ) ;
211
- if ( this . taskReporters_ . length > 1 && totalFailures ) {
212
- log_ ( 'overall: ' + totalFailures + ' failure(s)' ) ;
216
+ if ( this . taskReporters_ . length > 1 ) {
217
+ if ( specFailures && processFailures ) {
218
+ log_ ( 'overall: ' + specFailures + ' failed spec(s) and ' +
219
+ processFailures + ' process(es) failed to complete' ) ;
220
+ } else if ( specFailures ) {
221
+ log_ ( 'overall: ' + specFailures + ' failed spec(s)' ) ;
222
+ } else if ( processFailures ) {
223
+ log_ ( 'overall: ' + processFailures + ' process(es) failed to complete' ) ;
224
+ }
213
225
}
214
226
}
215
227
} ;
@@ -226,6 +238,7 @@ var TaskReporter_ = function(task, pid) {
226
238
this . pid = pid ;
227
239
this . failedCount = 0 ;
228
240
this . buffer = '' ;
241
+ this . exitCode = - 1 ;
229
242
this . insertTag = true ;
230
243
} ;
231
244
0 commit comments