From e74aa7b0ea7e8eb285d209a97bd8adb37907520d Mon Sep 17 00:00:00 2001 From: Krzysztof kuhy Rudnicki Date: Thu, 22 Oct 2026 21:51:50 +0200 Subject: [PATCH] test(agent_ready_gate): clear GITHUB_ACTIONS in the real-checker test In CI the gate defers to the workflow and returns 0, so the real-checker test saw 0 instead of 1. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01NBScELfMUiieK9ManFbS3Y --- repo_contract/tests/test_agent_ready_gate.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/repo_contract/tests/test_agent_ready_gate.py b/repo_contract/tests/test_agent_ready_gate.py index a6068e3..4ed2a38 100644 --- a/repo_contract/tests/test_agent_ready_gate.py +++ b/repo_contract/tests/test_agent_ready_gate.py @@ -168,7 +168,11 @@ def test_pre_commit_in_ci_defers_to_the_workflow( @pytest.mark.skipif(not gate.CHECKER.exists(), reason="agent_ready not checked out") -def test_real_checker_fails_a_bare_build(tmp_path: Path) -> None: +def test_real_checker_fails_a_bare_build( + tmp_path: Path, monkeypatch: pytest.MonkeyPatch +) -> None: + # In CI the gate defers to the workflow (returns 0); force the local path. + monkeypatch.delenv("GITHUB_ACTIONS", raising=False) root = site(tmp_path, '[agent_ready]\ndist = "dist"\n') write(root, "dist/index.html", "x

hi

") assert gate.main(["--repo", str(root)]) == 1