Skip to content

Commit

Permalink
Add a script to repeatedly run the test suite
Browse files Browse the repository at this point in the history
Add a script to assist with debugging #2249 by running the test suite
repeatedly and checking the output.
  • Loading branch information
robertknight committed Jul 13, 2020
1 parent 93dfa4b commit 43e1641
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions test-loop.py
Original file line number Diff line number Diff line change
@@ -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)

0 comments on commit 43e1641

Please sign in to comment.