Skip to content

[Testing] MCP Tests Migration #243

@itomek-amd

Description

@itomek-amd

Overview

Migrate MCP integration tests to tests_v2/mcp/ with hardcoded port fixes.

Scope

  • Migrate tests/mcp/*tests_v2/mcp/*
  • Fix hardcoded ports (5000, 8080, 8765) with free_port fixture
  • Maintain all existing test functionality

Files to Migrate

From tests/mcp/:

  • test_agent_mcp_server.py
  • test_mcp_http_validation.py
  • test_mcp_integration.py
  • test_mcp_jira.py
  • test_mcp_simple.py
  • test_mcp_summarize.py

Anti-Patterns to Fix

Hardcoded ports:

File Ports
test_agent_mcp_server.py 5000, 8080
test_mcp_integration.py 8765

Solution: Use free_port fixture for dynamic port allocation.

Migration Process

CRITICAL: Follow 5-step process for each test file:

  1. Copy file to tests_v2/mcp/
  2. Update hardcoded ports to use free_port fixture
  3. Run the new test: pytest tests_v2/mcp/test_file.py -v
  4. Verify all tests pass and test same behavior
  5. Continue to next file

Acceptance Criteria

  • All 6 MCP test files migrated to tests_v2/mcp/
  • All hardcoded ports replaced with dynamic allocation
  • All tests pass: pytest tests_v2/mcp/ -v
  • Existing tests unchanged: pytest tests/mcp/ -v still passes
  • Test count verified: same number of tests in new versions

Parent Issue

Part of #209 - Test Suite Overhaul Epic

Dependencies

Requires #239 (tests_v2 foundation) to be completed first.

Metadata

Metadata

Labels

enhancementNew feature or requesttestsTest changes

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions