Files
AstrBot/openspec/changes/add-internal-integration-tests/tasks.md
LIghtJUNction 310d2d6998 feat: add integration tests infrastructure and MCP echo server fixture
- Add tests/integration/ directory with fixtures/
- Create echo_mcp_server.py for MCP testing
- Create test_mcp_integration.py with basic tests
- Fix bug in MCP client: use stdio_transport instead of _streams_context
- Add examples/abp_demo.py demonstrating ABP protocol
- Update openspec with integration tests change
2026-03-23 23:01:55 +08:00

998 B

Implementation Tasks

1. MCP Echo Server Fixture

  • 1.1 Create tests/integration/fixtures/ directory
  • 1.2 Create echo_mcp_server.py with initialize, tools/list, tools/call handlers

2. MCP Integration Test

  • 2.1 Create tests/integration/test_mcp_integration.py
  • 2.2 Test MCP client connects to echo server (requires proper MCP stdio handshake)
  • 2.3 Test list_tools() returns mock tool
  • 2.4 Test call_tool() works correctly

Note: MCP echo server fixture created but MCP protocol handshake is complex. The tests hang because the MCP library expects specific initialization sequence.

3. ACP Echo Server Fixture

  • 3.1 ACP server uses TCP/Unix socket (complex setup)
  • 3.2 Create ACP echo server fixture (deferred)

4. ACP Integration Test

  • 4.1 ACP integration tests deferred
  • 4.2 ACP client uses asyncio.StreamReader/Writer

5. Verification

  • 5.1 Run uv run pytest tests/unit/ -v
  • 5.2 Verify internal runtime tests pass