Files
AegisGitea-MCP/run_tests.sh
latte 08e9aa1de6 docs: add comprehensive testing guide and test runner
Added:
- run_tests.sh: Automated test runner with coverage reporting
- TESTING.md: Complete testing documentation including:
  - Test suite overview
  - Manual testing procedures
  - CI/CD integration examples
  - Performance testing guidelines
  - Troubleshooting guide

The test suite now has ~85% coverage of core modules with
tests for authentication, server endpoints, and integration flows.
2026-01-29 20:46:50 +01:00

80 lines
1.7 KiB
Bash
Executable File

#!/bin/bash
# Test runner script for AegisGitea MCP
set -e
echo "========================================="
echo "AegisGitea MCP - Test Suite"
echo "========================================="
echo ""
# Colors
GREEN='\033[0;32m'
RED='\033[0;31m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color
# Check if virtual environment exists
if [ ! -d "venv" ]; then
echo -e "${YELLOW}Virtual environment not found. Creating...${NC}"
python3 -m venv venv
fi
# Activate virtual environment
source venv/bin/activate
# Install dependencies
echo -e "${YELLOW}Installing dependencies...${NC}"
pip install -q -r requirements-dev.txt
echo ""
echo "========================================="
echo "Running Tests"
echo "========================================="
echo ""
# Run tests with coverage
pytest tests/ \
-v \
--cov=aegis_gitea_mcp \
--cov-report=term-missing \
--cov-report=html \
--tb=short
TEST_EXIT_CODE=$?
echo ""
echo "========================================="
echo "Test Summary"
echo "========================================="
echo ""
if [ $TEST_EXIT_CODE -eq 0 ]; then
echo -e "${GREEN}✓ All tests passed!${NC}"
echo ""
echo "Coverage report generated in htmlcov/"
echo "Open htmlcov/index.html in your browser to view detailed coverage."
else
echo -e "${RED}✗ Some tests failed${NC}"
echo ""
echo "Please review the errors above and fix them."
exit 1
fi
echo ""
echo "========================================="
echo "Running Linters"
echo "========================================="
echo ""
# Run ruff
echo "Running ruff..."
ruff check src/ tests/ || true
# Run mypy
echo "Running mypy..."
mypy src/ || true
echo ""
echo -e "${GREEN}Test suite complete!${NC}"