From 834751768f96b16092ed8b8e6f2ec2d1bf74d57c Mon Sep 17 00:00:00 2001 From: Steven Schoen Date: Thu, 17 Nov 2022 17:29:21 -0500 Subject: [PATCH 1/7] Add managed device (Pixel 5, API 29) --- app/build.gradle | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/app/build.gradle b/app/build.gradle index fafb8155..e67fc3a3 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -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 { From 4861681a488c008c7521380a59242a871991f476 Mon Sep 17 00:00:00 2001 From: Steven Schoen Date: Thu, 17 Nov 2022 17:29:57 -0500 Subject: [PATCH 2/7] Use managed device in GitHub workflow instead of android-emulator-runner --- .github/workflows/instrumentation-test.yml | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/.github/workflows/instrumentation-test.yml b/.github/workflows/instrumentation-test.yml index d5be42a3..51f460e4 100644 --- a/.github/workflows/instrumentation-test.yml +++ b/.github/workflows/instrumentation-test.yml @@ -49,17 +49,8 @@ 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 + - name: Build and run instrumentation tests + run: ./gradlew :app:allDevicesCheck - name: Upload test reports if: always() From 0d1ab0371349150ef40fb195fd5a6e03dee5bf34 Mon Sep 17 00:00:00 2001 From: Steven Schoen Date: Thu, 17 Nov 2022 17:43:04 -0500 Subject: [PATCH 3/7] Clarify step name --- .github/workflows/instrumentation-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/instrumentation-test.yml b/.github/workflows/instrumentation-test.yml index 51f460e4..2a2486ce 100644 --- a/.github/workflows/instrumentation-test.yml +++ b/.github/workflows/instrumentation-test.yml @@ -49,7 +49,7 @@ jobs: env: MAPS_API_KEY: ${{ secrets.SYNCED_GOOGLE_MAPS_API_KEY_ANDROID }} - - name: Build and run instrumentation tests + - name: Run instrumentation tests run: ./gradlew :app:allDevicesCheck - name: Upload test reports From 531c3003019ff955ad56c6da25dce0f99c3c0f85 Mon Sep 17 00:00:00 2001 From: Steven Schoen Date: Thu, 17 Nov 2022 18:17:42 -0500 Subject: [PATCH 4/7] Specify setup timeout of 20 mins --- .github/workflows/instrumentation-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/instrumentation-test.yml b/.github/workflows/instrumentation-test.yml index 2a2486ce..c9455c6c 100644 --- a/.github/workflows/instrumentation-test.yml +++ b/.github/workflows/instrumentation-test.yml @@ -50,7 +50,7 @@ jobs: MAPS_API_KEY: ${{ secrets.SYNCED_GOOGLE_MAPS_API_KEY_ANDROID }} - name: Run instrumentation tests - run: ./gradlew :app:allDevicesCheck + run: ./gradlew :app:allDevicesCheck -Pandroid.experimental.testOptions.managedDevices.setupTimeoutMinutes=20 - name: Upload test reports if: always() From e7e6e10667c8835153c709eaf776e6fd3e515500 Mon Sep 17 00:00:00 2001 From: Steven Schoen Date: Thu, 17 Nov 2022 20:30:59 -0500 Subject: [PATCH 5/7] Set timeout in seconds --- .github/workflows/instrumentation-test.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/instrumentation-test.yml b/.github/workflows/instrumentation-test.yml index c9455c6c..2a5bce5c 100644 --- a/.github/workflows/instrumentation-test.yml +++ b/.github/workflows/instrumentation-test.yml @@ -50,7 +50,9 @@ jobs: MAPS_API_KEY: ${{ secrets.SYNCED_GOOGLE_MAPS_API_KEY_ANDROID }} - name: Run instrumentation tests - run: ./gradlew :app:allDevicesCheck -Pandroid.experimental.testOptions.managedDevices.setupTimeoutMinutes=20 + run: ./gradlew :app:allDevicesCheck -Pandroid.experimental.testOptions.managedDevices.setupTimeoutMinutes=1200 + # 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() From 8b42ea580f08f0f417759b87bca9aafe28e311ef Mon Sep 17 00:00:00 2001 From: Steven Schoen Date: Thu, 17 Nov 2022 21:01:20 -0500 Subject: [PATCH 6/7] Specify emulator GPU --- .github/workflows/instrumentation-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/instrumentation-test.yml b/.github/workflows/instrumentation-test.yml index 2a5bce5c..1702ad6c 100644 --- a/.github/workflows/instrumentation-test.yml +++ b/.github/workflows/instrumentation-test.yml @@ -50,7 +50,7 @@ jobs: MAPS_API_KEY: ${{ secrets.SYNCED_GOOGLE_MAPS_API_KEY_ANDROID }} - name: Run instrumentation tests - run: ./gradlew :app:allDevicesCheck -Pandroid.experimental.testOptions.managedDevices.setupTimeoutMinutes=1200 + run: ./gradlew :app:allDevicesCheck -Pandroid.experimental.testOptions.managedDevices.setupTimeoutMinutes=1200 -Pandroid.testoptions.manageddevices.emulator.gpu="swiftshader_indirect" # 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 From e4cb9e11c8a63b838f1da5a299c172480bbe1bf1 Mon Sep 17 00:00:00 2001 From: Steven Schoen Date: Mon, 21 Nov 2022 18:34:04 -0500 Subject: [PATCH 7/7] Add --info --- .github/workflows/instrumentation-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/instrumentation-test.yml b/.github/workflows/instrumentation-test.yml index 1702ad6c..885e1e65 100644 --- a/.github/workflows/instrumentation-test.yml +++ b/.github/workflows/instrumentation-test.yml @@ -50,7 +50,7 @@ jobs: MAPS_API_KEY: ${{ secrets.SYNCED_GOOGLE_MAPS_API_KEY_ANDROID }} - name: Run instrumentation tests - run: ./gradlew :app:allDevicesCheck -Pandroid.experimental.testOptions.managedDevices.setupTimeoutMinutes=1200 -Pandroid.testoptions.manageddevices.emulator.gpu="swiftshader_indirect" + 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