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

@@ -21,7 +21,6 @@ from pydantic import Field
from config import TEMPERATURE_ANALYTICAL
from systemprompts import TESTGEN_PROMPT
from utils.file_utils import translate_file_paths
from .base import BaseTool, ToolRequest
@@ -30,7 +29,8 @@ logger = logging.getLogger(__name__)
# Field descriptions to avoid duplication between Pydantic and JSON schema
TESTGEN_FIELD_DESCRIPTIONS = {
"files": "Code files or directories to generate tests for (must be FULL absolute paths to real files / folders - DO NOT SHORTEN)",
"prompt": "Description of what to test, testing objectives, and specific scope/focus areas",
"prompt": "Description of what to test, testing objectives, and specific scope/focus areas. Be specific about any "
"particular component, module, class of function you would like to generate tests for.",
"test_examples": (
"Optional existing test files or directories to use as style/pattern reference (must be FULL absolute paths to real files / folders - DO NOT SHORTEN). "
"If not provided, the tool will determine the best testing approach based on the code structure. "
@@ -164,9 +164,7 @@ class TestGenerationTool(BaseTool):
logger.info(f"[TESTGEN] All {len(test_examples)} test examples already in conversation history")
return "", ""
# Translate file paths for Docker environment before accessing files
translated_examples = translate_file_paths(examples_to_process)
logger.debug(f"[TESTGEN] Translated {len(examples_to_process)} file paths for container access")
logger.debug(f"[TESTGEN] Processing {len(examples_to_process)} file paths")
# Calculate token budget for test examples (25% of available tokens, or fallback)
if available_tokens:
@@ -184,13 +182,11 @@ class TestGenerationTool(BaseTool):
)
# Sort by file size (smallest first) for pattern-focused selection
# Use translated paths for file system operations, but keep original paths for processing
file_sizes = []
for i, file_path in enumerate(examples_to_process):
translated_path = translated_examples[i]
for file_path in examples_to_process:
try:
size = os.path.getsize(translated_path)
file_sizes.append((file_path, size)) # Keep original path for consistency
size = os.path.getsize(file_path)
file_sizes.append((file_path, size))
logger.debug(f"[TESTGEN] Test example {os.path.basename(file_path)}: {size:,} bytes")
except (OSError, FileNotFoundError) as e:
# If we can't get size, put it at the end