Skip to content

feat(android-tests): interactive UI on direct launch, headless under instrumentation#478

Merged
wmathurin merged 2 commits into
forcedotcom:devfrom
wmathurin:android-tests-interactive-mode
Jul 7, 2026
Merged

feat(android-tests): interactive UI on direct launch, headless under instrumentation#478
wmathurin merged 2 commits into
forcedotcom:devfrom
wmathurin:android-tests-interactive-mode

Conversation

@wmathurin

Copy link
Copy Markdown
Contributor

Problem

After #473 landed, the test app always mounts HeadlessTestApp — a blank screen that just runs the suite and emits logcat sentinels. There was no way to run a single test manually without editing code and rebuilding.

Fix

MainActivity.getMainComponentName() now detects whether it is running under Android instrumentation by attempting to resolve InstrumentationRegistry via reflection:

  • Under connectedAndroidTest: the test APK and app APK share a classloader, so InstrumentationRegistry is resolvable → mounts HeadlessTestApp (headless CI behaviour unchanged).
  • Direct launch (Android Studio, icon tap, adb shell am start without extras): the test runner is absent → ClassNotFoundException → mounts TestApp (the interactive per-test UI).

No extras or flags required. No change to the CI workflow or BaseReactNativeTest.

Validation

  • connectedAndroidTest (full suite): 35/35 pass, same as before
  • Direct launch from Android Studio and via adb shell am start: shows the interactive TestApp UI with per-test Run buttons

…under instrumentation

Direct launches (Android Studio, icon tap, adb without extras) now mount
TestApp so individual tests can be tapped and run one at a time.
connectedAndroidTest still mounts HeadlessTestApp: the test APK and app
APK share a classloader under instrumentation, so InstrumentationRegistry
is resolvable; ClassNotFoundException on a direct launch routes to
interactive mode instead.
@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown
TestsPassed ✅SkippedFailed
iOS ^18 Test Results35 ran35 ✅
TestResult
No test annotations available

…try; raise MobileSync timeout

The xcscheme had SalesforceReactTests listed twice — once with
parallelizable=YES and once without. Xcode ran both, spawning two
simulator clones that hit the same org concurrently and raced each
other's mutations (creates, deletes, syncs), causing widespread
non-deterministic failures on CI.

Also raises ReactMobileSyncTests.testTimeoutSeconds from 60s to 120s;
testCleanResyncGhosts was timing out at 111s on CI.
@wmathurin
wmathurin requested a review from brandonpage July 6, 2026 22:51
@wmathurin
wmathurin merged commit b71beb4 into forcedotcom:dev Jul 7, 2026
7 checks passed
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.

2 participants