Repository navigation
Expand file tree
/
Copy pathrun_tests.py
More file actions
69 lines (58 loc) · 1.8 KB
/
Copy pathrun_tests.py
File metadata and controls
69 lines (58 loc) · 1.8 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
"""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_cli_headless.py",
"test_companion_launch.py",
"test_config_manager.py",
"test_core_safety_regressions.py",
"test_database_safety.py",
"test_daily_scheduler.py",
"test_import_streams.py",
"source_platform_smoke.py",
"tests/linux_platform_smoke.py",
"tests/macos_platform_smoke.py",
"test_portable_profile.py",
"test_schedule_time.py",
"test_sftp_target.py",
"tests/test_store_materials.py",
"tests/test_metadata.py",
"tests/test_bug_regressions.py",
"tests/test_assets_and_icons.py",
"tests/test_i18n.py",
"test_sync_worker.py",
"test_translator.py",
"test_ui_accessibility.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[tuple[str, int]] = []
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,
timeout=120,
)
if result.returncode != 0:
failed.append((test_file, result.returncode))
if failed:
failures = ", ".join(
f"{test_file} (return code {returncode})"
for test_file, returncode in failed
)
print("\nFAILED:", failures, flush=True)
return 1
print("\nAll smoke tests passed.", flush=True)
return 0
if __name__ == "__main__":
sys.exit(main())