Skip to content

[build-tools] Add direct DADB mode for Maestro tests - #4163

Draft
sjchmiela wants to merge 4 commits into
mainfrom
stanley/maestro-dadb-connection-mode
Draft

[build-tools] Add direct DADB mode for Maestro tests#4163
sjchmiela wants to merge 4 commits into
mainfrom
stanley/maestro-dadb-connection-mode

Conversation

@sjchmiela

Copy link
Copy Markdown
Contributor

Summary

  • Add an opt-in android_connection_mode input to eas/maestro_tests.
  • Keep adb as the default and support dadb for direct Android device connections.
  • Stop and hide the ADB server only while Maestro runs. Restore it for later recording and log collection.
  • Validate the mode and reject direct DADB mode on iOS.

Why

Maestro uses DADB, but DADB first uses or starts the local ADB server. Some Android Maestro runs fail when the ADB server loses the emulator connection and leaves the device offline. This mode lets selected jobs bypass the ADB server and connect directly to adbd. Existing jobs keep the current behavior.

Implementation

In dadb mode, the step:

  1. Stops the ADB server with the original environment.
  2. Places an executable failing adb shim first in Maestro's PATH.
  3. Uses that environment for every Maestro retry.
  4. Removes the shim and makes a best-effort ADB restart in finally.

Cleanup failures do not replace the Maestro result.

Validation

  • yarn workspace @expo/build-tools typecheck
  • yarn workspace @expo/build-tools jest-unit --runInBand (104 suites, 987 tests)
  • yarn fmt:check
  • yarn lint (0 errors; 14 unrelated existing warnings)

@codecov

codecov Bot commented Aug 7, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.30769% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 62.50%. Comparing base (2a062db) to head (42b1ffa).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...es/build-tools/src/steps/functions/maestroTests.ts 92.31% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4163      +/-   ##
==========================================
+ Coverage   62.50%   62.50%   +0.01%     
==========================================
  Files        1008     1008              
  Lines       45815    45827      +12     
  Branches     9256     9652     +396     
==========================================
+ Hits        28630    28641      +11     
+ Misses      17058    15725    -1333     
- Partials      127     1461    +1334     

☔ 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.

@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown

❌ It looks like a changelog entry is missing for this PR. Add it manually to CHANGELOG.md.
⏩ If this PR doesn't require a changelog entry, such as if it's an internal change that doesn't affect the user experience, you can add the "no changelog" label to the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant