test(e2e): add real rust-analyzer e2e test suite covering all 16 MCP tools#125
Merged
Conversation
…tools Introduces ra_e2e.rs — a single-driver integration test that spawns a real rust-analyzer process against the rust_workspace fixture and exercises all 16 MCP tools end-to-end through the mcpls bridge. Key design decisions: - Single #[test] fn ra_e2e_suite() so nextest amortises rust-analyzer cold start - Required by default; opt-out with MCPLS_SKIP_RA=1 for MSRV/minimal CI jobs - Per-suite TempDir fixture copy prevents cross-binary cache contention - Sub-cases collected and aggregated: one failure does not mask others - find_line() helper eliminates hardcoded line numbers in fixture lookups - MCPLS_RA_FILTER env var for running individual sub-cases locally Bridge fixes uncovered during testing: - translator.rs: handle_rename now processes documentChanges (not just changes) - mcp/server.rs: CallHierarchyItemResult fields renamed to camelCase via serde - lsp/lifecycle.rs: always create internal notification channel in spawn() New test infrastructure: - tests/common/ra_probe.rs: rust-analyzer binary discovery - tests/common/assertions.rs: file_uri, content_text, assert_tool_ok helpers - tests/fixtures/rust_workspace/extras/: broken.rs and bad_format.rs fixtures - tests/fixtures/golden/bad_format.fmt.rs: pinned rustfmt golden output
This was referenced Apr 29, 2026
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.
Summary
tests/ra_e2e.rs— a single-driver integration test that spawns a realrust-analyzerprocess and exercises all 16 MCP tools end-to-end through the mcpls bridgehandle_renamenow processesdocumentChanges, andCallHierarchyItemResultfields use camelCase serde renamesra_probe.rs,assertions.rs) and stable fixture surfaceDesign
#[test]: nextest sees one test per binary → rust-analyzer spawned once; sub-cases run sequentially and collected; one failure does not mask othersMCPLS_SKIP_RA=1for MSRV/minimal CI jobsTempDircopy prevents cross-binary rust-analyzer cache contention (also eliminatestarget//Cargo.lockpollution from fixture dir)find_line()helper: eliminates hardcoded line numbers; positions derived from fixture contentTest plan
cargo nextest run --workspace --all-features --test ra_e2ewith rust-analyzer in PATH — all 16 sub-cases passMCPLS_SKIP_RA=1 cargo nextest run --workspace --all-features --test ra_e2e— prints skip line, exits 0cargo nextest run --workspace --all-features --lib --bins— 380 tests pass, no regressionscargo +nightly fmt --all -- --check— cleancargo clippy --all-targets --all-features --workspace -- -D warnings— clean