Repository navigation
ci: run the Android instrumented tests on an emulator - #137
aaronbrethorst merged 4 commits into
Conversation
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (11)
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe Android workflow now runs instrumented tests in an emulator. The resume screen supports scrolling and disables actions until a trip is loaded. MainActivity re-arms tracking while resumed when tracking state is active. ChangesInstrumented Android CI
Tracking re-arm behavior
Resume Shift screen
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Other Sequence Diagram(s)sequenceDiagram
participant MainActivity
participant rearmWhenActive
participant TrackingState
participant ServiceController
MainActivity->>rearmWhenActive: collect tracking state while RESUMED
rearmWhenActive->>TrackingState: observe active values
TrackingState-->>rearmWhenActive: emit active state
rearmWhenActive->>ServiceController: startTracking()
Merge Risk: ⚪ Minimal · up to No merge-blocking issue is established. Confirm the new emulator job passes as part of normal CI checks. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to Tracking recovery retains the existing trip ownership and permission controls, and no introduced security bypass was identified. Remaining uncertainty concerns concurrent lifecycle transitions and the new CI runner dependencies and permissions. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
Resilience and Maintainability Implications
Hardening Proposals
🚥 Pre-merge checks | ✅ 3 | ❌ 1 | ❓ 1❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
Full details: Linked Issues checkExplanation [ Full details: Docstring CoverageExplanation Docstring coverage is 6.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 15 functions across 10 files. (1 skipped: 1 unsupported.)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. 🤖 Generated with Claude Code |
aaronbrethorst
left a comment
There was a problem hiding this comment.
Thanks, Divesh. I read the job log, not just the green check: the emulator booted from the snapshot and ran all 17 instrumented tests. The bundled #115 fixes (resume buttons, scrolling, re-arm while resumed) all behave the same as before, and rearmWhenActive has unit tests. Merging.
Follow-ups: adding the emulator/system-image version to the AVD cache key would avoid stale snapshots. instrumented should also become a required check.
Fixes #132
The Android workflow never ran
src/androidTest, and never even compiled it, sinceassembleDebugbuilds the app APK and not the test APK.ScreenFlowTestandKeystoreCryptorTestcould break and CI stayed green.This PR adds an instrumented job beside the
androidjob, so unit test feedback stays fast and an emulator problem fails a job of its own. It runsconnectedDebugAndroidTestwithreactivecircus/android-emulator-runner@v2on an API 36 x86_64 default image (36 is ourtargetSdk, and the image has the Android Keystore), with KVM enabled per the action's README and the AVD cached by API level.The three #115 review fixes ship here because this job is what tests them:
Boxdoing the centering thatArrangement.Centercannot do underverticalScrollstartTrackingwheneveractiveturns true while resumed, instead of checking once inonResume. This covers aSTART_STICKYrestart that turnsactiveafter the activity resumed and then degrades. That is harmless on a healthy service (which only requests updates when none are running), and going inactive never triggers it, so an ended trip is not restarted. I could not reproduce the race on demand, so this covers the window rather than a repro.Verification
assembleDebug,testDebugUnitTest,assembleRelease, andassembleDebugAndroidTestpassdistinctUntilChanged, dropping the filter, or the old one-shot check)Summary by CodeRabbit