Skip to content

Collect staged Android emulator logs - #3628

Closed
sjchmiela wants to merge 15 commits into
stanley/eng-20762-stage-emulator-logcatfrom
stanley/eng-20762-collect-emulator-logcat
Closed

Collect staged Android emulator logs#3628
sjchmiela wants to merge 15 commits into
stanley/eng-20762-stage-emulator-logcatfrom
stanley/eng-20762-collect-emulator-logcat

Conversation

@sjchmiela

@sjchmiela sjchmiela commented Apr 23, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add eas/collect_emulator_logs to find staged emulator-native Logcat files under the fixed staging parent
  • copy each file with its unique mkdtemp directory name into the destination directory
  • run the collection step for Android Maestro function groups before uploading ~/.maestro/tests
  • keep missing or unreadable staged logs non-fatal
  • verify capture and collection with a real emulator across an ADB server restart

Why

Live logs stay under <buildLogsDirectory>/android-emulator-logcat while tests run. Each emulator start writes to <deviceName>-XXXXXX/logcat.log. The collection step scans that stable parent recursively and copies a snapshot into the Maestro artifact directory only when the workflow is ready to upload it. This avoids an artifact tar operation racing with the emulator-owned output file.

Test plan

  • yarn workspace @expo/build-tools test --runInBand
  • yarn workspace @expo/build-tools jest-integration src/steps/functions/__integration-tests__/collectEmulatorLogs.test.ts --runInBand
  • yarn typecheck
  • yarn lint
  • yarn fmt:check

@linear

linear Bot commented Apr 23, 2026

Copy link
Copy Markdown

@codecov

codecov Bot commented Apr 23, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 78.26087% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 62.61%. Comparing base (7903f38) to head (d94324e).

Files with missing lines Patch % Lines
...d-tools/src/steps/functions/collectEmulatorLogs.ts 75.61% 10 Missing ⚠️
Additional details and impacted files
@@                             Coverage Diff                             @@
##           stanley/eng-20762-stage-emulator-logcat    #3628      +/-   ##
===========================================================================
+ Coverage                                    62.55%   62.61%   +0.06%     
===========================================================================
  Files                                         1008     1009       +1     
  Lines                                        45827    45873      +46     
  Branches                                      9649     9653       +4     
===========================================================================
+ Hits                                         28664    28720      +56     
+ Misses                                       15705    15695      -10     
  Partials                                      1458     1458              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@sjchmiela
sjchmiela force-pushed the stanley/eng-20762-stage-emulator-logcat branch from 93e6a3d to 7945c7d Compare April 23, 2026 15:51
@sjchmiela
sjchmiela force-pushed the stanley/eng-20762-collect-emulator-logcat branch from 0ac40a4 to ce5ca73 Compare April 23, 2026 15:53
@sjchmiela
sjchmiela force-pushed the stanley/eng-20762-stage-emulator-logcat branch from 7945c7d to 6c0f797 Compare April 23, 2026 15:56
@sjchmiela
sjchmiela force-pushed the stanley/eng-20762-collect-emulator-logcat branch 2 times, most recently from 8f7e23d to fc6c828 Compare April 23, 2026 16:42
@sjchmiela sjchmiela added the no changelog PR that doesn't require a changelog entry label Apr 23, 2026
@sjchmiela
sjchmiela force-pushed the stanley/eng-20762-stage-emulator-logcat branch from 30529e4 to 018642b Compare August 7, 2026 16:53
@sjchmiela
sjchmiela force-pushed the stanley/eng-20762-collect-emulator-logcat branch from f0cc102 to 5bcbee1 Compare August 7, 2026 16:53
@sjchmiela
sjchmiela force-pushed the stanley/eng-20762-collect-emulator-logcat branch from 5bcbee1 to 070d76b Compare August 7, 2026 17:08
@sjchmiela
sjchmiela force-pushed the stanley/eng-20762-collect-emulator-logcat branch from 070d76b to d94324e Compare August 7, 2026 17:27
@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown

⏩ The changelog entry check has been skipped since the "no changelog" label is present.

@sjchmiela
sjchmiela force-pushed the stanley/eng-20762-stage-emulator-logcat branch from 7903f38 to c9deda0 Compare August 7, 2026 20:27
@sjchmiela

Copy link
Copy Markdown
Contributor Author

Superseded by #4164 and the updated #3627. Emulator logs are now uploaded as a separate artifact, so the collect-emulator-logs function and PR are no longer needed.

@sjchmiela sjchmiela closed this Aug 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no changelog PR that doesn't require a changelog entry

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant