-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_tests.py
More file actions
52 lines (41 loc) · 1.23 KB
/
run_tests.py
File metadata and controls
52 lines (41 loc) · 1.23 KB
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
"""Run ProSync smoke tests in the same way locally and in CI."""
from __future__ import annotations
import os
import subprocess
import sys
from pathlib import Path
TEST_FILES = [
"test_batch_sync_queue.py",
"test_companion_launch.py",
"test_config_manager.py",
"test_database_safety.py",
"test_import_streams.py",
"test_linux_platform_smoke.py",
"test_portable_profile.py",
"test_store_materials.py",
"test_sync_worker.py",
"test_translator.py",
]
def main() -> int:
project_root = Path(__file__).resolve().parent
env = os.environ.copy()
env.setdefault("PYTHONIOENCODING", "utf-8")
env.setdefault("QT_QPA_PLATFORM", "offscreen")
failed: list[str] = []
for test_file in TEST_FILES:
print(f"\n=== {test_file} ===", flush=True)
result = subprocess.run(
[sys.executable, str(project_root / test_file)],
cwd=project_root,
env=env,
check=False,
)
if result.returncode != 0:
failed.append(test_file)
if failed:
print("\nFAILED:", ", ".join(failed), flush=True)
return 1
print("\nAll smoke tests passed.", flush=True)
return 0
if __name__ == "__main__":
sys.exit(main())