test: add comprehensive E2E tests for MCP server#39
Merged
jeremyeder merged 2 commits intomainfrom Mar 6, 2026
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
tests/test_server_e2e.pywith comprehensive end-to-end tests for all 26 MCP toolsTest Coverage
list_sessions,get_session,create_session,create_session_from_template,delete_session,restart_session,clone_session,update_sessionget_session_logs,get_session_transcript,get_session_metricslabel_resource,unlabel_resource,list_sessions_by_label,bulk_label_resources,bulk_unlabel_resourcesbulk_delete_sessions,bulk_stop_sessions,bulk_restart_sessions,bulk_delete_sessions_by_label,bulk_stop_sessions_by_label,bulk_restart_sessions_by_labellist_clusters,whoami,switch_cluster,loginTest Infrastructure
MockHTTPClientclass with response matching and call verification helpersmake_response()helper for creating mock httpx responsesTest Scenarios
Test plan
pytest tests/test_server_e2e.py -vlocally🤖 Generated with Claude Code