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
@@ -4,11 +4,10 @@ O3 Model Selection Test
|
||||
|
||||
Tests that O3 models are properly selected and used when explicitly specified,
|
||||
regardless of the default model configuration (even when set to auto).
|
||||
Validates model selection via Docker logs.
|
||||
Validates model selection via server logs.
|
||||
"""
|
||||
|
||||
import datetime
|
||||
import subprocess
|
||||
|
||||
from .base_test import BaseSimulatorTest
|
||||
|
||||
@@ -24,47 +23,16 @@ class O3ModelSelectionTest(BaseSimulatorTest):
|
||||
def test_description(self) -> str:
|
||||
return "O3 model selection and usage validation"
|
||||
|
||||
def get_recent_server_logs(self) -> str:
|
||||
"""Get recent server logs from the log file directly"""
|
||||
try:
|
||||
# Read logs directly from the log file - use more lines to ensure we get all test-related logs
|
||||
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 run_test(self) -> bool:
|
||||
"""Test O3 model selection and usage"""
|
||||
try:
|
||||
self.logger.info(" Test: O3 model selection and usage validation")
|
||||
|
||||
# Check which API keys are configured
|
||||
check_cmd = [
|
||||
"docker",
|
||||
"exec",
|
||||
self.container_name,
|
||||
"python",
|
||||
"-c",
|
||||
'import os; print(f\'OPENAI_KEY:{bool(os.environ.get("OPENAI_API_KEY"))}|OPENROUTER_KEY:{bool(os.environ.get("OPENROUTER_API_KEY"))}\')',
|
||||
]
|
||||
result = subprocess.run(check_cmd, capture_output=True, text=True)
|
||||
import os
|
||||
|
||||
has_openai = False
|
||||
has_openrouter = False
|
||||
|
||||
if result.returncode == 0:
|
||||
output = result.stdout.strip()
|
||||
if "OPENAI_KEY:True" in output:
|
||||
has_openai = True
|
||||
if "OPENROUTER_KEY:True" in output:
|
||||
has_openrouter = True
|
||||
has_openai = bool(os.environ.get("OPENAI_API_KEY"))
|
||||
has_openrouter = bool(os.environ.get("OPENROUTER_API_KEY"))
|
||||
|
||||
# If only OpenRouter is configured, adjust test expectations
|
||||
if has_openrouter and not has_openai:
|
||||
|
||||
Reference in New Issue
Block a user