Skip to content

Commit adb2d61

Browse files
bnoordhuisevanlucas
authored andcommitted
test: include component in tap output
Print test name as (for example) "parallel/test-assert". Tests that are scraped from the addons documentation are all named test.js, making it hard to decipher what test is running when only the filename is printed. Fixes: #6651 PR-URL: #6653 Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 95b7560 commit adb2d61

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

‎tools/test.py‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,15 @@ def AboutToRun(self, case):
269269

270270
defHasRun(self, output):
271271
self._done+=1
272-
command=basename(output.command[-1])
272+
273+
# Print test name as (for example) "parallel/test-assert". Tests that are
274+
# scraped from the addons documentation are all named test.js, making it
275+
# hard to decipher what test is running when only the filename is printed.
276+
prefix=abspath(join(dirname(__file__), '../test')) +'/'
277+
command=output.command[-1]
278+
ifcommand.endswith('.js'): command=command[:-3]
279+
ifcommand.startswith(prefix): command=command[len(prefix):]
280+
273281
ifoutput.UnexpectedOutput():
274282
status_line='not ok %i %s'% (self._done, command)
275283
ifFLAKYinoutput.test.outcomesandself.flaky_tests_mode==DONTCARE:

0 commit comments

Comments
 (0)