From fb23e97d63a450f899e74f5c25caf6abdf07e215 Mon Sep 17 00:00:00 2001 From: Sam Pullara Date: Mon, 9 Nov 2026 15:53:22 -0800 Subject: [PATCH] ci: run emulator UI tests only on manual dispatch The emulator shards fail for reasons outside the code, such as Google Play Services updating itself during a test. Pull requests and main pushes now skip them. Start the CI workflow by hand with ui-tests=true to run them. Co-Authored-By: Claude Opus 5.5 Agent-Id: agent-a7ce0220-8c4d-43e2-823c-8410348e3a2d --- .github/workflows/ci.yml | 7 +++++++ README.md | 5 ++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8bf1756..c265d40 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,6 +7,11 @@ on: branches: [main] merge_group: workflow_dispatch: + inputs: + ui-tests: + description: Run the emulator UI tests + type: boolean + default: false permissions: contents: read @@ -43,6 +48,7 @@ jobs: instrumentation: name: Android emulator UI tests (API ${{ matrix.api }}, shard ${{ matrix.shard }}) + if: inputs.ui-tests runs-on: ubuntu-24.04 timeout-minutes: 60 strategy: @@ -109,6 +115,7 @@ jobs: instrumentation-reports: name: Check combined UI screenshots + if: inputs.ui-tests needs: instrumentation runs-on: ubuntu-24.04 timeout-minutes: 5 diff --git a/README.md b/README.md index 672d2fa..deb2a31 100644 --- a/README.md +++ b/README.md @@ -65,7 +65,10 @@ python3 scripts/check-ui-screenshots.py ``` Gradle downloads the emulator image for the host architecture. The first run can take several minutes. -CI runs the full `androidTest` suite across three parallel runners, without a class or method filter. +CI does not run the UI tests on pull requests or main pushes, because emulator failures were unreliable. +To run them, start the CI workflow manually and select **Run the emulator UI tests**: +`gh workflow run ci.yml -f ui-tests=true`. +A manual run executes the full `androidTest` suite across three parallel runners, without a class or method filter. AndroidJUnitRunner assigns each test to one shard with `numShards=3` and `shardIndex=0`, `1`, or `2`. CI caches the SDK, emulator, and system image. Each runner creates its own managed AVD; snapshots are not shared between hosts. New main pushes cancel older main runs. Pull request runs use separate groups.