From cf9fb1cf8043483db39148518e57a04b55801d42 Mon Sep 17 00:00:00 2001 From: Riken Shah Date: Mon, 10 May 2021 15:50:24 +0000 Subject: [PATCH] puppeteer_tests: Show filename when failed for quicker debugging. --- tools/test-js-with-puppeteer | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/test-js-with-puppeteer b/tools/test-js-with-puppeteer index 49764c9c31..172a852766 100755 --- a/tools/test-js-with-puppeteer +++ b/tools/test-js-with-puppeteer @@ -113,11 +113,13 @@ def run_tests(files: Iterable[str], external_host: str) -> None: response = input('Tests failed. Press Enter to re-run tests, "q" to quit: ') else: ret = 1 - ret = run_tests()[0] + ret, current_test_num = run_tests() if ret != 0: + failed_test_file_name = os.path.basename(test_files[current_test_num]) print( f""" -{FAIL}The Puppeteer frontend tests failed!{ENDC} +{FAIL}The Puppeteer frontend tests failed! The failing test was: + ./tools/test-js-with-puppeteer {"--firefox " if options.firefox else ""}{failed_test_file_name}{ENDC} For help debugging, read: https://zulip.readthedocs.io/en/latest/testing/testing-with-puppeteer.html or report and ask for help in chat.zulip.org""",