General: Test first launch and app updates on Android emulators - #722
Merged
Merged
Conversation
Adds :app-e2e, a self-instrumenting com.android.test module that drives the real debug APK with UiAutomator, plus an Emulator tests workflow (API 30 and 36) modelled on Butler's. - GoldenPathTest: onboarding, granting the dashboard's permissions through its cards and the system dialog, relaunch skips onboarding. - SponsorPitchTest (foss): the pitch is reachable from the dashboard, a locked setting and the upgrade status. - UpgradeScreenTest (gplay): without a Play Store the screen reports Play as unavailable and settles on "prices unavailable". No purchase is possible on these images. - UpgradeTest (foss, via tools/upgrade-test.sh): the previous v* tag is built as fossDebug, both APKs are re-signed with the local debug key, and state set up in the old build must survive `install -r`. The upgrade test becomes a supporter through the real sponsor flow in the old build. The supporter record keeps a retained serialization schema and an undecodable record silently reads as "not a supporter", so only a real old-to-new APK install catches a regression that strips supporters. The 5-second heuristic itself stays covered by FossUpgradeViewModelTest. Removing settings_foss after an upgrade makes afterUpgrade fail at "Upgrade active". scrollTo swipes the screen instead of using UiAutomator's scrollable lists because API 30 marks no Compose list as scrollable.
The unqualified connectedFossDebugAndroidTest in build-commands.md now reaches :app-e2e, which clears and (through Gradle) uninstalls eu.darken.capod on every attached device. Point it at :app-e2e with ANDROID_SERIAL, and make upgrade-test.sh refuse a device whose ro.kernel.qemu is not 1 (set on both the API 30 and 36 images). An in-test check would not help: Gradle uninstalls the app when a run ends, so a phone's data is gone either way. Also note that afterUpgrade may only check state the baseline release's own beforeUpgrade sets up, and fix two comments.
On the API 30 runner a 'Pixel Launcher isn't responding' dialog covered onboarding, so every test timed out. await and scrollTo now tap Wait on another app's ANR dialog, and fail if the dialog names CAPod. The runner has no ~/.android/debug.keystore (debug builds there are signed with a fallback key), so apksigner failed. The upgrade script now re-signs both APKs with a throwaway key it generates per run.
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.
What changed
No user-facing behavior change. Every PR now runs the app on Android 11 and Android 16 emulators:
Technical Context
v*tag as a FOSS debug APK and re-signs both APKs with a throwaway key. The published release APKs are release-signed, so a debug build can't update them in place.google_apisimages have no billing. The screen first shows "Google Play services are unavailable", then settles on "Prices unavailable".eu.darken.capod, which debug builds share with the release application id.upgrade-test.shrefuses to run on anything that isn't an emulator, and the docs requireANDROID_SERIALfor the Gradle runs.