fix(e2e): capture logcat and screenshots when Android E2E fails - #466
Open
KisaneNeko wants to merge 2 commits into
Open
KisaneNeko wants to merge 2 commits into
KisaneNeko wants to merge 2 commits into
Conversation
Android's Detox config had no `artifacts` section, so every plugin sat at Detox's all-off defaults (log: 'none', screenshot: 'manual'). Both iOS configs opt in via the shared getDetoxArtifactsConfig() helper; Android was the only one that never did. The result: an Android E2E failure produced no logcat, no screenshot and nothing to upload — see run 33749895553, where the upload step logged "No files were found with the provided path: apps/AndroidApp/artifacts". Reuse the shared helper, with video disabled. On iOS Detox records host-side via `simctl io recordVideo` (note the helper's iOS-only video.simulator.codec key); on Android it would be `adb shell screenrecord` writing into the emulator userdata partition that this action already documents as ENOSPC-prone. A unit test locks video off for Android and asserts the shared helper still has it on, so iOS cannot regress. The helper writes to e2e-artifacts/, so the upload path, if-no-files-found and retention-days now match appleapp-road-test, and .gitignore matches AppleApp and RNApp. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
KisaneNeko
force-pushed
the
ci/android-e2e-diagnostics
branch
from
September 15, 2026 12:24
ed351c2 to
c66cf6f
Compare
KisaneNeko
marked this pull request as ready for review
September 15, 2026 12:26
hurali97
approved these changes
Sep 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
While investigating the Expo 56 Android E2E failure in run 33749895553, I went looking for a screenshot or logcat to see what the app was doing. There weren't any. The upload step had quietly logged:
The cause:
detox-rc-androidapp-emulator-release.cjshas noartifactssection, so every plugin sits at Detox's all-off defaults (log: 'none',screenshot: 'manual'). Both iOS configs opt in via the sharedgetDetoxArtifactsConfig()helper — Android was the only one that never did. So no Android E2E failure has ever produced any evidence, on any flavour.Why this makes the Expo 56 bug hard to debug
All we get from that run is the test's own message:
The app process had started. So the greeting either never rendered, or the app crashed, or it ANR'd, or the activity never reached the foreground — and there's no way to tell which, because nothing was recorded.
The timing makes that gap especially frustrating. In the Expo 57 job of the same run, the greeting appeared 3.9 seconds after the wait began. On Expo 56 it never appeared in 90 seconds. That's not a marginal timeout — it looks like a genuine app-side failure. But without logcat we can't say whether it was a crash, an ANR, or something else, so it's been written off as flakiness.
What changes
This just applies the existing iOS pattern to Android:
detox-rc-androidapp-emulator-release.cjsnow doesartifacts: getDetoxArtifactsConfig(), the same call both iOS configs already make. A failing test leaves a logcat and abeforeAllFailure.png.e2e-artifacts/, so the upload path,if-no-files-foundandretention-daysnow matchappleapp-road-test, and.gitignorematches AppleApp and RNApp.One deliberate deviation: video is disabled on Android. On iOS Detox records host-side via
simctl io recordVideo(note the helper's iOS-onlyvideo.simulator.codeckey). On Android it would beadb shell screenrecordwriting into the emulator's userdata partition — the one this action already warns about: "Do not set disk-size — a large userdata partition fails when the runner is low on disk after Gradle/NDK builds." A unit test locks video off for Android and asserts the shared helper still has it on, so iOS can't regress.No test behaviour changes — no timeouts, retries or waits touched. iOS is untouched.
Testing
Ran the Android Detox suite locally on
Pixel_4_API_34(same API level as CI), using the Expo 57 flavour since it shares this exact config factory:e2e-artifacts/correctly left empty (keepOnlyFailedTestsArtifacts).beforeAllFailure.png,detox.logand logcat — about 1 MB, no video.yarn test:apps9/9,yarn lintclean. Theaction.ymlchange is validated by inspection and a YAML parse only; it has not been exercised by a CI run yet.🤖 Generated with Claude Code