puppeteer: Allow reruns in interactive mode when tests succeed.

We already allowed reruns for failing tests, and this adds
the ability to rerun tests that succeeded as well, which is
helpful for debugging flaky tests.
This commit is contained in:
evykassirer 2023-09-12 14:08:19 -07:00 committed by Tim Abbott
parent 89739ba3c3
commit a0df603aa7
1 changed files with 5 additions and 2 deletions

View File

@ -111,9 +111,12 @@ def run_tests(files: Iterable[str], external_host: str, loop: int = 1) -> None:
response = input('Press Enter to run tests, "q" to quit: ') response = input('Press Enter to run tests, "q" to quit: ')
ret = 1 ret = 1
failed_test_num = 0 failed_test_num = 0
while response != "q" and failed_test_num != -1: while response != "q":
ret, failed_test_num = run_tests(failed_test_num) ret, failed_test_num = run_tests(failed_test_num)
if ret != 0: if ret == 0:
failed_test_num = 0
response = input('Tests succeeded. Press Enter to re-run tests, "q" to quit: ')
else:
response = input('Tests failed. Press Enter to re-run tests, "q" to quit: ') response = input('Tests failed. Press Enter to re-run tests, "q" to quit: ')
else: else:
ret = 1 ret = 1