-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_ci_shell_scripts.py
More file actions
32 lines (23 loc) · 1.11 KB
/
Copy pathtest_ci_shell_scripts.py
File metadata and controls
32 lines (23 loc) · 1.11 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
import subprocess
from pathlib import Path
REPO_ROOT = Path(__file__).resolve().parents[2]
RUN_ALL_CHECKS = REPO_ROOT / "scripts" / "ci" / "run-all-checks.sh"
HEALTH_CHECK = REPO_ROOT / "scripts" / "ci" / "infrastructure" / "health-check.sh"
def _run_script(script_path, *args):
return subprocess.run(
["bash", str(script_path), *args],
cwd=REPO_ROOT,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
text=True,
)
def test_run_all_checks_reports_summary_even_on_failure():
result = _run_script(RUN_ALL_CHECKS)
assert result.returncode != 0, "Expected the aggregated checks to fail in the default dev environment"
combined_output = f"{result.stdout}\\n{result.stderr}"
assert "FINAL CI/CD REPORT" in combined_output
def test_health_check_surfaces_underlying_error_details():
result = _run_script(HEALTH_CHECK)
assert result.returncode != 0, "The health check should fail when dependencies are missing"
combined_output = f"{result.stdout}\\n{result.stderr}"
assert "ModuleNotFoundError" in combined_output or "No module named" in combined_output