Skip to content

test: add comprehensive E2E tests for MCP server#39

Merged
jeremyeder merged 2 commits intomainfrom
e2e-tests-mcp-server
Mar 6, 2026
Merged

test: add comprehensive E2E tests for MCP server#39
jeremyeder merged 2 commits intomainfrom
e2e-tests-mcp-server

Conversation

@jeremyeder
Copy link
Copy Markdown
Contributor

Summary

  • Add tests/test_server_e2e.py with comprehensive end-to-end tests for all 26 MCP tools
  • Tests mock HTTP transport to verify complete flow from tool call through client to API
  • Covers success paths, error handling, dry-run modes, and edge cases

Test Coverage

Category Tools Tested
Session Management list_sessions, get_session, create_session, create_session_from_template, delete_session, restart_session, clone_session, update_session
Observability get_session_logs, get_session_transcript, get_session_metrics
Labels label_resource, unlabel_resource, list_sessions_by_label, bulk_label_resources, bulk_unlabel_resources
Bulk Operations bulk_delete_sessions, bulk_stop_sessions, bulk_restart_sessions, bulk_delete_sessions_by_label, bulk_stop_sessions_by_label, bulk_restart_sessions_by_label
Cluster Management list_clusters, whoami, switch_cluster, login

Test Infrastructure

  • MockHTTPClient class with response matching and call verification helpers
  • make_response() helper for creating mock httpx responses
  • Fixtures for cluster config, settings, and HTTP client injection

Test Scenarios

  • Success and error path testing for all tools
  • Dry-run mode verification (no HTTP calls made)
  • Confirmation requirement enforcement for destructive bulk operations
  • Input validation (invalid project names, unknown templates, missing fields)
  • Complete session lifecycle workflow simulation
  • Edge cases (empty lists, no label matches, partial bulk failures)

Test plan

  • Run pytest tests/test_server_e2e.py -v locally
  • Verify all 50+ test cases pass
  • Check coverage report for test_server_e2e.py

🤖 Generated with Claude Code

Ambient Code Bot and others added 2 commits March 6, 2026 03:35
Add test_server_e2e.py with full coverage of all 26 MCP tools:

Session Management:
- list_sessions, get_session, create_session, create_session_from_template
- delete_session, restart_session, clone_session, update_session

Observability:
- get_session_logs, get_session_transcript, get_session_metrics

Labels:
- label_resource, unlabel_resource, list_sessions_by_label
- bulk_label_resources, bulk_unlabel_resources

Bulk Operations:
- bulk_delete_sessions, bulk_stop_sessions, bulk_restart_sessions
- bulk_delete_sessions_by_label, bulk_stop_sessions_by_label
- bulk_restart_sessions_by_label

Cluster Management:
- list_clusters, whoami, switch_cluster, login

Test Infrastructure:
- MockHTTPClient class with response matching and call verification
- make_response helper for creating mock httpx responses
- Fixtures for cluster config, settings, and HTTP client

Test Coverage Includes:
- Success and error path testing
- Dry-run mode verification
- Confirmation requirement enforcement for destructive operations
- Input validation testing (invalid project, template, etc.)
- Complete session lifecycle workflow simulation
- Edge cases (empty lists, no matches, partial failures)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@jeremyeder jeremyeder merged commit 0bc57bf into main Mar 6, 2026
0 of 2 checks passed
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