fix(tests): repoint 3 hourly-review-repair test files at the daily-cadence redesign - #1875
fix(tests): repoint 3 hourly-review-repair test files at the daily-cadence redesign#1875seonghobae wants to merge 3 commits into
Conversation
…dence redesign hourly-review-repair.yml was redesigned from a single hourly cron shared by 18 thin per-repository callers into one file with 17 distinct daily cron entries (one <minute> <hour> * * * per repository, staggered across UTC hours 0-16). Three test files were never updated to match and were failing on a clean origin/main checkout: - tests/test_hourly_review_repair_callers.py: _EXPECTED_TARGETS' 17 schedule keys and the schedule-list assertion still used the old hourly "<minute> * * * *" shape instead of the actual daily "<minute> <hour> * * *" cron strings (1 + 16 failing cases). - tests/test_github_hourly_conflict_repair.py::test_central_repository_has_hourly_self_caller asserted cron: "21 * * * *" instead of the central .github self-caller's actual cron: "21 6 * * *". - tests/test_pr_review_autofix_nvidia_nim_contract.py::test_review_fix_caller_runs_once_each_hour asserted a single hourly cron: "23 * * * *" that no longer exists; renamed to test_review_fix_caller_runs_once_each_day and repointed at Clearfolio's actual cron: "23 7 * * *", keeping the original protective intent (the caller still dispatches to the reusable, product-neutral pr-review-fix-scheduler.yml engine). Found while investigating a live required-check failure on #1870: agent-review-runtime-quality-ci.yml's "Verify scheduler and contextual-orchestrator review-repair contracts" step runs pytest with no positional test path (full default tests/ discovery), so it was picking up these 19 stale assertions. With them fixed, the exact unscoped pytest command the workflow runs passes cleanly (100% branch coverage across pr_review_conflict_scope, pr_review_autofix_context, zdr_policy, and contextual_orchestrator_review_policy) -- no change to agent-review-runtime-quality-ci.yml itself was needed. Full suite (tests --ignore test_queue_cancellation_{open_pr_revalidation,revalidation}) went from 23 failed/2828 passed to 3 failed/2848 passed; the 3 remaining failures are pre-existing and unrelated (2 real test/workflow-drift bugs in other files, 1 local gh-CLI-missing sandbox limitation), confirmed identical before and after on a stash-based A/B. scripts/ci coverage (99%) and interrogate (98.3%) are unchanged from baseline, confirming this is a test-only change. Also updates CHANGELOG.md (first Unreleased section) and docs/product-technical-gap-baseline.md with a new dated entry recording the fix; the specific "opencode-review-dispatch.yml ... starved floating image" entry this was expected to append to was not found verbatim in the current file, so a new standalone entry was added instead. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KPmJErfkcHer4UVEgrQxUX
…overy-stale-cron-tests # Conflicts: # docs/product-technical-gap-baseline.md # tests/test_pr_review_autofix_nvidia_nim_contract.py
|
Warning Review limit reachedNext included review available in 3 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (3)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…st (#1877) * fix(tests): repair changed-scope drift and stale noema cancel-step test Two pre-existing tests/ failures blocked the unscoped pytest discovery run in agent-review-runtime-quality-ci.yml's review-repair contracts step, unrelated to the hourly-cron fixes in #1875: - strix.yml's changed-scope job if: had drifted onto a multi-line `>-` block scalar when PR #1869 added converted_to_draft handling, and the extra continuation lines broke byte-identical parity with security-scan.yml/sast-semgrep.yml's copies. Collapsed back to one physical if: line with the same expression. - test_noema_close_cleanup_selects_only_the_closed_pr_across_shared_display_titles still targeted the pre-#1869 step name/env vars (CLOSED_PR_NUMBER) that PR #1869 renamed to "...for the inactive pull request" / INACTIVE_PR_NUMBER/INACTIVE_PR_HEAD_SHA/PR_ACTION when it generalized noema-review.yml's cleanup to also cover converted_to_draft and added a live_target_matches re-verification. tests/test_noema_review_gate.py's equivalent tests were already updated; this one was missed. Updated the step name/env vars and taught the fake gh to answer the new live-PR lookup -- the PR #1507 pull_requests[] cancellation-scoping invariant it protects is unchanged and still correctly implemented in production. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KPmJErfkcHer4UVEgrQxUX * fix(tests): mock fetch_pr in Strix rerun job selection test test_dispatch_strix_reruns_scan_job_not_sibling_publisher only mocked rerun_actions_job, leaving dispatch_strix_evidence's live_dispatch_head_matches call to invoke the real fetch_pr. In any environment with a real gh CLI on PATH this hits the actual GitHub API for a synthetic PR that does not exist there, returning a live/head mismatch ("stale_head") instead of the expected "rerun"; without gh at all it fails even earlier with a missing executable. Add monkeypatch.setattr(sched, "fetch_pr", lambda *_args: [pr]) so the live-head re-read observes the same fixture pr as authoritative, consistent with how every other GitHub call in this test path is already isolated. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KPmJErfkcHer4UVEgrQxUX * fix(tests): align Strix admission assertion * fix(tests): align daily review recovery fixtures --------- Co-authored-by: Claude <noreply@anthropic.com>
|
Redundancy check against current Fully covered by #1877 (verbatim match):
Already fixed independently before either PR, via #1870 (not #1877):
Gap — not covered anywhere on
So: overlap is partial, not complete. The Generated by Claude Code |
Resolves the dirty mergeable_state caused by #1877 independently re-authoring most of this PR's fixes on main. - tests/test_hourly_review_repair_callers.py and tests/test_github_hourly_conflict_repair.py: dropped this branch's now-redundant duplicate hunks (same cron assertions fixed to the same values) in favor of main's versions verbatim, including main's test_central_repository_has_daily_self_caller rename. - tests/test_pr_review_autofix_nvidia_nim_contract.py: kept the two assertions genuinely not covered anywhere on main -- the negative cron: "23 */2 * * *" check and the product-neutrality check that ContextualWisdomLab/clearfolio is never hard-coded into pr-review-fix-scheduler.yml -- layered onto main's already-fixed test_review_fix_caller_keeps_the_github_daily_recovery_slot (#1870). - CHANGELOG.md: kept both this branch's and main's Unreleased bullets (additive convention), rewriting this branch's bullet to correctly attribute the now-shared-on-main fixes to #1870/#1877 and describe only the residual scope this PR still closes. - docs/product-technical-gap-baseline.md: corrected the "opencode-review-dispatch.yml still requesting the starved floating image" entry's stale "not yet fixed" sub-note -- the core cron assertion was already fixed by #1870 itself, and the other two files were fixed on main via #1877. The entry now states this accurately and lists the two extra assertions as the actual remaining scope. Validated: targeted 3-file suite (59 passed), full suite minus the two excluded queue-cancellation-revalidation files (2833 passed, 1 skipped), git diff --check clean. Final diff vs origin/main is limited to CHANGELOG.md, docs/product-technical-gap-baseline.md, and the two new assertions in tests/test_pr_review_autofix_nvidia_nim_contract.py. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KPmJErfkcHer4UVEgrQxUX
|
Merged Resolution:
Remaining genuine scope of this PR (diff vs Validation: targeted 3-file suite (59 passed), full suite minus the two excluded queue-cancellation-revalidation files (2833 passed, 1 skipped, no failures), Generated by Claude Code |
|
Closing as fully redundant with current main. |
Summary
hourly-review-repair.ymlwas renamed to "Daily Review Recovery" and redesigned from a single hourly cron shared by up to 18 thin per-repository callers into one file with 17 distinct daily cron entries (one<minute> <hour> * * *per repository, staggered across UTC hours 0-16 — one hour intentionally shared by fast-mlsirm and metering-billing-platform). Three test files were never updated to match and were failing on a cleanorigin/maincheckout:tests/test_hourly_review_repair_callers.py—_EXPECTED_TARGETS' 17 schedule keys and the schedule-list assertion still used the old hourly"<minute> * * * *"shape instead of the actual daily"<minute> <hour> * * *"cron strings (1 + 16 failing cases).tests/test_github_hourly_conflict_repair.py::test_central_repository_has_hourly_self_caller— assertedcron: "21 * * * *"instead of the central.githubself-caller's actualcron: "21 6 * * *".tests/test_pr_review_autofix_nvidia_nim_contract.py::test_review_fix_caller_runs_once_each_hour— asserted a single hourlycron: "23 * * * *"that no longer exists. This one was independently renamed totest_review_fix_caller_keeps_the_github_daily_recovery_slotand repointed at Clearfolio's actualcron: "23 7 * * *"by fix(actions): pin opencode-review-dispatch.yml off starved ubuntu-latest #1870 (merged while this PR was in progress); this branch merges that in and extends the docstring/assertions (reusable-scheduler product-neutrality check) while keeping fix(actions): pin opencode-review-dispatch.yml off starved ubuntu-latest #1870's function name and content as the source of truth.Found while investigating a live required-check failure on
ContextualWisdomLab/.github#1870:agent-review-runtime-quality-ci.yml's "Verify scheduler and contextual-orchestrator review-repair contracts" step runspytestwith no positional test path argument, so it falls back to full defaulttests/discovery — picking up all 19 of these stale assertions on every PR. With them fixed, the exact unscopedpytestcommand the workflow runs passes cleanly, so no change toagent-review-runtime-quality-ci.ymlitself was needed.Also updates:
CHANGELOG.md(first## [Unreleased]section, per this repo's own convention for entries that predate a later duplicate heading).docs/product-technical-gap-baseline.md— amends fix(actions): pin opencode-review-dispatch.yml off starved ubuntu-latest #1870's own "Separately found while validating this fix, not yet fixed" closing note (about this exact stale-cron bug) to record that it is now fixed, and folds in the two additional stale files this investigation found beyond the one fix(actions): pin opencode-review-dispatch.yml off starved ubuntu-latest #1870 had already spotted.Test plan
PYTHONPATH=. python3 -m pytest tests/test_hourly_review_repair_callers.py tests/test_github_hourly_conflict_repair.py tests/test_pr_review_autofix_nvidia_nim_contract.py -v→ all pass (59 tests).agent-review-runtime-quality-ci.yml's coverage step (pytest -q --cov=scripts.ci.pr_review_conflict_scope --cov=scripts.ci.pr_review_autofix_context --cov=scripts.ci.zdr_policy --cov=scripts.ci.contextual_orchestrator_review_policy --cov-branch --cov-fail-under=100, full defaulttests/discovery) → 100% branch coverage reached; only 3 failures remain, all pre-existing/unrelated (2 real test/workflow-drift bugs in other files, 1 localgh-CLI-missing sandbox limitation — confirmed present identically on a stash-based A/B against baseline).PYTHONPATH=. coverage run -m pytest tests --ignore=tests/test_queue_cancellation_open_pr_revalidation.py --ignore=tests/test_queue_cancellation_revalidation.py -q→ went from 23 failed / 2828 passed (captured baseline on cleanorigin/main) to 3 failed / 2849 passed (all 3 pre-existing and unrelated, as above).coverage report --include='scripts/ci/*'(99%) andinterrogate scripts/ci(98.3%) — unchanged from baseline, confirming this is a test-only change.git diff --check— clean.🤖 Generated with Claude Code
https://claude.ai/code/session_01KPmJErfkcHer4UVEgrQxUX
Generated by Claude Code