Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions tests/test_central_required_workflow_exact_inventory.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,11 @@
".github/workflows/security-scan.yml",
".github/workflows/strix.yml",
".github/workflows/sast-semgrep.yml",
".github/workflows/osv-scanner-pr.yml",
".github/workflows/scorecard-pr.yml",
)


def _ruleset_payload() -> dict:
"""Build an independent nine-workflow live-policy oracle."""
"""Build an independent seven-workflow live-policy oracle."""
return {
"id": audit.RULESET_ID,
"name": audit.RULESET_NAME,
Expand Down Expand Up @@ -62,12 +60,12 @@ def _ruleset_payload() -> dict:
}


def test_production_inventory_matches_independent_nine_path_oracle() -> None:
def test_production_inventory_matches_independent_seven_path_oracle() -> None:
"""Prevent the production tuple from silently rewriting the test oracle."""
assert audit.REQUIRED_WORKFLOW_PATHS == EXPECTED_REQUIRED_WORKFLOW_PATHS


def test_independent_nine_path_payload_passes() -> None:
def test_independent_seven_path_payload_passes() -> None:
"""Prove the hard-coded live-policy oracle is accepted unchanged."""
assert audit.audit_ruleset(_ruleset_payload()) == []

Expand Down
8 changes: 5 additions & 3 deletions tests/test_opencode_required_verdict_regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,8 +256,8 @@ def test_required_workflow_cannot_succeed_with_an_echo_only_placeholder() -> Non
target_job = workflow.split(" opencode-review-target:\n", 1)[1]
assert "timeout-minutes:" not in target_job.split(" steps:\n", 1)[0]
assert "id-token: write" in target_job.split(" steps:\n", 1)[0]
assert 'event_type:"merge-scheduler"' in workflow
assert "trigger_reviews:true" in workflow
assert 'event_type:"opencode-review"' in workflow
assert "required_run_id:$required_run_id" in workflow
dispatch_step = target_job.split(
" - name: Request current-head OpenCode review execution", 1
)[1].split(" - name: Fail closed", 1)[0]
Expand All @@ -270,7 +270,6 @@ def test_required_workflow_cannot_succeed_with_an_echo_only_placeholder() -> Non
assert "Current-head substantive OpenCode verdict already exists; scheduler wake skipped." in dispatch_step
assert "while :; do" in target_job
assert 'sleep "$poll_interval_seconds"' in target_job
assert "enable_auto_merge:false" in workflow
assert 'gh api --paginate "repos/${TARGET_REPOSITORY}/pulls/${PR_NUMBER}/reviews?per_page=100"' in workflow
assert "github.event.pull_request.head.sha" in workflow
assert "This required check is not a review and must not succeed" in workflow
Expand Down Expand Up @@ -729,8 +728,11 @@ def test_scheduler_wake_reuses_trusted_receipt_predicate(
"HEAD_SHA": HEAD,
"PR_DRAFT": "false",
"BASE_BRANCH": "main",
"BASE_SHA": "b" * 40,
"HEAD_REF": "feature-branch",
"WORKFLOW_SHA": "c" * 40,
"GH_TOKEN": "token",
"GITHUB_RUN_ID": "123456789",
"LIVE_PR_JSON": json.dumps(
{"draft": False, "head": {"sha": HEAD}, "state": "open"}
),
Expand Down
Loading