-
Notifications
You must be signed in to change notification settings - Fork 197
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information
1 parent
93dfa4b
commit 43e1641
Showing
1 changed file
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |