-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_tests.py
More file actions
28 lines (24 loc) · 826 Bytes
/
Copy pathrun_tests.py
File metadata and controls
28 lines (24 loc) · 826 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import os
import sys
import subprocess
"""
execute run_config with all configs in configs/tests
and observe stdout and stderr
these are basically integration tests
"""
def run_config(config):
print("Running config: ", config)
p = subprocess.Popen([sys.executable, "run_tests.py", config], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
try:
stdout, stderr = p.communicate(timeout=10) # Set a timeout, for example, 60 seconds
print("stdout: ", stdout)
print("stderr: ", stderr)
except subprocess.TimeoutExpired:
print(f"Config {config} timed out.")
p.kill()
#get all configs in configs/tests
configs = os.listdir("configs/tests")
configs = [os.path.join("configs/tests", config) for config in configs]
#run all configs
for config in configs:
run_config(config)