diff --git a/tests/features/interlock_stages.feature b/tests/features/interlock_stages.feature index b7dd6b3..4c4740f 100644 --- a/tests/features/interlock_stages.feature +++ b/tests/features/interlock_stages.feature @@ -70,6 +70,20 @@ Feature: interlocks stage commands on a minimal inline project And the stage output contains "changed vs HEAD" And the stage output contains "skipped under --changed" + # req: stage-check + Scenario: `interlocks check --changed` skips graph-wide gates and runs file-level gates + Given a minimal tmp project initialized as a git repo + And the tmp project has a changed Python file + When I run "interlocks check --changed=HEAD" in the tmp project + Then the stage exits 0 + And the stage output contains "test: skipped under --changed" + And the stage output contains "deps: skipped under --changed" + And the stage output contains "attribution: skipped under --changed" + And the stage output contains "[fix]" + And the stage output contains "[format]" + And the stage output contains "[typecheck]" + And the stage output contains "[crap]" + # req: stage-check Scenario: `interlocks check --changed` honors changed_ref from pyproject Given a minimal tmp project initialized as a git repo diff --git a/tests/step_defs/test_interlock_stages.py b/tests/step_defs/test_interlock_stages.py index e0de514..7399d76 100644 --- a/tests/step_defs/test_interlock_stages.py +++ b/tests/step_defs/test_interlock_stages.py @@ -138,7 +138,11 @@ def _stage_exits(stage_result: subprocess.CompletedProcess[str], code: int) -> N ) +def _stage_combined(result: subprocess.CompletedProcess[str]) -> str: + return result.stdout + result.stderr + + @then(parsers.parse('the stage output contains "{fragment}"')) def _stage_output_contains(stage_result: subprocess.CompletedProcess[str], fragment: str) -> None: - combined = stage_result.stdout + stage_result.stderr + combined = _stage_combined(stage_result) assert fragment in combined, f"expected {fragment!r} in stage output; got:\n{combined}"