Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Use AGP's managed devices for instrumentation tests #223

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 3 additions & 10 deletions .github/workflows/instrumentation-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,17 +49,10 @@ jobs:
env:
MAPS_API_KEY: ${{ secrets.SYNCED_GOOGLE_MAPS_API_KEY_ANDROID }}

- name: Build debug
run: ./gradlew assembleDebug

- name: Run instrumentation tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 29
target: google_apis
arch: x86
disable-animations: true
script: ./gradlew :app:connectedCheck --stacktrace
run: ./gradlew :app:allDevicesCheck -Pandroid.experimental.testOptions.managedDevices.setupTimeoutMinutes=1200 -Pandroid.testoptions.manageddevices.emulator.gpu="swiftshader_indirect" --info
# Due to a bug, setupTimeoutMinutes is actually expressed in seconds. Fix merged into AGP,
# but not released yet as of 7.3.1. TODO clean up once property is fixed

- name: Upload test reports
if: always()
Expand Down
12 changes: 12 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,18 @@ android {
jvmTarget = '1.8'
freeCompilerArgs += '-Xopt-in=kotlin.RequiresOptIn'
}

testOptions {
managedDevices {
devices {
pixel5api29(com.android.build.api.dsl.ManagedVirtualDevice) {
device = "Pixel 5"
apiLevel = 29
systemImageSource = "google"
}
}
}
}
}

dependencies {
Expand Down