Skip to content

test(extensions): expand MCP plugin and ACP coverage - #1042

Merged
hakula139 merged 2 commits into
mainfrom
test/mcp-acp-coverage
Dec 3, 2026
Merged

hakula139 merged 2 commits into
mainfrom
test/mcp-acp-coverage

Conversation

@hakula139

Copy link
Copy Markdown
Member

Summary

  • plugins/ox-plugin-mcp/src/config.rs: Added table-driven tests for McpConfig::validate, McpConfig::from_file missing-file error (ConfigError::ReadFile), and split_cli_spec empty name / value rejection; removed the unreachable parts.is_empty() guard in McpConfig::add_stdio_cli (87.88% -> 100.00% line coverage).
  • plugins/ox-plugin-mcp/src/bridge.rs: Added tests for handle_request notifications without id, invalid tool/call and command/invoke params, unknown server on command/invoke, and partial-init cleanup shutting down already-connected clients when a later server fails (88.29% -> 94.33% line coverage).
  • plugins/ox-plugin-mcp/src/mcp.rs: Added stdio transport resilience tests (EOF McpError::Closed, blank-line and server-notification skipping, request timeout McpError::Timeout) and HTTP McpError::InvalidHeader tests (91.99% -> 96.33% line coverage).
  • crates/ox-acp/src/lib.rs: Added tests for EventOutcome::Error emitting ERR_INTERNAL, session/cancel malformed params returning ERR_INVALID_PARAMS, in-flight blank-line skipping, and stdin EOF mid-prompt setting stopReason = "cancelled" (92.48% -> 92.65% line coverage).

Test plan

  • cargo fmt --check
  • cargo clippy --all-targets -- -D warnings
  • cargo test -p ox-plugin-mcp -p ox-acp (34 passed, 0 failed)
  • cargo llvm-cov -p ox-plugin-mcp -p ox-acp --summary-only (94.70% total line coverage)
  • nix develop -c run-hooks (all hooks passed)

Add table-driven config validation tests, bridge error-path and partial-init cleanup tests, stdio/HTTP MCP transport resilience tests, and ACP in-flight prompt error and EOF tests. Remove the unreachable empty-parts guard in McpConfig::add_stdio_cli.
@hakula139 hakula139 added area: extensions Touches hooks, skills, packages, or MCP integration test Test coverage changes labels Dec 3, 2026
@hakula139 hakula139 self-assigned this Dec 3, 2026
@codecov

codecov Bot commented Dec 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@hakula139
hakula139 merged commit 2705cbc into main Dec 3, 2026
7 checks passed
@hakula139
hakula139 deleted the test/mcp-acp-coverage branch December 3, 2026 06:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: extensions Touches hooks, skills, packages, or MCP integration test Test coverage changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant