Skip to content

Commit 7cc27b2

Browse files
Merge pull request #30 from SmartBear/TSERV-1006-write-report-if-job-failed
TSERV-1006 Exit on fail after writing report.
2 parents 47fac03 + 03f7d68 commit 7cc27b2

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

bin/jobs_functions.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,6 @@ function reportForTestJob(testjobId, outputFolder, fileName, format) {
231231
util.printErrorAndExit(`Status code: ${response.status}`);
232232
} else {
233233
util.output('Report created successfully');
234-
process.exit(0);
235234
}
236235
}).send();
237236
if (stream) {

bin/run_functions.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -482,10 +482,7 @@ function executeProject(filename, project, options) {
482482
if (config.showProgress)
483483
util.output('');
484484
util.output("Result: " + status);
485-
if(status === 'FAILED') {
486-
process.exit(1);
487-
}
488-
485+
489486
if ((jobId !== null)
490487
&& ((status !== 'CANCELED')
491488
&& (status !== 'PENDING')
@@ -494,6 +491,10 @@ function executeProject(filename, project, options) {
494491
jobs.reportForTestJob(jobId, options['output'], options['reportFileName'], 'format' in options ? options['format'] : "junit");
495492
}
496493
}
494+
495+
if(status === 'FAILED') {
496+
process.exitCode = 1;
497+
}
497498
}
498499
jobId = null;
499500
}

0 commit comments

Comments
 (0)