Skip to content

Commit f3f9207

Browse files
authored
Merge pull request #2801 from square/worktree-fix-ci-instrumentation-tests
Fix instrumentation tests: uninstall stale APKs before connectedCheck
2 parents 959be77 + 470859b commit f3f9207

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

.github/workflows/main.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,17 @@ jobs:
9595
arch: ${{ matrix.arch }}
9696
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none -no-snapshot-save
9797
script: |
98-
touch emulator.log # create log file
99-
chmod 777 emulator.log # allow writing to log file
100-
adb logcat >> emulator.log & # pipe all logcat messages into log file as a background process
98+
# Uninstall existing packages to avoid INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES
99+
# when a cached AVD snapshot has old APKs signed with different keys.
100+
adb uninstall com.squareup.leakcanary || true
101+
adb uninstall com.squareup.leakcanary.test || true
102+
adb uninstall com.squareup.leakcanary.core || true
103+
adb uninstall com.squareup.leakcanary.core.test || true
104+
adb uninstall com.squareup.leakcanary.instrumentation || true
105+
adb uninstall com.squareup.leakcanary.instrumentation.test || true
106+
touch emulator.log
107+
chmod 777 emulator.log
108+
adb logcat >> emulator.log &
101109
./gradlew leakcanary:leakcanary-android-core:connectedCheck leakcanary:leakcanary-android:connectedCheck leakcanary:leakcanary-android-instrumentation:connectedCheck --no-build-cache --no-daemon --stacktrace
102110
- name: Upload results
103111
if: ${{ always() }}

0 commit comments

Comments
 (0)