Repository navigation
docs(test): Phase 6 — regenerate the test plan and add real guardrails - #275
Merged
Merged
Conversation
Phase 6 of docs/TEST_COVERAGE_PRD.md, the final phase. ## TEST_PLAN.md was wrong in ways nobody had noticed Two claims were provably false by the time anyone read them: - core/database was marked "✅ 100% COMPLETE (logic-bearing migrations)". Four of six migrations had NO test, and the one that did asserted SQL substrings against a mock. Fixed in Phase 3. - feature/library was marked "🔴 DEFERRED — requires extensive DI/context setup". Its display logic turned out to be extractable to pure functions with no DI at all, and now has 23 unit tests. And the "Future Testing Priorities" list recommended writing tests for a donation state machine that had ALREADY BEEN DELETED — pollUntilPaid, createDonationInvoice and hasAnySettledInvoice all went in PRs #163/#172 when the donation flow became an external link. A stale priority list quietly sends people to work that cannot be done. The hand-written per-module narrative is replaced by a pointer to measured Kover data, which CI prints on every run. Prose would go stale again within a week; the numbers cannot. Coverage table refreshed to 41.6% (dev @ efb1b89), from 40.1% at first measurement, with the movement attributed per module to Phases 3-5. ## AGENTS.md now carries the decisions, not just the conventions - A "choosing a test type" table: pure JVM / Robolectric / Roborazzi / instrumented / Test Lab, with the rule that going lower is not thrift if the level cannot observe the property. Both traps that cost real time are named: an assertion at a level that cannot fail, and a generic label sweep that passes on "A-" / "Show". - "Prove a new test can fail" — break it on purpose, confirm red, restore. Three concrete examples of tests that passed while asserting nothing, all of which looked correct in review. - Coverage expectations: what is gated, what is report-only and why a repo-wide ratchet is deliberately avoided, and not to chase the overall percentage. ## A guardrail that actually runs scripts/check-test-plan-modules.py fails CI if a module in settings.gradle.kts is absent from TEST_PLAN.md, or if the plan names a module that no longer exists. Deliberately the weakest check that still works. It gates COMPLETENESS, not accuracy: gating a doc on being true would mean regenerating it on every PR, which trains people to bypass the check. What it prevents is a new module arriving with no tests and no mention while the plan still reads as if it covers the repo. Runs first in jvm-tests.yml — pure Python, no Gradle, so drift is reported in seconds rather than after the ~11-minute test run. Verified in both directions (undocumented module, and a phantom core:licensing reference), and it caught a bug in its own first draft: a regex requiring a colon reported `app` as undocumented while it sat in the coverage table.
Contributor
📱 iOS Build Status: PASSED✅ iOS Simulator Build & Unit Tests - success iOS UI tests run in a separate, informational job and are not reflected above — check "iOS UI Tests (informational)" for those. |
Review finding on my own change. The check was placed first for fast feedback, but a failing step ends the job — so a stale doc would hide every test and coverage result behind it. Someone who adds a module and forgets the table would see a red X and learn nothing about whether their tests pass. That is precisely how a check teaches people to route around it, which defeats the point of adding one. Moved to last with `if: always()`: both signals now always arrive, and the doc is still checked when the tests themselves fail. It is still a hard gate in a required job, so the agent pipeline cannot auto-merge past it — a separate advisory job would have been ignored entirely, since auto-merge only waits on required checks.
Contributor
📱 iOS Build Status: PASSED✅ iOS Simulator Build & Unit Tests - success iOS UI tests run in a separate, informational job and are not reflected above — check "iOS UI Tests (informational)" for those. |
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.
Phase 6 of
docs/TEST_COVERAGE_PRD.md— the final phase. Runs in parallel with #274 (Phase 5 remainder); no file overlap.TEST_PLAN.md was wrong in ways nobody had noticed
Two claims were provably false by the time anyone read them:
core/databasewas marked "✅ 100% COMPLETE (logic-bearing migrations)". Four of six migrations had no test, and the one that did asserted SQL substrings against a mock. Fixed in Phase 3.feature/librarywas marked "🔴 DEFERRED — requires extensive DI/context setup". Its display logic turned out to be extractable to pure functions with no DI at all, and now has 23 unit tests.And the "Future Testing Priorities" list recommended writing tests for a donation state machine that had already been deleted —
pollUntilPaid,createDonationInvoice,hasAnySettledInvoiceall went in PRs #163/#172 when the donation flow became an external link. Verified by grep: none of those symbols exist.A stale priority list quietly sends people to work that cannot be done. That's the specific failure this phase exists to stop.
The hand-written per-module narrative is replaced by a pointer to measured Kover data, which CI already prints on every run. Prose goes stale within a week; the numbers can't.
Coverage table refreshed to 41.6% (
dev@efb1b89), up from 40.1% at first measurement, with movement attributed per module to Phases 3–5.AGENTS.md now carries the decisions, not just the conventions
"A-"/"Show".A guardrail that actually runs
scripts/check-test-plan-modules.pyfails CI if a module insettings.gradle.ktsis absent fromTEST_PLAN.md, or if the plan names a module that no longer exists.It is deliberately the weakest check that still works. It gates completeness, not accuracy — gating a doc on being true would mean regenerating it on every PR, which trains people to bypass the check. What it prevents is a new module arriving with no tests and no mention while the plan still reads as though it covers the repo.
Runs first in
jvm-tests.yml: pure Python, no Gradle, so drift is reported in seconds rather than after the ~11-minute test run.Verified in both directions (undocumented module; phantom
core:licensingreference). It also caught a bug in its own first draft — a regex requiring a colon reportedappas undocumented whileappsat in the coverage table.Note
Touches
.github/workflows/jvm-tests.yml, so this isrisk:highunderagent-policy.ymland wants a human read of that step. It adds one step and changes nothing about how tests run.Closes the PRD's Phase 6.