Skip to content

Commit 37a9815

Browse files
bnoordhuisMyles Borins
authored and
Myles Borins
committed
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 <[email protected]>
1 parent 5550cff commit 37a9815

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

tools/test.py

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

270270
def HasRun(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+
if command.endswith('.js'): command = command[:-3]
279+
if command.startswith(prefix): command = command[len(prefix):]
280+
273281
if output.UnexpectedOutput():
274282
status_line = 'not ok %i %s' % (self._done, command)
275283
if FLAKY in output.test.outcomes and self.flaky_tests_mode == DONTCARE:

0 commit comments

Comments
 (0)