- Self-contained HTML dashboard with MS Office 365 design - pytest plugin captures inputs, outputs, and errors per test - Unified orchestrator runs pytest + torture tests together - Test files persisted in reports/test_files/ with relative links - GitHub Actions workflow with PR comments and job summaries - Makefile with convenient commands (test, view-dashboard, etc.) - Works offline with embedded JSON data (no CORS issues)
128 lines
4.2 KiB
Makefile
128 lines
4.2 KiB
Makefile
# Makefile for MCP Office Tools
|
|
# Provides convenient commands for testing, development, and dashboard generation
|
|
|
|
.PHONY: help test test-dashboard test-pytest test-torture view-dashboard clean install format lint type-check
|
|
|
|
# Default target - show help
|
|
help:
|
|
@echo "MCP Office Tools - Available Commands"
|
|
@echo "======================================"
|
|
@echo ""
|
|
@echo "Testing & Dashboard:"
|
|
@echo " make test - Run all tests with dashboard generation"
|
|
@echo " make test-dashboard - Alias for 'make test'"
|
|
@echo " make test-pytest - Run only pytest tests"
|
|
@echo " make test-torture - Run only torture tests"
|
|
@echo " make view-dashboard - Open test dashboard in browser"
|
|
@echo ""
|
|
@echo "Development:"
|
|
@echo " make install - Install project with dev dependencies"
|
|
@echo " make format - Format code with black"
|
|
@echo " make lint - Lint code with ruff"
|
|
@echo " make type-check - Run type checking with mypy"
|
|
@echo " make clean - Clean temporary files and caches"
|
|
@echo ""
|
|
@echo "Examples:"
|
|
@echo " make test # Run everything and open dashboard"
|
|
@echo " make test-pytest # Quick pytest-only run"
|
|
@echo " make view-dashboard # View existing results"
|
|
|
|
# Run all tests and generate unified dashboard
|
|
test: test-dashboard
|
|
|
|
test-dashboard:
|
|
@echo "🧪 Running comprehensive test suite with dashboard generation..."
|
|
@python run_dashboard_tests.py
|
|
|
|
# Run only pytest tests
|
|
test-pytest:
|
|
@echo "🧪 Running pytest test suite..."
|
|
@uv run pytest --dashboard-output=reports/test_results.json -v
|
|
|
|
# Run only torture tests
|
|
test-torture:
|
|
@echo "🔥 Running torture tests..."
|
|
@uv run python torture_test.py
|
|
|
|
# View test dashboard in browser
|
|
view-dashboard:
|
|
@echo "📊 Opening test dashboard..."
|
|
@./view_dashboard.sh
|
|
|
|
# Install project with dev dependencies
|
|
install:
|
|
@echo "📦 Installing MCP Office Tools with dev dependencies..."
|
|
@uv sync --dev
|
|
@echo "✅ Installation complete!"
|
|
|
|
# Format code with black
|
|
format:
|
|
@echo "🎨 Formatting code with black..."
|
|
@uv run black src/ tests/ examples/
|
|
@echo "✅ Formatting complete!"
|
|
|
|
# Lint code with ruff
|
|
lint:
|
|
@echo "🔍 Linting code with ruff..."
|
|
@uv run ruff check src/ tests/ examples/
|
|
@echo "✅ Linting complete!"
|
|
|
|
# Type checking with mypy
|
|
type-check:
|
|
@echo "🔎 Running type checks with mypy..."
|
|
@uv run mypy src/
|
|
@echo "✅ Type checking complete!"
|
|
|
|
# Clean temporary files and caches
|
|
clean:
|
|
@echo "🧹 Cleaning temporary files and caches..."
|
|
@find . -type d -name "__pycache__" -exec rm -rf {} + 2>/dev/null || true
|
|
@find . -type d -name "*.egg-info" -exec rm -rf {} + 2>/dev/null || true
|
|
@find . -type d -name ".pytest_cache" -exec rm -rf {} + 2>/dev/null || true
|
|
@find . -type d -name ".mypy_cache" -exec rm -rf {} + 2>/dev/null || true
|
|
@find . -type d -name ".ruff_cache" -exec rm -rf {} + 2>/dev/null || true
|
|
@find . -type f -name "*.pyc" -delete 2>/dev/null || true
|
|
@rm -rf dist/ build/ 2>/dev/null || true
|
|
@echo "✅ Cleanup complete!"
|
|
|
|
# Run full quality checks (format, lint, type-check, test)
|
|
check: format lint type-check test
|
|
@echo "✅ All quality checks passed!"
|
|
|
|
# Quick development test cycle (no dashboard)
|
|
quick-test:
|
|
@echo "⚡ Quick test run (no dashboard)..."
|
|
@uv run pytest -v --tb=short
|
|
|
|
# Coverage report
|
|
coverage:
|
|
@echo "📊 Generating coverage report..."
|
|
@uv run pytest --cov=mcp_office_tools --cov-report=html --cov-report=term
|
|
@echo "✅ Coverage report generated at htmlcov/index.html"
|
|
|
|
# Run server in development mode
|
|
dev:
|
|
@echo "🚀 Starting MCP Office Tools server..."
|
|
@uv run mcp-office-tools
|
|
|
|
# Build distribution packages
|
|
build:
|
|
@echo "📦 Building distribution packages..."
|
|
@uv build
|
|
@echo "✅ Build complete! Packages in dist/"
|
|
|
|
# Show project info
|
|
info:
|
|
@echo "MCP Office Tools - Project Information"
|
|
@echo "======================================="
|
|
@echo ""
|
|
@echo "Project: mcp-office-tools"
|
|
@echo "Version: $(shell grep '^version' pyproject.toml | cut -d'"' -f2)"
|
|
@echo "Python: $(shell python --version)"
|
|
@echo "UV: $(shell uv --version 2>/dev/null || echo 'not installed')"
|
|
@echo ""
|
|
@echo "Directory: $(shell pwd)"
|
|
@echo "Tests: $(shell find tests -name 'test_*.py' | wc -l) test files"
|
|
@echo "Source files: $(shell find src -name '*.py' | wc -l) Python files"
|
|
@echo ""
|