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
@@ -6,7 +6,6 @@ import asyncio
|
||||
import importlib
|
||||
import os
|
||||
import sys
|
||||
import tempfile
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
@@ -33,11 +32,8 @@ import config # noqa: E402
|
||||
|
||||
importlib.reload(config)
|
||||
|
||||
# Set WORKSPACE_ROOT to a temporary directory for tests
|
||||
# This provides a safe sandbox for file operations during testing
|
||||
# Create a temporary directory that will be used as the workspace for all tests
|
||||
test_root = tempfile.mkdtemp(prefix="zen_mcp_test_")
|
||||
os.environ["WORKSPACE_ROOT"] = test_root
|
||||
# Note: This creates a test sandbox environment
|
||||
# Tests create their own temporary directories as needed
|
||||
|
||||
# Configure asyncio for Windows compatibility
|
||||
if sys.platform == "win32":
|
||||
@@ -47,7 +43,7 @@ if sys.platform == "win32":
|
||||
from providers import ModelProviderRegistry # noqa: E402
|
||||
from providers.base import ProviderType # noqa: E402
|
||||
from providers.gemini import GeminiModelProvider # noqa: E402
|
||||
from providers.openai import OpenAIModelProvider # noqa: E402
|
||||
from providers.openai_provider import OpenAIModelProvider # noqa: E402
|
||||
from providers.xai import XAIModelProvider # noqa: E402
|
||||
|
||||
# Register providers at test startup
|
||||
@@ -59,14 +55,11 @@ ModelProviderRegistry.register_provider(ProviderType.XAI, XAIModelProvider)
|
||||
@pytest.fixture
|
||||
def project_path(tmp_path):
|
||||
"""
|
||||
Provides a temporary directory within the WORKSPACE_ROOT sandbox for tests.
|
||||
This ensures all file operations during tests are within the allowed directory.
|
||||
Provides a temporary directory for tests.
|
||||
This ensures all file operations during tests are isolated.
|
||||
"""
|
||||
# Get the test workspace root
|
||||
test_root = Path(os.environ.get("WORKSPACE_ROOT", "/tmp"))
|
||||
|
||||
# Create a subdirectory for this specific test
|
||||
test_dir = test_root / f"test_{tmp_path.name}"
|
||||
test_dir = tmp_path / "test_workspace"
|
||||
test_dir.mkdir(parents=True, exist_ok=True)
|
||||
|
||||
return test_dir
|
||||
|
||||
Reference in New Issue
Block a user