diff --git a/tests/test_recalibration_gate_e2e.py b/tests/test_recalibration_gate_e2e.py index 12b80d8f..e43285df 100644 --- a/tests/test_recalibration_gate_e2e.py +++ b/tests/test_recalibration_gate_e2e.py @@ -13,15 +13,21 @@ def test_recalibration_gate_example_runs_and_fails_closed(): ) assert r.returncode == 0, f"make lab-result-intake-example failed: {r.stderr[:200]}" + repo = Path(__file__).parents[1] r = subprocess.run( - ["make", "recalibration-gate-example"], + [sys.executable, "-m", "openamp_foundry.cli", "recalibration-gate", + "--intake-report", "outputs/calibration_intake_example.json", + "--intake-report-date", "2026-07-04", + "--out-json", "outputs/recalibration_gate_example.json", + "--out-md", "outputs/recalibration_gate_example.md"], capture_output=True, text=True, - cwd=Path(__file__).parents[1], + cwd=repo, + env={**__import__("os").environ, "PYTHONPATH": "src"}, ) # Gate correctly fails-closed (exit 3) because cohort size 4 < minimum 5 assert r.returncode == 3, ( f"Expected exit 3 (fail-closed), got {r.returncode}. " - f"Gate should reject cohort < 5 candidates." + f"Gate should reject cohort < 5 candidates.\nstdout: {r.stdout[:300]}\nstderr: {r.stderr[:300]}" )