Repository navigation
test(e2e): reusable phone-mirror test setup and baseline specs - #26412
Conversation
… specs Later phone-mirror slices need one oracle that drives a real mobile-scoped device with the phone's own capabilities against a serve host or a paired desktop. Pins #26022 across a serve restart and today's gap: a desktop's phone does not list the desktop's server workspaces. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
Slices need one composer for host, desktop and phone with a single teardown, so specs stop copying setup. The serve-restart spec now reads the first tab-stream snapshot after the cold start, which is what the phone builds its tab strip from. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
Teardown failures become a test attachment instead of replacing the real failure, and the cold-snapshot poll reports stream errors together with the PTY list. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (6)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe change adds a mobile pairing scope to the headless paired-runtime host and adds helpers for requesting and using mobile pairing offers. A topology helper starts the host, optionally starts a desktop client, and pairs the phone with the selected offer. Two end-to-end tests cover workspace visibility and terminal tabs across a serve restart. Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to The pairing helpers and baseline tests have no established issue that needs correction before merging. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
ELI5
This adds a reusable test setup for the "phone mirrors its paired computer" work. A test can start an
Orca server, a desktop connected to it, and a phone, then check what the phone sees. It also adds two
starting tests built on it.
What Changed
Test-only. No product code changes.
tests/e2e/helpers/phone-mirror-topology.ts:launchPhoneMirrorTopology({ phoneTo: 'desktop' | 'host' }, testInfo)starts a headless
orca servehost and, when the phone pairs with the desktop, an Electron desktoppaired to it. It returns
{ host, desktop, phone, dispose }.tests/e2e/helpers/paired-mobile-client.ts:pairMobileClient(offer)is a phone client withrequest/call/subscribe/dispose. It uses the phone app's real capability list over thesame encrypted remote-runtime client. It refuses any offer that isn't phone-scoped, so a test can't
silently run with full desktop access.
launchHeadlessPairedRuntimeHost({ pairingScope: 'mobile' }): uses serve's existing--serve-mobile-pairingflag.createDesktopMobilePairingOfferuses the desktop's real Settings path.orca servekeeps a terminal created byterminal.createacross aserve restart, on both the first subscription snapshot and the tab list. It guards the fix in fix(serve): keep every terminal on the phone after orca serve restarts #26022.
on a server the desktop is connected to. This pins today's behaviour; the remote-workspaces change will
flip it.
Why
The upcoming changes that let the phone see a desktop's remote servers need one easy way to stand up
all three parties and check what the phone actually gets. Writing it once keeps each later PR small and
gives every change a rerunnable check. This reuses the existing host and desktop helpers rather than
adding new launch paths.
Linked Issue
N/A (maintainer)
Visual Proof
N/A. Tests only.
Testing
I manually tested these changes locally
Automated tests added/updated, or explained why not below
On macOS, both specs pass:
2 passed (8.5s).The restart spec fails with the fix(serve): keep every terminal on the phone after orca serve restarts #26022 fix reverted: the
terminal.createterminal is missing fromthe first snapshot after the restart.
The baseline's "not listed" check was shown to fail when the server's workspace is present.
Both are plain
tests/e2e/*.spec.tsfiles in theelectron-headlessproject, so CI shards them asusual. They need no Docker and no Relay.
Notes
same host. This is documented on the option.
This is documented in the helper.