Skip to content

Commit de67196

Browse files
committed
test: preserve disabled-governance coverage
1 parent 4703d43 commit de67196

1 file changed

Lines changed: 94 additions & 10 deletions

File tree

‎tests/test_repo_hygiene_tools.py‎

Lines changed: 94 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -657,23 +657,107 @@ def test_sdg011_pins_exact_sdg010_delivery_and_executable_rollback() -> None:
657657
assert f"{digest} {path}" in historical_workflow
658658

659659

660-
def test_subject_progress_governance_controls_are_disabled():
660+
def test_subject_progress_ci_separates_historical_and_current_phases():
661661
workflow = (
662662
Path(__file__).resolve().parents[1] / ".github" / "workflows" / "ci.yml"
663663
).read_text(encoding="utf-8")
664664
test_job = workflow.split("\n test:\n", 1)[1].split(
665665
"\n readme-command-smoke:\n", 1
666666
)[0]
667+
667668
assert test_job.count(" - name: Run current-state tests\n") == 1
668-
assert test_job.count("--ignore=") == 6
669-
for marker in (
670-
"Replay immutable T-001 progress controls",
671-
"Validate current Subject progress ledger",
672-
"Replay immutable T-003 authorization checkpoint",
673-
"Replay inactive V4 bridge checkpoint",
674-
"Replay immutable V4 activation checkpoint",
675-
):
676-
assert marker not in test_job
669+
ignored = {
670+
"tests/test_subject_progress.py",
671+
"tests/test_subject_task_authorization_dispatch.py",
672+
"tests/test_subject_development_mission_v4.py",
673+
"tests/test_subject_task_authorization_dispatch_v4.py",
674+
"tests/test_subject_development_mission_v5.py",
675+
"tests/test_subject_task_authorization_dispatch_v5.py",
676+
}
677+
for path in ignored:
678+
assert test_job.count(f"--ignore={path}") == 1
679+
assert test_job.count("--ignore=") == len(ignored)
680+
assert "--deselect" not in test_job
681+
assert "continue-on-error" not in test_job
682+
assert " -k " not in test_job
683+
assert "xfail" not in test_job.lower()
684+
685+
assert (
686+
"SUBJECT_PRE_T002_CHECKPOINT: "
687+
"8ec045a7b39c5aa9684f61d9099eb62b3142983d"
688+
) not in test_job
689+
assert (
690+
"T001_PROGRESS_TEST_SHA256: "
691+
"6be4d93375205ee1f9ba414aa2704ee075ca583050238892d54030e7adadd3e6"
692+
) not in test_job
693+
assert (
694+
"T001_PROGRESS_VALIDATOR_SHA256: "
695+
"8cb33ef1f9b688be90fb093e0fd4437b245c2a9b2dbac3f3141c65005619416f"
696+
) not in test_job
697+
assert (
698+
"T001_PROGRESS_LEDGER_SHA256: "
699+
"ab723c1adde2739f54deba7fee85d86a95002f167703354695503363154d30e6"
700+
) not in test_job
701+
assert (
702+
'git merge-base --is-ancestor "$SUBJECT_PRE_T002_CHECKPOINT" HEAD'
703+
not in test_job
704+
)
705+
assert (
706+
'git worktree add --detach "$replay_root" "$SUBJECT_PRE_T002_CHECKPOINT"'
707+
not in test_job
708+
)
709+
assert "tests/test_subject_progress.py | sha256sum -c -" not in test_job
710+
assert "scripts/validate_subject_progress.py | sha256sum -c -" not in test_job
711+
assert (
712+
"specs/subject-distillation/implementation-progress.json | sha256sum -c -"
713+
not in test_job
714+
)
715+
assert (
716+
"PYTHONDONTWRITEBYTECODE=1 python -m pytest -q -p no:cacheprovider \\\n"
717+
" tests/test_subject_progress.py"
718+
) not in test_job
719+
assert (
720+
"python scripts/validate_subject_progress.py \\\n"
721+
" --manifest specs/subject-distillation/baseline-manifest.json"
722+
) not in test_job
723+
assert (
724+
"python scripts/validate_subject_task_authorization_dispatch.py \\\n"
725+
" --ledger"
726+
) not in test_job
727+
trust_pins = {
728+
"scripts/validate_subject_task_authorization_dispatch.py": "0e455b726ee09f35283f1975ad30a08d988a71ddc71efb0fd02fdba09a922f33",
729+
"scripts/run_subject_task_authorization_v3.py": "7076d547be933c30e2e8321a3ee47799794137dfe295e6f09f558373cf959b8c",
730+
"scripts/update_subject_task_progress_v3.py": "ef0cc8fe7e2fe27928160c28cb92821ac85dbe549acce3f3bf9e7a9528b969ab",
731+
"scripts/validate_subject_task_authorization_v3.py": "1251ff4f35373ed8a5b54403f971fa54c3bc71b0b062f0caa939ed1415b2f01b",
732+
"specs/subject-distillation/task-authorization-v3.contract.json": "9ff7ddceffdde6690fce4acf1b1f9d16f2d0f93412f5e5f55d94d118b7af5c5a",
733+
"specs/subject-distillation/task-authorization-v3.schema.json": "f226e841e2e5442d9a2fe4443762764c984f409699d696e66cbe49aec79177df",
734+
"specs/subject-distillation/task-scopes/T-003.json": "7bf80b0b2e0abf1a762663ca179361ef65d1bcaa5a2af373697f6a22dca1e359",
735+
"tests/test_subject_task_authorization_dispatch.py": "8601f9ff2b8475c6c9eda577cd27c26fe3c6665f3cf9ad9174dedb5975448616",
736+
}
737+
for path, digest in trust_pins.items():
738+
assert f"{digest} {path}" not in test_job
739+
assert "cat <<'EOF' | sha256sum -c -" not in test_job
740+
assert (
741+
"PYTHONDONTWRITEBYTECODE=1 python -m pytest -q -p no:cacheprovider \\\n"
742+
" tests/test_subject_task_authorization_dispatch.py"
743+
) not in test_job
744+
assert "validate_subject_task_authorization_v2.py \\\n" not in test_job
745+
assert (
746+
"SUBJECT_V4_ACTIVATION_CHECKPOINT: "
747+
"03dcdabc873658cd7de24dfeeef8b85090cf2321"
748+
) not in test_job
749+
assert (
750+
'git worktree add --detach "$replay_root" '
751+
'"$SUBJECT_V4_ACTIVATION_CHECKPOINT"'
752+
) not in test_job
753+
assert (
754+
"tests/test_subject_development_mission_v4.py \\\n"
755+
" tests/test_subject_task_authorization_dispatch_v4.py"
756+
) not in test_job
757+
assert (
758+
"python scripts/validate_subject_task_authorization_dispatch_v5.py \\\n"
759+
" --ledger"
760+
) not in test_job
677761

678762

679763
def test_artifact_audit_classifies_safe_generated_cache(tmp_path: Path):

0 commit comments

Comments
 (0)