Give the Robolectric choice a reason that is still true #89

Merged
JMR-dev merged 1 commits from docs/robolectric-rationale-correction into main 2026-08-25 04:12:48 +00:00
JMR-dev commented 2026-08-25 03:45:05 +00:00 (Migrated from github.com)

Closes #46.

Two test classes justified Robolectric by asserting the alternative does not exist:

file claim
AppRootRestorationTest "The instrumented tests cannot run on the development host at all (see CLAUDE.md)"
OutputPublisherStagingTest "The instrumented suite cannot run on the development host, so this is the only place [it] can be caught"

Both were true when written and stopped being true on 2026-08-22, when the segfault was traced to SwiftShader's Reactor JIT against SELinux execheap rather than to the machine. tools/local-emulator/run-e2e.sh has run API 33–36 here since.

#46 named only the first file. The second carries the same claim and would have been left asserting it.

Why this one was worse than stale

The first cites CLAUDE.md as its authority, and PR #73 corrected CLAUDE.md to say the opposite. A reader who followed the reference found a contradiction — with the citation making the wrong half look verified. Fifth instance of this defect here, after R14, R15, R20 and R25.

The choice was never wrong — only the premise

Neither test is moved. Both belong on the JVM, and the honest reason is cost, not impossibility: neither needs anything a device supplies, and both run in the same ./gradlew invocation as every other unit test instead of booting an emulator. That argument survives the correction.

The old wording had a second failure mode worth naming: "a red test nobody can execute" invites a reader to skip the local run and let CI decide — the opposite of what #51's definition-of-done asks for.

Verified

grep -rn "cannot run on the development host" app/src --include='*.kt'   → no matches
testDebugUnitTest · ktlintCheck · detekt                                → green
Closes #46. Two test classes justified Robolectric by asserting the alternative **does not exist**: | file | claim | |---|---| | `AppRootRestorationTest` | *"The instrumented tests cannot run on the development host at all (see CLAUDE.md)"* | | `OutputPublisherStagingTest` | *"The instrumented suite cannot run on the development host, so this is the only place [it] can be caught"* | Both were true when written and stopped being true on 2026-08-22, when the segfault was traced to SwiftShader's Reactor JIT against SELinux `execheap` rather than to the machine. `tools/local-emulator/run-e2e.sh` has run API 33–36 here since. **#46 named only the first file.** The second carries the same claim and would have been left asserting it. ## Why this one was worse than stale The first cites `CLAUDE.md` as its authority, and **PR #73 corrected `CLAUDE.md` to say the opposite**. A reader who followed the reference found a contradiction — with the citation making the wrong half look verified. Fifth instance of this defect here, after R14, R15, R20 and R25. ## The choice was never wrong — only the premise Neither test is moved. Both belong on the JVM, and the honest reason is **cost, not impossibility**: neither needs anything a device supplies, and both run in the same `./gradlew` invocation as every other unit test instead of booting an emulator. That argument survives the correction. The old wording had a second failure mode worth naming: *"a red test nobody can execute"* invites a reader to skip the local run and let CI decide — the opposite of what #51's definition-of-done asks for. ## Verified ``` grep -rn "cannot run on the development host" app/src --include='*.kt' → no matches testDebugUnitTest · ktlintCheck · detekt → green ```
Sign in to join this conversation.