Commit graph

5 commits

Author SHA1 Message Date
Jason Monk
73b0182dcd
Fix #323: Remove personal machine identifiers from public repo (#326)
Replace `adolin.lan`, device serial `84TY004PW`, and LAN IPs
`192.168.68.*` scattered across e2e tests, device-tests, and docs
with placeholder syntax (`<your-dev-host>`, `<your-device-serial>`,
`<your-lan-ip>`). These values were defaults for local development
and had no reason to live in a public repo.

- `e2e/build.gradle.kts` no longer defaults `adb.host`; the `e2eTest`
  task now fails fast via `doFirst` if it's unset.
- e2e test classes read `adb.host` and throw a helpful error when
  missing instead of silently falling back to a host that only exists
  on the author's LAN.
- `device-tests/DeviceIntegrationTest` reads `lan.ip` from a system
  property (or env var) and skips via JUnit `assumeTrue` when unset.
- README grows a short "End-to-end tests" section documenting the
  required properties.

Git history still contains the leaked values — per the issue,
rewriting history is disruptive and unlikely to undo exposure on an
already-public repo.

Co-authored-by: Claude Opus 4 (1M context) <noreply@anthropic.com>
2026-04-20 12:24:01 -04:00
Jason Monk
304e40a8d7 Fix #18: Update Gradle wrapper and dependencies to latest stable
- Gradle: 8.12 -> 8.14
- AGP: 8.10.0 -> 8.13.2
- Compose BOM: 2025.02.00 -> 2026.03.00
- Firebase BOM: 33.10.0 -> 34.12.0 (migrate -ktx to main modules)
- Ktor: 3.1.3 -> 3.4.1
- Activity/Activity-Compose: 1.10.1 -> 1.12.4
- Lifecycle: 2.9.0 -> 2.10.0
- Navigation Compose: 2.8.9 -> 2.9.6
- Room: 2.7.1 -> 2.8.4
- WorkManager: 2.10.0 -> 2.11.2
- Koin: 4.0.0 -> 4.1.1
- DataStore: 1.1.1 -> 1.2.1
- OkHttp: 4.12.0 -> 5.3.0
- kotlinx-serialization-json: 1.9.0 -> 1.11.0
- kotlinx-io: 0.7.0 -> 0.9.0
- Health Connect: 1.1.0-alpha12 -> 1.1.0 (stable)
- Roborazzi: 1.36.0 -> 1.58.0
- Robolectric: 4.14.1 -> 4.16.1
- MockK: 1.13.16 -> 1.14.9
- JUnit Jupiter: 5.11.4 -> 5.13.4
- ktlint plugin: 12.2.0 -> 14.2.0
- detekt: 1.23.7 -> 1.23.8
- Splashscreen: 1.0.1 -> 1.2.0
- AppCompat: 1.7.0 -> 1.7.1
- Acme4j: 3.5.0 -> 3.5.1
- Google Services: 4.4.2 -> 4.4.4
- compileSdk: 35 -> 36

Also runs ktlintFormat to fix new class-signature rule violations.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 17:36:46 -04:00
Jason Monk
1850a085f3 Fix device integration tests: manifest, permissions, and plain-HTTP relay
Three root causes prevented the wake flow test from passing:

1. TunnelForegroundService and FcmReceiver were not declared in the work
   module's AndroidManifest.xml, so Android couldn't find or start them.

2. ADB broadcasts to FirebaseInstanceIdReceiver require the C2DM sender
   permission, which the ADB shell (uid 2000) lacks. Added a debug-only
   TestWakeReceiver that starts TunnelForegroundService without requiring
   any sender permission.

3. The relay URL was hardcoded to wss:// but the test relay runs without
   TLS. Added configurable relay.scheme build property (defaults to wss,
   tests pass ws). The relay now injects a test DeviceIdentity when running
   without TLS so /ws accepts connections. Added cleartext network security
   config for debug builds.

Also fixed: TunnelForegroundService now catches connection errors instead
of crashing, and installApk() auto-uninstalls on signature mismatch.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 17:31:54 -04:00
Jason Monk
f904b089cc Fix 2 of 3 device-test failures: relay plain HTTP routing, test harness config
The relay rejected plain HTTP connections when TLS was disabled because
SNI routing requires a TLS ClientHello. Non-TLS traffic now routes to the
relay API when tls_config is None.

Test harness fixes:
- Set ANDROID_HOME in ApkBuilder subprocess environment
- Use correct debug package name (com.rousecontext.debug) in DeviceController
  and FakeFcmServer
- Use fully qualified activity class name for ADB launch command

The third test (full wake flow) remains blocked on incomplete app-level DI
wiring for TunnelForegroundService. See BLOCKERS.md for details.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 15:52:12 -04:00
Jason Monk
3f6ce669d0 Add device-tests module for end-to-end integration testing with real Android device
New :device-tests Gradle module (pure JVM) that orchestrates full E2E flows:
- RelayProcess: starts Rust relay binary as subprocess on random port
- FakeFcmServer: Ktor HTTP server that translates FCM requests into ADB broadcasts
- DeviceController: ADB wrapper for install, launch, logcat, screenshots, wake broadcast
- ApkBuilder: builds debug APK with custom relay host/port via Gradle properties

Three test scenarios: full wake flow, relay status check, and APK build/install.
Tests skip cleanly via Assume when no device or relay binary is available.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 15:31:03 -04:00