0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00

tools: include exit code in TAP log

PR-URL: https://github.com/nodejs/node/pull/19855
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Rod Vagg <rod@vagg.org>
This commit is contained in:
Refael Ackermann 2018-04-06 17:55:50 -04:00 committed by Rich Trott
parent 33d4f828ee
commit a3db1cc514

View File

@ -254,11 +254,12 @@ class DotsProgressIndicator(SimpleProgressIndicator):
class TapProgressIndicator(SimpleProgressIndicator):
def _printDiagnostic(self, traceback, severity):
logger.info(' severity: %s', severity)
def _printDiagnostic(self):
logger.info(' severity: %s', self.severity)
self.exitcode and logger.info(' exitcode: %s', self.exitcode)
logger.info(' stack: |-')
for l in traceback.splitlines():
for l in self.traceback.splitlines():
logger.info(' ' + l)
def Starting(self):
@ -273,6 +274,7 @@ class TapProgressIndicator(SimpleProgressIndicator):
self._done += 1
self.traceback = ''
self.severity = 'ok'
self.exitcode = ''
# Print test name as (for example) "parallel/test-assert". Tests that are
# scraped from the addons documentation are all named test.js, making it
@ -284,7 +286,8 @@ class TapProgressIndicator(SimpleProgressIndicator):
if output.UnexpectedOutput():
status_line = 'not ok %i %s' % (self._done, command)
self.severity = 'fail'
self.traceback = "exit code: " + output.output.exit_code + "\n" + output.output.stdout + output.output.stderr
self.exitcode = output.output.exit_code
self.traceback = output.output.stdout + output.output.stderr
if FLAKY in output.test.outcomes and self.flaky_tests_mode == DONTCARE:
status_line = status_line + ' # TODO : Fix flaky test'
@ -330,7 +333,7 @@ class TapProgressIndicator(SimpleProgressIndicator):
if self.severity is not 'ok' or self.traceback is not '':
if output.HasTimedOut():
self.traceback = 'timeout'
self._printDiagnostic(self.traceback, self.severity)
self._printDiagnostic()
logger.info(' ...')
def Done(self):