Skip to content

feat: Dockerized Android integration tests for native ForegroundService lifecycle#7

Merged
ppamorim merged 10 commits intomasterfrom
feature/integrationTest
Apr 17, 2026
Merged

feat: Dockerized Android integration tests for native ForegroundService lifecycle#7
ppamorim merged 10 commits intomasterfrom
feature/integrationTest

Conversation

@ppamorim
Copy link
Copy Markdown

@ppamorim ppamorim commented Apr 17, 2026

Summary

  • Adds Kotlin instrumented tests (connectedAndroidTest) that exercise the native ForegroundService start/stop/notification-channel lifecycle on a real Android emulator inside a Docker container.
  • Introduces scripts/Dockerfile.integration-test (Ubuntu + Android SDK API 34 + Flutter + headless emulator) and scripts/run-integration-tests.sh as the container entrypoint.
  • Adds a GitHub Actions workflow (integration-test.yml) triggered via workflow_dispatch and on push/PR to master/development, with KVM passthrough and Docker layer caching.
  • Documents local Docker-based test execution in the README.

Test plan

  • Trigger the workflow manually from the Actions tab and verify the Docker image builds and the 4 instrumented tests pass on the emulator.
  • Verify docker build -t fft-integration -f scripts/Dockerfile.integration-test . && docker run --device /dev/kvm fft-integration succeeds on a Linux host with KVM.
  • Confirm existing CI (ci.yml) is unaffected.

ppamorim added 10 commits April 17, 2026 18:46
…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.
@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
6 Security Hotspots

See analysis details on SonarQube Cloud

@ppamorim ppamorim merged commit bfe8d84 into master Apr 17, 2026
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant