Skip to content

test(e2e): add real rust-analyzer e2e test suite covering all 16 MCP tools#125

Merged
bug-ops merged 2 commits into
mainfrom
feat/issue-e2e-rust-analyzer
Apr 29, 2026
Merged

test(e2e): add real rust-analyzer e2e test suite covering all 16 MCP tools#125
bug-ops merged 2 commits into
mainfrom
feat/issue-e2e-rust-analyzer

Conversation

@bug-ops

@bug-ops bug-ops commented Apr 29, 2026

Copy link
Copy Markdown
Owner

Summary

  • Introduces tests/ra_e2e.rs — a single-driver integration test that spawns a real rust-analyzer process and exercises all 16 MCP tools end-to-end through the mcpls bridge
  • Fixes two bridge bugs discovered during testing: handle_rename now processes documentChanges, and CallHierarchyItemResult fields use camelCase serde renames
  • Adds shared test helpers (ra_probe.rs, assertions.rs) and stable fixture surface

Design

  • Single #[test]: nextest sees one test per binary → rust-analyzer spawned once; sub-cases run sequentially and collected; one failure does not mask others
  • Required by default: missing rust-analyzer panics; MCPLS_SKIP_RA=1 for MSRV/minimal CI jobs
  • Fixture isolation: per-suite TempDir copy prevents cross-binary rust-analyzer cache contention (also eliminates target//Cargo.lock pollution from fixture dir)
  • find_line() helper: eliminates hardcoded line numbers; positions derived from fixture content

Test plan

  • cargo nextest run --workspace --all-features --test ra_e2e with rust-analyzer in PATH — all 16 sub-cases pass
  • MCPLS_SKIP_RA=1 cargo nextest run --workspace --all-features --test ra_e2e — prints skip line, exits 0
  • cargo nextest run --workspace --all-features --lib --bins — 380 tests pass, no regressions
  • cargo +nightly fmt --all -- --check — clean
  • cargo clippy --all-targets --all-features --workspace -- -D warnings — clean

…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
@bug-ops bug-ops enabled auto-merge (squash) April 29, 2026 18:10
@github-actions github-actions Bot added rust Rust code changes testing Test-related changes mcpls-core mcpls-core crate changes labels Apr 29, 2026
@bug-ops bug-ops merged commit 6cae0e1 into main Apr 29, 2026
27 checks passed
@bug-ops bug-ops deleted the feat/issue-e2e-rust-analyzer branch April 29, 2026 18:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mcpls-core mcpls-core crate changes rust Rust code changes testing Test-related changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant