This document describes the comprehensive testing capabilities available in ProxmoxMCP through the
enhanced Taskfile.yml configuration.
Overview
ProxmoxMCP provides a sophisticated testing workflow that supports different testing scenarios,
intelligent dependency management, and developer-friendly output. The testing system is designed to
accommodate both rapid development cycles and comprehensive validation.
Testing Tasks
Primary Testing Commands
task test
Description: Run all tests with enhanced validation and informative output.
tasktest
Features:
Comprehensive test suite execution (71 tests)
Enhanced output with progress indicators
Improved error reporting with --tb=short
Clear completion summary
Use Cases:
Pre-commit validation
Full codebase testing
CI/CD pipeline execution
task test:unit
Description: Run unit tests only with focused output.
Features:
Explicit unit test execution
Focused on tests/ directory
Short traceback format for faster debugging
Use Cases:
Development workflow testing
Quick validation during coding
Focused debugging sessions
Specialized Testing Commands
task test:coverage
Description: Run tests with coverage reporting (intelligent dependency handling).
Features:
Automatic pytest-cov detection
Graceful fallback when coverage tools unavailable
HTML and terminal coverage reports
80% coverage threshold enforcement
Helpful installation guidance
Dependencies:
Use Cases:
Code coverage analysis
Quality assurance validation
Identifying untested code paths
task test:watch
Description: Run tests in watch mode for continuous development.
Features:
Automatic pytest-watch detection
Graceful fallback to single test run
Installation guidance for watch mode
Continuous testing during development
Dependencies:
Use Cases:
Test-driven development (TDD)
Continuous validation during coding
Rapid feedback loops
task test:security
Description: Run security-focused test subset.
Features:
Filters tests with security keywords (encrypt, security, auth)
Focuses on authentication and encryption functionality
Faster execution for security validation
42 security-related tests
Use Cases:
Security-focused development
Encryption feature validation
Authentication flow testing
task test:tools
Description: Run MCP tools tests.
Features:
Tests MCP server functionality
Validates VM console operations
Focuses on tool implementations
Quick validation of MCP protocol compliance
Use Cases:
MCP tool development
API integration validation
Tool functionality verification
task test:config
Description: Run configuration and encryption tests.
Features:
Tests configuration loading and validation
Validates encryption/decryption functionality
Focuses on config management
Covers 42 configuration-related tests
Use Cases:
Configuration system development
Encryption feature development
Config validation testing
task test:integration
Description: Placeholder for integration tests (future implementation).
Run focused subsets (test:security, test:tools) for quick feedback
Use task test:coverage periodically to identify coverage gaps
Run task pre-commit before committing changes
CI/CD Testing
Use task ci for comprehensive local validation
Ensure all dependencies are properly locked in uv.lock
Test in clean environments to catch dependency issues
Monitor test execution times and optimize as needed
Team Collaboration
Share testing patterns and workflows with team members
Document any new test categories or patterns
Keep testing dependencies up to date
Contribute to test coverage improvements
This comprehensive testing workflow ensures high code quality, rapid development feedback, and
reliable validation of ProxmoxMCP functionality across all components.
# 1. Start watch mode for continuous testing
task test:watch
# 2. Make code changes
# 3. Tests run automatically
# 4. Run focused tests for specific areas
task test:security # For security features
task test:tools # For MCP tools
task test:config # For configuration
# 1. Run comprehensive pre-commit checks
task pre-commit
# This includes:
# - Code formatting (black)
# - Linting with auto-fix (ruff)
# - Type checking (mypy)
# - Development YAML linting
# - All tests pass validation
# 1. Install coverage dependencies
uv add pytest-cov --group dev
# 2. Run coverage analysis
task test:coverage
# 3. Review HTML coverage report
open htmlcov/index.html # macOS/Linux
start htmlcov/index.html # Windows
# Simulate full CI pipeline locally
task ci
# This runs:
# - All code quality checks (task check)
# - Complete test suite (task test)
# - Comprehensive validation
# Test specific components during development
task test:security # Security features
task test:tools # MCP tools
task test:config # Configuration system
# Automatic detection and fallback
if uv run python -c "import pytest_cov" 2>/dev/null; then
# Run with coverage
uv run pytest --cov=src --cov-report=html
else
# Fallback with installation hint
echo "π‘ Install with: uv add pytest-cov --group dev"
uv run pytest -v
fi
# Automatic detection and fallback
if uv run python -c "import pytest_watch" 2>/dev/null; then
# Run in watch mode
uv run pytest-watch
else
# Fallback with guidance
echo "π Running tests once instead..."
uv run pytest -v
fi
# Coverage tools
uv add pytest-cov --group dev
# Watch mode tools
uv add pytest-watch --group dev
# Future performance testing
uv add pytest-benchmark --group dev
# Build and test in Docker
docker compose up --build
docker compose exec app task test
# Ensure you're in the project root
cd /path/to/ProxmoxMCP
task test
# Install all development dependencies
uv sync --extra dev
# Install specific testing dependencies
uv add pytest-cov pytest-watch --group dev