Migration from Docker to Standalone Python Server (#73)
* Migration from docker to standalone server Migration handling Fixed tests Use simpler in-memory storage Support for concurrent logging to disk Simplified direct connections to localhost * Migration from docker / redis to standalone script Updated tests Updated run script Fixed requirements Use dotenv Ask if user would like to install MCP in Claude Desktop once Updated docs * More cleanup and references to docker removed * Cleanup * Comments * Fixed tests * Fix GitHub Actions workflow for standalone Python architecture - Install requirements-dev.txt for pytest and testing dependencies - Remove Docker setup from simulation tests (now standalone) - Simplify linting job to use requirements-dev.txt - Update simulation tests to run directly without Docker Fixes unit test failures in CI due to missing pytest dependency. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> * Remove simulation tests from GitHub Actions - Removed simulation-tests job that makes real API calls - Keep only unit tests (mocked, no API costs) and linting - Simulation tests should be run manually with real API keys - Reduces CI costs and complexity GitHub Actions now only runs: - Unit tests (569 tests, all mocked) - Code quality checks (ruff, black) 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> * Fixed tests * Fixed tests --------- Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
committed by
GitHub
parent
9d72545ecd
commit
4151c3c3a5
@@ -21,8 +21,6 @@ This validates the conversation threading system's ability to:
|
||||
- Properly traverse parent relationships for history reconstruction
|
||||
"""
|
||||
|
||||
import re
|
||||
import subprocess
|
||||
|
||||
from .base_test import BaseSimulatorTest
|
||||
|
||||
@@ -38,53 +36,6 @@ class ConversationChainValidationTest(BaseSimulatorTest):
|
||||
def test_description(self) -> str:
|
||||
return "Conversation chain and threading validation"
|
||||
|
||||
def get_recent_server_logs(self) -> str:
|
||||
"""Get recent server logs from the log file directly"""
|
||||
try:
|
||||
cmd = ["docker", "exec", self.container_name, "tail", "-n", "500", "/tmp/mcp_server.log"]
|
||||
result = subprocess.run(cmd, capture_output=True, text=True)
|
||||
|
||||
if result.returncode == 0:
|
||||
return result.stdout
|
||||
else:
|
||||
self.logger.warning(f"Failed to read server logs: {result.stderr}")
|
||||
return ""
|
||||
except Exception as e:
|
||||
self.logger.error(f"Failed to get server logs: {e}")
|
||||
return ""
|
||||
|
||||
def extract_thread_creation_logs(self, logs: str) -> list[dict[str, str]]:
|
||||
"""Extract thread creation logs with parent relationships"""
|
||||
thread_logs = []
|
||||
|
||||
lines = logs.split("\n")
|
||||
for line in lines:
|
||||
if "[THREAD] Created new thread" in line:
|
||||
# Parse: [THREAD] Created new thread 9dc779eb-645f-4850-9659-34c0e6978d73 with parent a0ce754d-c995-4b3e-9103-88af429455aa
|
||||
match = re.search(r"\[THREAD\] Created new thread ([a-f0-9-]+) with parent ([a-f0-9-]+|None)", line)
|
||||
if match:
|
||||
thread_id = match.group(1)
|
||||
parent_id = match.group(2) if match.group(2) != "None" else None
|
||||
thread_logs.append({"thread_id": thread_id, "parent_id": parent_id, "log_line": line})
|
||||
|
||||
return thread_logs
|
||||
|
||||
def extract_history_traversal_logs(self, logs: str) -> list[dict[str, str]]:
|
||||
"""Extract conversation history traversal logs"""
|
||||
traversal_logs = []
|
||||
|
||||
lines = logs.split("\n")
|
||||
for line in lines:
|
||||
if "[THREAD] Retrieved chain of" in line:
|
||||
# Parse: [THREAD] Retrieved chain of 3 threads for 9dc779eb-645f-4850-9659-34c0e6978d73
|
||||
match = re.search(r"\[THREAD\] Retrieved chain of (\d+) threads for ([a-f0-9-]+)", line)
|
||||
if match:
|
||||
chain_length = int(match.group(1))
|
||||
thread_id = match.group(2)
|
||||
traversal_logs.append({"thread_id": thread_id, "chain_length": chain_length, "log_line": line})
|
||||
|
||||
return traversal_logs
|
||||
|
||||
def run_test(self) -> bool:
|
||||
"""Test conversation chain and threading functionality"""
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user