feat: Dockerized Android integration tests for native ForegroundService lifecycle#7
Merged
feat: Dockerized Android integration tests for native ForegroundService lifecycle#7
Conversation
…ervice lifecycle Introduces Kotlin instrumented tests that exercise the native service start/stop/notification-channel flow on a real emulator inside Docker. Includes Dockerfile, entrypoint script, GitHub Actions workflow (workflow_dispatch + push/PR), and README instructions for local runs.
Use [[ instead of [ for conditionals, add explicit return in cleanup(), redirect error message to stderr, and merge consecutive Dockerfile RUN instructions into a single layer.
The entrypoint script was running ./gradlew from example/ instead of example/android/ where the Gradle wrapper lives. Also adds platforms android-35/36 and build-tools 35.0.0 since Flutter stable (3.41.7) requires SDK 36 and the app uses compileSdk 35.
- Add jlumbroso/free-disk-space step to reclaim ~30GB on the runner by removing preinstalled .NET, Haskell, Android SDK and tool caches. - Drop unused platforms;android-34 and build-tools;34.0.0 from the Android SDK install (only platforms 35/36 and build-tools 35 are required for compileSdk 35 and Flutter stable). - Strip non-x86_64 QEMU binaries, emulator skins, and Qt translations from the image to further reduce layer size.
gradlew, gradlew.bat, and gradle-wrapper.jar were gitignored, causing the Docker integration test container to fail with "No such file or directory" when attempting to run ./gradlew connectedAndroidTest.
minifyEnabled/shrinkResources in debug caused connectedAndroidTest to run R8 on the test APK, which then failed with missing errorprone annotation classes from androidx.test. Debug builds never need R8.
…N layers Replace jlumbroso/free-disk-space with the better-maintained endersonmenezes/free-disk-space@v3 action. Also merge the consecutive AVD creation RUN instruction into the SDK setup layer to satisfy SonarCloud.
|
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.


Summary
connectedAndroidTest) that exercise the nativeForegroundServicestart/stop/notification-channel lifecycle on a real Android emulator inside a Docker container.scripts/Dockerfile.integration-test(Ubuntu + Android SDK API 34 + Flutter + headless emulator) andscripts/run-integration-tests.shas the container entrypoint.integration-test.yml) triggered viaworkflow_dispatchand on push/PR tomaster/development, with KVM passthrough and Docker layer caching.Test plan
docker build -t fft-integration -f scripts/Dockerfile.integration-test . && docker run --device /dev/kvm fft-integrationsucceeds on a Linux host with KVM.ci.yml) is unaffected.