test(mcp): live read/write/negative MCP e2e in CI#133
Merged
Conversation
… 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
ServeChildharness frommcp_serve_tests.rsintotests/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.rsis refactored to use it (unchanged behavior; both offline tests still pass).#[ignore]live tests totests/it_netbox.rs, driving the realnbox servestdio transport against the seeded NetBox:mcp_read_returns_live_data— handshake +nbox_status+nbox_get device ci-dev1.mcp_local_write_reserves_ip_and_verifies—nbox serve --local-writesplans and applies an IP reservation in10.10.1.0/24under 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 alocal_writesmessage (the opt-in gate).CI placement
The
netbox-integration4.2 and 4.6 lanes already runcargo test --test it_netbox -- --ignored(with--skipfilters my tests don't match), so they pick these up automatically — no workflow change.Verification (local, against the seeded fixture)
it_netboxignored suite: 25 passed, 0 failed (my 3 + the existing 22, fresh seed → no interference).mcp_serve_tests: 2 passed (harness extraction is behavior-preserving).--all-targets --all-features) clean.