refactor(cua-driver): test taxonomy + protocol split/dedup + transport coverage (Phases 3-6) - #2043
Conversation
…sport test (Phases 3-6) Phase 3 — rename tests into a 4-family taxonomy (git mv, blame preserved): protocol_ / transport_ / harness_ / modality_ / guard_. harness_web_windows→harness_web, harness_lo_vcl→harness_libreoffice, harness_bg_modality→modality_background, harness_desktop_scope→modality_desktop_scope, focus_check→modality_focus, e2e_windows_bg_input→modality_input_e2e, ux_guard→guard_ux, element_token→protocol_element_token. Phase 5 — split mcp_protocol_test (3,412 lines / 65 tests) into 5 protocol_*_test files (handshake/tools_call/schema/media/session) on a new testkit RawDriver (raw send/recv, no auto-init). Deduped 24 macOS↔Windows mirror pairs into single cfg!-branching tests; 13 mac-only + 4 win-only kept. All 40 macOS protocol tests pass post-split. Phase 4 — add transport_config_persistence_test: set_config persists to disk across stateless CLI invocations (#2034) vs visible within an MCP session — the one behavior only observable across both transports. Phase 6 — rewrite TEST_SUITE.md / TEST_HARNESS_STRUCTURE.md to the new names + a transport × modality × platform coverage matrix. Deferred (noted): merging modality_input_e2e ↔ modality_background, and extracting the focus-steal sentinel into a shared testkit assert. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…unning them The old mcp_protocol Windows mirror asserted serverInfo.name="cua-driver-rs" and a roster with type_text_chars+screenshot — both stale (the Windows mirror had never actually run). The live Windows server returns name="cua-driver" and registers neither extra tool. Drop the bogus platform branches; the macOS values are correct for both. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
… running Running the split suite on Windows surfaced three never-run stale assertions: - schema: the Windows server has no type_text_chars tool (hidden on both platforms), so merge the two type_text_chars schema tests into one. - media set_config_screenshot_resize: skip the resize assertion when the screenshot is unavailable (Session 0 / no display) on BOTH platforms, not just macOS. - session multi_cursor: Windows get_agent_cursor_state returns ALL cursors (macOS scopes to one); verify each cursor's state within the full list. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughAdds ChangesCUA driver protocol coverage
Sequence Diagram(s)sequenceDiagram
participant protocol_handshake_test
participant RawDriver
participant "cua-driver binary" as cua_driver_binary
protocol_handshake_test->>RawDriver: spawn()
RawDriver->>cua_driver_binary: start child with piped stdin/stdout
protocol_handshake_test->>RawDriver: send initialize request
RawDriver->>cua_driver_binary: write newline-delimited JSON-RPC frame
cua_driver_binary-->>RawDriver: stdout response line
RawDriver-->>protocol_handshake_test: parsed JSON Value
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
Linux visual regression artifactsMatrix jobs now run independently. Download visual artifacts from this workflow run.
|
Final phase of the test-suite cleanup (Phases 1-2 = #2039, #2040). Bundles the rename, protocol split+dedup, the transport-coverage test, and the docs.
Phase 3 — 4-family taxonomy (git mv, blame preserved)
protocol_/transport_/harness_/modality_/guard_. Sols tests/reads as a map. Renames:harness_web_windows→harness_web,harness_lo_vcl→harness_libreoffice,harness_bg_modality→modality_background,harness_desktop_scope→modality_desktop_scope,focus_check→modality_focus,e2e_windows_bg_input→modality_input_e2e,ux_guard→guard_ux,element_token→protocol_element_token. No CI/scripts referenced the old names (they just runcargo test); the two docs are updated in Phase 6.Phase 5 — split + dedup the protocol monolith
mcp_protocol_test.rs(3,412 lines / 65 tests) → 5protocol_*_test.rsfiles (handshake / tools_call / schema / media / session) on a new testkitRawDriver(raw send/recv, no auto-init — these tests drive the handshake themselves). 24 macOS↔Windows mirror pairs deduped into singlecfg!-branching tests.Running the deduped suite surfaced 5 never-run stale Windows assertions (the old Windows mirror had never actually executed):
serverInfo.nameasserted"cua-driver-rs"; the server returns"cua-driver".type_text_chars+screenshot; Windows registers neither.type_text_charsschema test assumed Windows exposes the tool; it's hidden on both platforms.set_config_screenshot_resizeasserted unconditionally; now skips when a screenshot is unavailable (Session 0 / no display) on both platforms.multi_cursorassumedget_agent_cursor_statefilters to one cursor; on Windows it returns all — verify each cursor's state within the list.All fixed to match real behavior. Result: 37 protocol tests pass on macOS, 28 on Windows — the first time the Windows protocol tests have actually passed.
Phase 4 — transport coverage
New
transport_config_persistence_test:set_configpersists to disk across stateless CLI invocations (#2034) vs visible within an MCP session — the one behavior only observable across both transports.Phase 6 — docs
Rewrote
TEST_SUITE.md/TEST_HARNESS_STRUCTURE.mdto the new names + a transport × modality × platform coverage matrix.Verification
protocol_*tests run + pass (37).protocol_*tests run + pass (28).#[ignore]suites (harness/modality/guard/transport) compile on both; live--ignoredbehavior unchanged.Deferred (noted, not done)
modality_input_e2e↔modality_background.🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Bug Fixes
Documentation