fix(apple): keep runner bridge test hooks out of the shipped package

Merged
TH
5h ago
+46-17

Summary

Unblocks every npm release. The Release Build job fails packing (run 42221831651): #4256 added an #if defined(AGENT_DEVICE_RUNNER_UNIT_TESTS) block with RunnerSnapshotBridgeReadForTest / RunnerSnapshotBridgeDrainForTest to the shipped RunnerSnapshotBridge.m. The packager strips that macro's blocks from Swift only, so it survived and check-package rejected the tarball.

  • Moves the two hooks to AgentDeviceRunnerUITests/UnitTests/RunnerSnapshotBridgeTesting.m (the package omits UnitTests/), following RunnerEdgeContactTesting.m.
  • Exposes RunnerSnapshotBridgeRead and RunnerSnapshotBridgeReaderQueue through a private UnitTests/RunnerSnapshotBridge+Internal.h, the same pattern as RunnerAXSnapshotBridge+Internal.h. They lose static; nothing else changes.
  • The synchronized group adds the new .m to the UITests target; the existing bridging header still imports RunnerSnapshotBridgeTesting.h.
  • 3 files. check-package.ts and shipped-test-code.ts are unchanged.

Validation

Release Build pack steps (pnpm build:package && pnpm check:package -- --pack-destination .tmp/release, ANDROID_HOME set):

  • Base a68693c72e: fails with the same RunnerSnapshotBridge.m: names AGENT_DEVICE_RUNNER_UNIT_TESTS error.
  • Head d3b161d63b: passes. All four runner platforms build, and the log reports "Confirmed no test code in the 806 packed files."

iOS runner built with AGENT_DEVICE_XCUITEST_INCLUDE_UNIT_TESTS=1. 5 bridge tests ran on an iPhone 17 Pro Max simulator, with 0 failures. They include testAbandonedReadBecomesWedgedUntilItReturns, which calls both hooks.

pnpm check:affected --run --head d3b161d63b: passed, exactCommit=true (receipt run-pOCngB). Swift runner lanes are GitHub-authoritative.

🤖 Generated with Claude Code


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.