Workaround for emulator bug

Change-Id: Ica9ca60071427f852be9125d3565aa37be932dc9
ben/dropshots
Jose Alcérreca 6 months ago
parent ca8f2681e3
commit 8839278e8f

@ -203,6 +203,30 @@ jobs:
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
script: ./gradlew connectedDemoDebugAndroidTest --daemon script: ./gradlew connectedDemoDebugAndroidTest --daemon
# Workaround for https://github.com/ReactiveCircus/android-emulator-runner/issues/391
# From https://github.com/TWiStErRob/github-workflows/blob/main/.github/workflows/instrumentation.yml
- name: "Workaround for emulator bug."
id: script
env:
SCRIPT: |
# Workaround for https://github.com/ReactiveCircus/android-emulator-runner/issues/373
pre_terminate_crashpad() {
# For some reason pgrep/pkill sees only crashpad_handle, not crashpad_handler,
# but it's definitely called ${ANDROID_HOME}/emulator/crashpad_handler.
# Best-effort gracefully terminate all crashpad_handler processes.
pkill --exact --echo --signal SIGTERM crashpad_handle || return
sleep 10
pkill --exact --echo --signal SIGKILL crashpad_handle || return
}
trap pre_terminate_crashpad EXIT
${{ inputs.script }}
run: |
script_file="${RUNNER_TEMP}/reactivecircus-android-emulator-runner-prepared-script.sh"
echo "${SCRIPT}" > "${script_file}"
echo "file=${script_file}" >> "${GITHUB_OUTPUT}"
- name: Prevent pushing new screenshots if this is a fork (instrumented) - name: Prevent pushing new screenshots if this is a fork (instrumented)
id: checkfork_screenshots_instrumented id: checkfork_screenshots_instrumented
continue-on-error: false continue-on-error: false

@ -88,17 +88,17 @@ class EdgeToEdgeTest {
} }
@RequiresDisplay(WidthSizeClassEnum.COMPACT, HeightSizeClassEnum.MEDIUM) @RequiresDisplay(WidthSizeClassEnum.COMPACT, HeightSizeClassEnum.MEDIUM)
@SdkSuppress(minSdkVersion = 26, maxSdkVersion = 26) @SdkSuppress(minSdkVersion = 27, maxSdkVersion = 27)
@Test @Test
fun edgeToEdge_Phone_Api26() { fun edgeToEdge_Phone_Api27() {
testEdgeToEdge("edgeToEdge_Phone_Api26") testEdgeToEdge("edgeToEdge_Phone_Api27")
} }
@RequiresDisplay(WidthSizeClassEnum.COMPACT, HeightSizeClassEnum.MEDIUM) @RequiresDisplay(WidthSizeClassEnum.COMPACT, HeightSizeClassEnum.MEDIUM)
@SdkSuppress(minSdkVersion = 30, maxSdkVersion = 30) @SdkSuppress(minSdkVersion = 31, maxSdkVersion = 31)
@Test @Test
fun edgeToEdge_Phone_Api30() { fun edgeToEdge_Phone_Api31() {
testEdgeToEdge("edgeToEdge_Phone_Api30") testEdgeToEdge("edgeToEdge_Phone_Api31")
} }
@RequiresDisplay(WidthSizeClassEnum.EXPANDED, HeightSizeClassEnum.MEDIUM) @RequiresDisplay(WidthSizeClassEnum.EXPANDED, HeightSizeClassEnum.MEDIUM)

@ -27,12 +27,12 @@ import org.gradle.kotlin.dsl.invoke
internal fun configureGradleManagedDevices( internal fun configureGradleManagedDevices(
commonExtension: CommonExtension<*, *, *, *, *, *>, commonExtension: CommonExtension<*, *, *, *, *, *>,
) { ) {
val pixel4 = DeviceConfig("Pixel 4", 30, "aosp-atd") val pixel4 = DeviceConfig("Pixel 4", 27, "aosp")
val pixel6 = DeviceConfig("Pixel 6", 31, "aosp") val pixel6 = DeviceConfig("Pixel 6", 31, "aosp")
val pixelC = DeviceConfig("Pixel C", 30, "aosp-atd") val pixelC = DeviceConfig("Pixel C", 30, "aosp")
val allDevices = listOf(pixel4, pixel6, pixelC) val allDevices = listOf(pixel4, pixel6, pixelC)
val ciDevices = listOf(pixel4, pixelC) val ciDevices = listOf(pixel4, pixel6, pixelC)
commonExtension.testOptions { commonExtension.testOptions {
managedDevices { managedDevices {

@ -2,7 +2,7 @@
accompanist = "0.34.0" accompanist = "0.34.0"
androidDesugarJdkLibs = "2.0.4" androidDesugarJdkLibs = "2.0.4"
# AGP and tools should be updated together # AGP and tools should be updated together
androidGradlePlugin = "8.4.0" androidGradlePlugin = "8.4.1"
androidTools = "31.4.0" androidTools = "31.4.0"
androidxActivity = "1.8.2" androidxActivity = "1.8.2"
androidxAppCompat = "1.6.1" androidxAppCompat = "1.6.1"

Loading…
Cancel
Save