Skip to content

task: Add MCP E2E tests#432

Open
neelay-aign wants to merge 1 commit intomainfrom
task/mcp-e2e-tests
Open

task: Add MCP E2E tests#432
neelay-aign wants to merge 1 commit intomainfrom
task/mcp-e2e-tests

Conversation

@neelay-aign
Copy link
Collaborator

No description provided.

Copilot AI review requested due to automatic review settings February 15, 2026 21:43
@atlantis-platform-engineering
Error: This repo is not allowlisted for Atlantis.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an end-to-end test fixture and a dummy MCP plugin package to validate MCP plugin auto-discovery via Python entry points in the Aignostics SDK.

Changes:

  • Introduces a dummy, installable MCP plugin (entry point: aignostics.plugins) exposing two tools (dummy_echo, dummy_add).
  • Adds an E2E-style test that installs the dummy plugin, clears discovery caches, and verifies server discovery + client tool round-trip.
  • Adds a .feature spec file for traceability of TC-UTILS-MCP-01.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
tests/resources/mcp_dummy_plugin/src/mcp_dummy_plugin/_mcp.py Implements dummy FastMCP server and tools used by the E2E test.
tests/resources/mcp_dummy_plugin/src/mcp_dummy_plugin/__init__.py Exposes mcp for plugin import/entry-point loading.
tests/resources/mcp_dummy_plugin/pyproject.toml Defines an installable test plugin with an aignostics.plugins entry point.
tests/aignostics/utils/mcp_test.py Adds cache-clearing helpers, pip install/uninstall fixture, and an auto-discovery E2E test using fastmcp.Client.
tests/aignostics/utils/TC-UTILS-MCP-01.feature Adds a feature spec describing the intended discovery + serving behavior.

Comment on lines +212 to +216
subprocess.check_call(
[sys.executable, "-m", "pip", "install", "-e", str(DUMMY_PLUGIN_DIR)],
stdout=subprocess.DEVNULL,
stderr=subprocess.PIPE,
)
Copy link

Copilot AI Feb 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

subprocess.check_call(..., stderr=subprocess.PIPE) will not surface pip’s stderr in the test failure output (CalledProcessError from check_call doesn’t include captured stderr). This makes CI failures hard to debug. Prefer subprocess.run(..., check=True, capture_output=True, text=True) and, on failure, include stderr in the exception/log output (or don’t redirect stderr/stdout).

Copilot uses AI. Check for mistakes.
import site

subprocess.check_call(
[sys.executable, "-m", "pip", "install", "-e", str(DUMMY_PLUGIN_DIR)],
Copy link

Copilot AI Feb 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Installing the dummy plugin via pip inside the test can trigger dependency/build isolation installs (network access) and makes the test non-hermetic/offline-unfriendly. Consider adding --no-deps (since fastmcp is already a test dependency) and --no-build-isolation / other options to ensure this stays offline and deterministic.

Suggested change
[sys.executable, "-m", "pip", "install", "-e", str(DUMMY_PLUGIN_DIR)],
[
sys.executable,
"-m",
"pip",
"install",
"--no-deps",
"--no-build-isolation",
"-e",
str(DUMMY_PLUGIN_DIR),
],

Copilot uses AI. Check for mistakes.
Comment on lines +224 to +228
subprocess.check_call(
[sys.executable, "-m", "pip", "uninstall", "-y", "mcp-dummy-plugin"],
stdout=subprocess.DEVNULL,
stderr=subprocess.PIPE,
)
Copy link

Copilot AI Feb 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as install: subprocess.check_call(..., stderr=subprocess.PIPE) during uninstall hides the pip error output if uninstall fails, which will be painful to diagnose in CI. Use subprocess.run(..., check=True, capture_output=True, text=True) or let stderr through.

Copilot uses AI. Check for mistakes.
_clear_mcp_discovery_caches()


@pytest.mark.e2e
Copy link

Copilot AI Feb 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test installs/uninstalls a package into the active venv, which isn’t safe to run under the parallel -m (not sequential) pytest pass (see noxfile’s split between parallel/non-parallel runs). It should be marked @pytest.mark.sequential to avoid xdist concurrency issues. Also, per pyproject.toml marker docs, e2e is intended for tests involving real external network services; this looks like an offline integration test, so integration (plus sequential) would better match the repository’s conventions.

Suggested change
@pytest.mark.e2e
@pytest.mark.integration
@pytest.mark.sequential

Copilot uses AI. Check for mistakes.
Comment on lines +13 to +14
And a client connects and lists tools
Then the tool list includes "dummy_plugin_dummy_echo" and "dummy_plugin_dummy_add"
Copy link

Copilot AI Feb 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The scenario text says the client “connects and lists tools”, but the corresponding test (test_mcp_server_discovers_and_serves_plugin_tools) asserts tool names via server.get_tools() rather than listing tools through the client. To keep spec ↔ test traceability accurate, either update the scenario wording or update the test to list tools via the Client API (if available).

Suggested change
And a client connects and lists tools
Then the tool list includes "dummy_plugin_dummy_echo" and "dummy_plugin_dummy_add"
And tools are listed from the server via server.get_tools()
Then the returned tool list includes "dummy_plugin_dummy_echo" and "dummy_plugin_dummy_add"

Copilot uses AI. Check for mistakes.
@codecov
Copy link

codecov bot commented Feb 15, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.
see 8 files with indirect coverage changes

@sonarqubecloud
Copy link

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