Skip to content

test(e2e): reusable phone-mirror test setup and baseline specs - #26412

Merged
Jinwoo-H merged 3 commits into
mainfrom
test/paired-mobile-e2e-harness
Oct 11, 2026
Merged

Jinwoo-H merged 3 commits into
mainfrom
test/paired-mobile-e2e-harness

Conversation

@Jinwoo-H

@Jinwoo-H Jinwoo-H commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 6 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​346 $\color{#cf222e}{\Huge{\mathbf{−}}}$​1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​345
Prod 0 0 0 0

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 serve host and, when the phone pairs with the desktop, an Electron desktop
    paired to it. It returns { host, desktop, phone, dispose }.
    • One cleanup stack tears down phone, then desktop, then host, including when startup fails.
    • Teardown errors are attached to the test, so they never hide the test's own failure.
  • tests/e2e/helpers/paired-mobile-client.ts: pairMobileClient(offer) is a phone client with
    request / call / subscribe / dispose. It uses the phone app's real capability list over the
    same 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-pairing flag. createDesktopMobilePairingOffer uses the desktop's real Settings path.
  • Two specs:
    • Restart: a phone paired with orca serve keeps a terminal created by terminal.create across a
      serve 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.
    • Baseline: a phone paired with a desktop lists the desktop's own workspace but not a workspace
      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.create terminal is missing from
    the 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.ts files in the electron-headless project, so CI shards them as
    usual. They need no Docker and no Relay.

Notes

  • A host started with phone pairing offers only a phone pairing, so a desktop can't also pair to that
    same host. This is documented on the option.
  • Each phone request opens a fresh connection, and subscriptions don't reconnect after a host restart.
    This is documented in the helper.

… 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
@coderabbitai

coderabbitai Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 69c1c941-e385-44f7-9888-5e778945cd75
📥 Commits

Reviewing files that changed from the base of the PR and between 4f4f021 and 6e8dc3b.

📒 Files selected for processing (6)
  • tests/e2e/helpers/headless-paired-runtime-host.ts
  • tests/e2e/helpers/paired-electron-client.ts
  • tests/e2e/helpers/paired-mobile-client.ts
  • tests/e2e/helpers/phone-mirror-topology.ts
  • tests/e2e/paired-mobile-desktop-mirror-baseline.spec.ts
  • tests/e2e/paired-mobile-serve-restart-terminal-tabs.spec.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The 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 6e8dc

The pairing helpers and baseline tests have no established issue that needs correction before merging.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 11.11% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 9 functions across 6 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the reusable end-to-end phone-mirror test setup and baseline specifications, which matches the main changes.
Description check ✅ Passed The description is mostly complete. It explains the purpose, changes, rationale, testing, maintainer exception for the linked issue, and why visual proof is not applicable. The Review section and chec…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Jinwoo-H
Jinwoo-H merged commit 4c4f1ee into main Oct 11, 2026
44 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.

1 participant