Repository navigation
test(e2e): mixed-version, two-client and phone layout baselines recorded on main - #27688
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ⬇️ Low Merge Risk: 🔵 Low · up to The new test helpers retain a bounded socket-timeout risk and a packaged-launch configuration-rule violation. These are localized test-infrastructure issues; the packaged client remains windowless in the normal headless configuration. Pre-merge checks |
|
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
4e3bd3f5-08aa-4b6f-9964-70db9a10f6d9
📒 Files selected for processing (14)
.github/actions/download-pinned-orca-release/action.yml.github/workflows/packaged-browser-e2e.ymlconfig/scripts/record-layout-compat-baselines.mjstests/e2e/helpers/layout-compat-baseline.tstests/e2e/helpers/packaged-old-orca.tstests/e2e/helpers/paired-mobile-client.tstests/e2e/layout-compat-baselines.jsontests/e2e/layout-compat-new-desktop-on-old-server.spec.tstests/e2e/layout-compat-old-desktop-on-new-server.spec.tstests/e2e/layout-compat-old-phone-on-new-server.spec.tstests/e2e/layout-compat-serve-restart-keeps-at-at-terminals.spec.tstests/e2e/packaged-mixed-version-browser-placement.spec.tstests/e2e/paired-mobile-desktop-tab-composition.spec.tstests/e2e/workspace-layout-oracle.spec.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
| send: (id, method, params, executionHost) => | ||
| void socket.send( | ||
| JSON.stringify({ | ||
| id, | ||
| deviceToken: pairing.deviceToken, | ||
| method, | ||
| params, | ||
| ...(executionHost ? { executionHost } : {}) | ||
| }) | ||
| ), |
There was a problem hiding this comment.
🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win
Make a dropped socket send fail the test immediately.
socket.send returns false when the socket is not ready or not open. The void operator discards that result. If the socket closes, send writes nothing, and call in the spec polls for 30 seconds before it reports a misleading "toBeDefined" timeout. onClose is also a no-op, so the helper never records the close. Throw when send returns false. This turns a timeout into a clear transport error.
Proposed fix
--- "a/tests/e2e/helpers/paired-mobile-client.ts"
+++ "b/tests/e2e/helpers/paired-mobile-client.ts"
@@ -110,16 +110,20 @@
open.add(socket)
return {
frames,
- send: (id, method, params, executionHost) =>
- void socket.send(
+ send: (id, method, params, executionHost) => {
+ const sent = socket.send(
JSON.stringify({
id,
deviceToken: pairing.deviceToken,
method,
params,
...(executionHost ? { executionHost } : {})
})
- ),
+ )
+ if (sent === false) {
+ throw new Error(`Phone socket closed; could not send ${method}`)
+ }
+ },
close: () => socket.close()
}
},📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| send: (id, method, params, executionHost) => | |
| void socket.send( | |
| JSON.stringify({ | |
| id, | |
| deviceToken: pairing.deviceToken, | |
| method, | |
| params, | |
| ...(executionHost ? { executionHost } : {}) | |
| }) | |
| ), | |
| send: (id, method, params, executionHost) => { | |
| const sent = socket.send( | |
| JSON.stringify({ | |
| id, | |
| deviceToken: pairing.deviceToken, | |
| method, | |
| params, | |
| ...(executionHost ? { executionHost } : {}) | |
| }) | |
| ) | |
| if (sent === false) { | |
| throw new Error(`Phone socket closed; could not send ${method}`) | |
| } | |
| }, |
…unds, Linux-only baselines
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to GitHub limitations.
🟡 Minor · Set background mode for the packaged desktop launch. · packaged-old-orca.ts:100-105
tests/e2e/helpers/packaged-old-orca.ts:100-105
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winSet background mode for the packaged desktop launch.
This direct
electron.launch()setsORCA_E2E_HEADLESS, but it does not explicitly setORCA_BACKGROUND_LAUNCH: '1'. Add that variable to the launch environment so background checks retain the required no-reveal policy. As per coding guidelines, “A rawelectron.launch()outside those helpers must pass `ORCA_BACKGROUND_LAUNCH: '1'.”Source: Coding guidelines
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
12129a0a-9a74-4b27-8113-7190d501441f
📒 Files selected for processing (8)
.github/workflows/packaged-browser-e2e.ymltests/e2e/helpers/layout-compat-baseline.tstests/e2e/helpers/packaged-old-orca.tstests/e2e/layout-compat-baselines.jsontests/e2e/layout-compat-new-desktop-on-old-server.spec.tstests/e2e/layout-compat-old-desktop-on-new-server.spec.tstests/e2e/layout-compat-old-phone-on-new-server.spec.tstests/e2e/layout-compat-serve-restart-keeps-at-at-terminals.spec.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.
…l rows (#31127) #30037 made the headless row builder emit customTitle on every terminal row; the Linux baseline recorded before it (#27688) never listed the field, so the spec fails on main with either layout switch. Co-authored-by: E2E Test <[email protected]>
ELI5
Before we change how Orca stores and shares tab and pane layout, we write down exactly what today's build does when an older desktop, an older phone or an older command-line tool talks to a newer server (and a newer desktop talks to an older server). Later changes are then compared against these recordings, so any difference is visible and reviewed.
What Changed
Tests only; no app code changes.
tests/e2e/layout-compat-baselines.json: the recorded results. Ids are replaced with stable labels (tab1, leaf2,pty@@1for daemon terminals,ptyServe1for server-made ones) so the file only changes when behaviour changes.tests/e2e/helpers/layout-compat-baseline.ts: reduces what the server (tab list, live terminals, published layout) and each client report into those labelled shapes, and compares them with the file.config/scripts/record-layout-compat-baselines.mjscopies a run's observations into the file.terminal.createwith tab and leaf ids), close the new pane, server restart; and the released CLI'sterminal create.echo P3_RECONNECT_$((40+2))into the pane. It waits forP3_RECONNECT_42in the server's terminal output and drawn in that same desktop pane. The released desktop is set to draw terminals without the GPU, so its drawn rows can be read as text; the current desktop is read through its terminal's accessibility text.runtime_error"renderer_unavailable"); the baseline records that as today's behaviour.@@) survive a server restart beside a server-made one.feat/mobile-mirror-composition, usesphone-mirror-topology.ts).layout-compatjob in the same workflow. The existing packaged-client launcher moves from its spec intotests/e2e/helpers/packaged-old-orca.tsand gains a packaged headless server launcher and the packaged CLI.Why
The layout rework must keep old clients and old servers no worse than today. These recordings give each step of that work a fixed "today" to compare with. Reusing the existing packaged cross-version job, rather than a new harness, keeps one place that downloads and checks released builds.
Bugs found on main
Recorded by these baselines rather than fixed here. The serve-restart scenario lets the tab order vary only as far as the runs below showed.
Tab order changes when
orca serverestarts.Repro: start
orca serve; pair a desktop and open a workspace there (the desktop makes tab 1); runorca terminal create(tab 2); create one more withsession.tabs.createTerminal(tab 3); restart serve (stop it, start it on the same profile).Expected:
session.tabs.listand the published layout keep the order 1, 2, 3.Seen: repeated macOS runs listed the tabs as 1-2-3, 3-2-1, 1-3-2 and 2-3-1. The list's selected tab follows whichever comes first. The published layout showed 1-2-3 or 1-3-2. Spec:
tests/e2e/layout-compat-serve-restart-keeps-at-at-terminals.spec.ts.Titles given when a terminal is created are lost on a server restart, on main and on 1.4.224.
Repro: start
orca serve;orca terminal create --worktree path:<repo> --title host-made;orca terminal listshowshost-made; restart serve.Seen:
terminal.listreports the title as null, andsession.tabs.listnames the tab "Terminal 1". It is the same forcli-createdin the serve-restart scenario, and against a released 1.4.224 server innew-desktop-on-old-server. The baseline step "after server restart" shows it in https://github.com/stablyai/orca/actions/runs/38189026528 and https://github.com/stablyai/orca/actions/runs/38189031420.On macOS, a paired phone's terminals stay unlisted for at least 60 seconds after a server restart. Linux lists them again within seconds.
Repro (macOS): start
orca serve --serve-mobile-pairingand pair a phone; from the phone, create two terminals withsession.tabs.createTerminal; check thatterminal.listshows both; restart serve on the same profile and port.Seen:
session.tabs.liststill lists both tabs, butterminal.list(from the phone and from the host) stays empty for the 60 seconds measured, so the phone cannot close or address them. On Linux both terminals are listed again within seconds. Spec:tests/e2e/layout-compat-old-phone-on-new-server.spec.ts, step "phone reconnects after a server restart". Linux: https://github.com/stablyai/orca/actions/runs/38189879938. The macOS evidence comes from local dev-build runs, so this stays out of the baselines.How the layout stack uses this
Before each PR in the layout stack merges, dispatch
packaged-browser-e2e.ymlon that PR's branch (gh workflow run packaged-browser-e2e.yml --ref <branch>) and link a greenlayout-compatrun. That job runs all five scenarios and compares them with these baselines. A difference fails it, and the run'spackaged-layout-compatartifact holds the observed shapes. A change that moves a scenario on purpose re-records it withconfig/scripts/record-layout-compat-baselines.mjsin the same PR. The job also runs weekly. It has no pull-request trigger, so it does not run unless someone dispatches it.Platforms
Linux-only baselines; Windows not covered by P3. macOS has no baselines either. On macOS, in this harness, the old phone's terminals stayed unlisted for the 60 seconds measured after a server restart, while Linux lists them again within seconds. The serve-restart state on macOS also varied between runs. Released builds run only on Linux CI.
Linked Issue
Layout rework, pre-PR P3.
Visual Proof
N/A: tests and CI only, no app behaviour change.
Testing
Linux CI, from this branch's tests on main's code:
layout-compat5/5, browser placement 6/6).layout-compat(all five scenarios) and packaged browser placement, run twice before the drawn-echo check and group-selection fix: https://github.com/stablyai/orca/actions/runs/38189026528 and https://github.com/stablyai/orca/actions/runs/38189031420 (5/5 and 6/6 each, no retries).macOS (dev build only, hidden): composition and two-client oracle pass. The macOS runs of the phone and serve-restart specs are the evidence for the Platforms section. Released builds are never launched on macOS.
Review
Agent skill upstream boundary
Notes
Packaged-client capability checks now fail when a build reports no capability list. Before, an empty fallback let them pass without checking anything.
Checklist
N/Awith reason for visual proofpnpm typecheckand changed-code quality gate pass locally