Fix Backend-tests CI: 10 tests missing the established tesseract mock - #137
Merged
Conversation
10 tests in test_local_identify_printing_tags.py (added 2026-07-15 to -17) call run_pilot with a real fetched image but skip monkeypatching local_ocr.run_tesseract, so detect_illus_anchor's unconditional OCR fallback hits the real tesseract binary - absent on CI's bare ubuntu-latest runner, present in the local Docker image and host venv, which is why this passed everywhere except CI. Same fix pattern as ddb6dce. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Wio5Yq81k96aHjSJMFB62d
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Wio5Yq81k96aHjSJMFB62d
WilfordGrimley
added a commit
that referenced
this pull request
Jul 19, 2026
…E_API_KEY rotation didn't clear the CI skip CORR-0009: a directive claimed PR #136/#137 were merged via UI when they weren't (conflated with two unrelated credential rotations) -- caught by gh api verification before any branch deletion or downstream claim, zero actual damage. docs/lessons.md: rotating GOOGLE_DRIVE_API_KEY alone didn't clear the 4-skipped baseline on a fresh re-run -- likely still blocked on pyOpenSSL not being installed in the CI runner (per #135's own commit note), not conclusively fixed by the rotation alone. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Wio5Yq81k96aHjSJMFB62d
WilfordGrimley
added a commit
that referenced
this pull request
Jul 19, 2026
…tions ledger, docs manifest (#136) * Phase 1/2 orchestration groundwork: guard hook, SessionStart context, worker roster Adds a committed .claude/settings.json wiring two hooks: guard_master.py (PreToolUse) blocks gh pr merge / git merge into master unconditionally, and git push to master only from worker worktree checkouts, leaving the interactive main-checkout push-to-master convention untouched; and session_context.sh (SessionStart) injects live branch/CI/PR state, using the correct fork-vs-upstream repo slug and the Checks API (not the legacy Status API, which silently hides Actions failures). Adds four scrubbed, public worker agent definitions (.claude/agents/worker-{backend,frontend,docs,upstream}.md) and a tiered report schema mirror (docs/reports/schema.json) for the six-field standing report format. Carves committed exceptions into .gitignore's blanket /.claude/ ignore so these files are actually trackable. Documents the branch-protection trade-off (real backstop vs. workflow cost) in docs/infrastructure.md without applying it. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Wio5Yq81k96aHjSJMFB62d * Fix guard_master.py stub-logging path leak; add corrections ledger, docs manifest, lessons triage ritual guard_master.py fixes: exempt git merge --ff-only from the unconditional git-merge-into-master block (a fast-forward sync isn't an authorization decision); fix log_stub() resolving repo root from the script's own on-disk path instead of cwd, which was writing real ledger entries from test-fixture invocations. Adds corrections/ (blameless CORR-NNNN ledger, seeded with 7 verified incidents from this week's real history), docs/MANIFEST.md (routing table: path/purpose/governs-what/authority), and a lessons-to-gates triage ritual documented in docs/lessons.md. Broadens CLAUDE.md's gh-CLI upstream-parent-resolution note to cover list/view, not just create/merge. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Wio5Yq81k96aHjSJMFB62d * Add CORR-0008 (ramp-probe serialized latency) + report-as-evidence ledger rule Establishes that a corrections entry may cite a report instead of a commit SHA when no discrete commit exists for the fix (owner decision). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Wio5Yq81k96aHjSJMFB62d * Add CORR-0009 (planner asserted unconfirmed merges); note GOOGLE_DRIVE_API_KEY rotation didn't clear the CI skip CORR-0009: a directive claimed PR #136/#137 were merged via UI when they weren't (conflated with two unrelated credential rotations) -- caught by gh api verification before any branch deletion or downstream claim, zero actual damage. docs/lessons.md: rotating GOOGLE_DRIVE_API_KEY alone didn't clear the 4-skipped baseline on a fresh re-run -- likely still blocked on pyOpenSSL not being installed in the CI runner (per #135's own commit note), not conclusively fixed by the rotation alone. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Wio5Yq81k96aHjSJMFB62d --------- Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes a real, scoped regression: 10 tests added 2026-07-15 to -17 in
MPCAutofill/cardpicker/tests/test_local_identify_printing_tags.pyskip this file's established convention (ddb6dce9's docstring invariant: any test whose path reacheslocal_ocr.run_tesseractmust monkeypatch it) — they crashed CI withTesseractNotFoundErrorsince real OCR was never mocked, only masked locally by the dev venv/Docker image having tesseract genuinely installed.Full investigation, including two other root causes found in the same CI failure (both NOT fixed here, not code bugs — see below) is at
docs/reports/2026-07-19-backend-tests-ci-tesseract-fix.md.Note on overlap with #135 (merged,
6c6ea198): that PR independently fixed the Moxfield and Google-Drive-credential failures viapytest.mark.skipif, and installed real tesseract-ocr in the CI runner itself. This branch was cut before #135 landed; its own Moxfield-adjacent fix (arequires_networkpytest marker) was discarded once #135's already-merged, more thorough fix was discovered — no duplicate marker ships here.Resolved (owner decision, 2026-07-19): SHIP IT. The open question was whether this fix still adds value now that #135 installs real tesseract in CI. Owner's call: the file's monkeypatch convention is about unit-test hermeticity; #135 is about CI environment capability — both true simultaneously, hermetic units don't get retired by a provisioned runner. Merge on green.
Checklist
pre-commitand installed the hooks withpre-commit installbefore creating any commits.python3 -m py_compileon the edited test file: clean.pytest --collect-onlyinside a throwaway container from the livempcautofill_django:latestimage: 145 tests collected, zero collection errors.TesseractNotFoundError) and the fix's effect in isolation against the reallocal_fallback.detect_illus_anchorcode path, with and without the monkeypatch — see the linked report for detail. Full pytest run of the 10 tests' own assertions (not just the tesseract crash) was not executed in this environment (needs Docker-socket/testcontainers access this sandbox doesn't have) — recommend confirming via this branch's own next CI run rather than building special local infra for it.docs/troubleshooting.md's TesseractNotFoundError entry updated in place.)