Skip to content

test(mcp): live read/write/negative MCP e2e in CI#133

Merged
lance0 merged 1 commit into
masterfrom
test/mcp-live-e2e-ci
Jun 29, 2026
Merged

test(mcp): live read/write/negative MCP e2e in CI#133
lance0 merged 1 commit into
masterfrom
test/mcp-live-e2e-ci

Conversation

@lance0

@lance0 lance0 commented Jun 29, 2026

Copy link
Copy Markdown
Owner

Wires the local MCP write path into CI so it can't silently regress — the live counterpart to the manual e2e we just ran by hand.

What

  • Extracts the stdio JSON-RPC ServeChild harness from mcp_serve_tests.rs into tests/support/serve.rs (spawn / send / read_response / handshake / call / tool_payload / tool_error), now shared by the offline tests and the new live tests — no duplication. mcp_serve_tests.rs is refactored to use it (unchanged behavior; both offline tests still pass).
  • Adds three #[ignore] live tests to tests/it_netbox.rs, driving the real nbox serve stdio transport against the seeded NetBox:
    • mcp_read_returns_live_data — handshake + nbox_status + nbox_get device ci-dev1.
    • mcp_local_write_reserves_ip_and_verifiesnbox serve --local-writes plans and applies an IP reservation in 10.10.1.0/24 under the profile token (HTTP 201), then reads the new IP back through MCP to confirm the mutation landed.
    • mcp_write_refused_without_local_writes — a plain stdio server refuses the write with a local_writes message (the opt-in gate).

CI placement

The netbox-integration 4.2 and 4.6 lanes already run cargo test --test it_netbox -- --ignored (with --skip filters my tests don't match), so they pick these up automatically — no workflow change.

Verification (local, against the seeded fixture)

  • Full live it_netbox ignored suite: 25 passed, 0 failed (my 3 + the existing 22, fresh seed → no interference).
  • Offline mcp_serve_tests: 2 passed (harness extraction is behavior-preserving).
  • fmt + clippy (--all-targets --all-features) clean.

… lane

Wire the local MCP write path into CI so it can't silently regress. Extract the
stdio JSON-RPC ServeChild harness into tests/support/serve.rs (now shared by the
offline mcp_serve_tests and the new live tests — no duplication), and add three
#[ignore] live tests to it_netbox.rs:

- mcp_read_returns_live_data — handshake + nbox_status + nbox_get device.
- mcp_local_write_reserves_ip_and_verifies — `nbox serve --local-writes` plans
  and applies an IP reservation under the profile token, then reads the new IP
  back to confirm the mutation landed.
- mcp_write_refused_without_local_writes — a plain stdio server refuses the write.

The netbox-integration 4.2 and 4.6 lanes already run `cargo test --test it_netbox
-- --ignored`, so they pick these up with no workflow change. The full live suite
(25 tests) and the offline mcp_serve_tests both pass locally.
@lance0 lance0 merged commit b050ff7 into master Jun 29, 2026
17 checks passed
@lance0 lance0 deleted the test/mcp-live-e2e-ci branch June 29, 2026 14:04
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