Make the instrumented tests capable of failing #61

Merged
paulhitt merged 2 commits from fix/a-skipped-instrumented-test-must-not-pass into main 2026-09-04 20:49:05 +00:00
paulhitt commented 2026-09-03 00:58:27 +00:00 (Migrated from gitlab.com)

Three separate reasons these suites could never catch a regression, all
fixed here. None of them are about the app; all of them are about the tests
being unable to report the truth.

  1. A skipped test reported as a pass. Thirteen guards were bare returns —
    if (!relayReachable()) return — so with no relay the method returned
    immediately and the runner recorded PASSED. Now assumeTrue, which
    reports SKIPPED, and the run says "(2 skipped)" where it used to say
    nothing at all. Only the guards that abandon a whole test were changed;
    helper loop exits like if (found) return are control flow and were
    left alone.

  2. The relay was hardcoded to relay1.flamenet.io — production. Every run
    that did work created real accounts there. Now -e relay <host>, still
    defaulting to production so an unqualified run is unchanged.

  3. Android blocks cleartext HTTP, so a debug build could not reach a relay
    on the developer's machine even when one was running. A debug-only
    network security config permits cleartext to 10.0.2.2, 127.0.0.1 and
    localhost, and nothing else. src/debug, so no release APK is affected.

Together these took the sign-up suite from "2 skipped, reported green" to
"2 run, 2 failed" — which is worth more, because it is true. What it
fails on now (no compose hierarchy at launch) is the next thing to fix.

./gradlew :app:connectedDebugAndroidTest
-Pandroid.testInstrumentationRunnerArguments.relay=10.0.2.2:18810

Three separate reasons these suites could never catch a regression, all fixed here. None of them are about the app; all of them are about the tests being unable to report the truth. 1. A skipped test reported as a pass. Thirteen guards were bare returns — `if (!relayReachable()) return` — so with no relay the method returned immediately and the runner recorded PASSED. Now `assumeTrue`, which reports SKIPPED, and the run says "(2 skipped)" where it used to say nothing at all. Only the guards that abandon a whole test were changed; helper loop exits like `if (found) return` are control flow and were left alone. 2. The relay was hardcoded to relay1.flamenet.io — production. Every run that did work created real accounts there. Now `-e relay <host>`, still defaulting to production so an unqualified run is unchanged. 3. Android blocks cleartext HTTP, so a debug build could not reach a relay on the developer's machine even when one was running. A debug-only network security config permits cleartext to 10.0.2.2, 127.0.0.1 and localhost, and nothing else. src/debug, so no release APK is affected. Together these took the sign-up suite from "2 skipped, reported green" to "2 run, 2 failed" — which is worth more, because it is true. What it fails on now (no compose hierarchy at launch) is the next thing to fix. ./gradlew :app:connectedDebugAndroidTest \ -Pandroid.testInstrumentationRunnerArguments.relay=10.0.2.2:18810
paulhitt commented 2026-09-03 00:58:27 +00:00 (Migrated from gitlab.com)

assigned to @paulhitt

assigned to @paulhitt
paulhitt commented 2026-09-03 01:05:05 +00:00 (Migrated from gitlab.com)

added 1 commit

  • df00bea3 - Grant notification permission before the activity launches

Compare with previous version

added 1 commit <ul><li>df00bea3 - Grant notification permission before the activity launches</li></ul> [Compare with previous version](/paulhitt/flamenet-messenger-android/-/merge_requests/34/diffs?diff_id=2001205324&start_sha=16e0101daf434094b0c46b487ac09d3c4b779152)
paulhitt (Migrated from gitlab.com) merged commit 10dcb53fa6 into main 2026-09-04 20:49:05 +00:00
Sign in to join this conversation.