Bruno Charest ecefbc8611
Some checks failed
Tests / Backend Tests (Python) (3.10) (push) Has been cancelled
Tests / Backend Tests (Python) (3.11) (push) Has been cancelled
Tests / Backend Tests (Python) (3.12) (push) Has been cancelled
Tests / Frontend Tests (JS) (push) Has been cancelled
Tests / Integration Tests (push) Has been cancelled
Tests / All Tests Passed (push) Has been cancelled
Clean up test files and debug artifacts, add node_modules to gitignore, export DashboardManager for testing, and enhance pytest configuration with comprehensive test markers and settings
2025-12-15 08:15:49 -05:00

84 lines
2.4 KiB
Makefile

# Makefile for Homelab Automation Dashboard - Test Commands
# ==========================================================
.PHONY: help test test-backend test-frontend test-all test-cov install-test-deps lint
# Default target
help:
@echo "Homelab Automation Dashboard - Test Commands"
@echo "============================================="
@echo ""
@echo "Usage: make <target>"
@echo ""
@echo "Targets:"
@echo " install-test-deps Install all test dependencies (Python + Node.js)"
@echo " test-backend Run backend Python tests"
@echo " test-frontend Run frontend JavaScript tests"
@echo " test-all Run all tests (backend + frontend)"
@echo " test-cov Run all tests with coverage reports"
@echo " test-watch Run tests in watch mode"
@echo " lint Run linters (if configured)"
@echo ""
# Install test dependencies
install-test-deps:
@echo "Installing Python test dependencies..."
pip install pytest pytest-asyncio pytest-cov httpx respx freezegun pytest-mock
@echo ""
@echo "Installing Node.js test dependencies..."
npm install
@echo ""
@echo "✅ All test dependencies installed"
# Backend tests only
test-backend:
@echo "Running backend tests..."
pytest tests/backend -v --tb=short -m "unit"
# Backend tests with coverage
test-backend-cov:
@echo "Running backend tests with coverage..."
pytest tests/backend -v --tb=short --cov=app --cov-report=html --cov-report=term-missing
# Frontend tests only
test-frontend:
@echo "Running frontend tests..."
npm test
# Frontend tests with coverage
test-frontend-cov:
@echo "Running frontend tests with coverage..."
npm run test:coverage
# All tests
test-all: test-backend test-frontend
@echo ""
@echo "✅ All tests completed"
# All tests with coverage
test-cov: test-backend-cov test-frontend-cov
@echo ""
@echo "✅ All tests completed with coverage"
@echo "Backend coverage: htmlcov/index.html"
@echo "Frontend coverage: coverage/index.html"
# Watch mode (frontend only - uses Vitest watch)
test-watch:
npm run test:watch
# Quick test (fast subset)
test-quick:
pytest tests/backend -v --tb=short -m "unit" -x -q
npm test -- --run
# Integration tests
test-integration:
pytest tests/backend -v --tb=short -m "integration"
# Clean test artifacts
clean-test:
@echo "Cleaning test artifacts..."
rm -rf .pytest_cache __pycache__ htmlcov coverage .coverage
rm -rf tests/backend/__pycache__ tests/frontend/__pycache__
@echo "✅ Test artifacts cleaned"