From 43e16414830e9def1adc10f730df8b0781f2faf7 Mon Sep 17 00:00:00 2001 From: Robert Knight Date: Mon, 13 Jul 2020 12:31:13 +0100 Subject: [PATCH] Add a script to repeatedly run the test suite Add a script to assist with debugging #2249 by running the test suite repeatedly and checking the output. --- test-loop.py | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 test-loop.py diff --git a/test-loop.py b/test-loop.py new file mode 100644 index 00000000000..f21bf2add69 --- /dev/null +++ b/test-loop.py @@ -0,0 +1,29 @@ +import re +import subprocess +import sys + +max_iterations = 100 +for i in range(0, max_iterations): + print(f"Running test iteration {i+1} of {max_iterations}") + + proc = subprocess.run( + "node_modules/.bin/gulp test", + shell=True, + stdout=subprocess.PIPE, + check=True, + ) + stdout = proc.stdout.decode() + + tests_run_match = re.search("TOTAL: ([0-9]+) SUCCESS", stdout) + + if not tests_run_match: + print(f"Tests failed on run {i}") + print(stdout) + sys.exit(1) + + expected_tests = 2439 + tests_run = int(tests_run_match.group(1)) + if tests_run < expected_tests: + print(f"Only ran {tests_run} instead of {expected_tests}") + print(stdout) + sys.exit(1)