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:
Beehive Innovations
2025-06-18 23:41:22 +04:00
committed by GitHub
parent 9d72545ecd
commit 4151c3c3a5
121 changed files with 2842 additions and 3168 deletions

View File

@@ -1,8 +1,8 @@
#!/usr/bin/env python3
"""
Docker Logs Validation Test
Server Logs Validation Test
Validates Docker logs to confirm file deduplication behavior and
Validates server logs to confirm file deduplication behavior and
conversation threading is working properly.
"""
@@ -10,7 +10,7 @@ from .base_test import BaseSimulatorTest
class LogsValidationTest(BaseSimulatorTest):
"""Validate Docker logs to confirm file deduplication behavior"""
"""Validate server logs to confirm file deduplication behavior"""
@property
def test_name(self) -> str:
@@ -18,39 +18,35 @@ class LogsValidationTest(BaseSimulatorTest):
@property
def test_description(self) -> str:
return "Docker logs validation"
return "Server logs validation"
def run_test(self) -> bool:
"""Validate Docker logs to confirm file deduplication behavior"""
"""Validate server logs to confirm file deduplication behavior"""
try:
self.logger.info("📋 Test: Validating Docker logs for file deduplication...")
self.logger.info("📋 Test: Validating server logs for file deduplication...")
# Get server logs from main container
result = self.run_command(["docker", "logs", self.container_name], capture_output=True)
# Get server logs from log files
import os
if result.returncode != 0:
self.logger.error(f"Failed to get Docker logs: {result.stderr}")
logs = ""
log_files = ["logs/mcp_server.log", "logs/mcp_activity.log"]
for log_file in log_files:
if os.path.exists(log_file):
try:
with open(log_file) as f:
file_content = f.read()
logs += f"\n=== {log_file} ===\n{file_content}\n"
self.logger.debug(f"Read {len(file_content)} characters from {log_file}")
except Exception as e:
self.logger.warning(f"Could not read {log_file}: {e}")
else:
self.logger.warning(f"Log file not found: {log_file}")
if not logs.strip():
self.logger.warning("No log content found - server may not have processed any requests yet")
return False
main_logs = result.stdout.decode() + result.stderr.decode()
# Get logs from log monitor container (where detailed activity is logged)
monitor_result = self.run_command(["docker", "logs", "zen-mcp-log-monitor"], capture_output=True)
monitor_logs = ""
if monitor_result.returncode == 0:
monitor_logs = monitor_result.stdout.decode() + monitor_result.stderr.decode()
# Also get activity logs for more detailed conversation tracking
activity_result = self.run_command(
["docker", "exec", self.container_name, "cat", "/tmp/mcp_activity.log"], capture_output=True
)
activity_logs = ""
if activity_result.returncode == 0:
activity_logs = activity_result.stdout.decode()
logs = main_logs + "\n" + monitor_logs + "\n" + activity_logs
# Look for conversation threading patterns that indicate the system is working
conversation_patterns = [
"CONVERSATION_RESUME",