-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
90 lines (73 loc) · 2.73 KB
/
Copy pathMakefile
File metadata and controls
90 lines (73 loc) · 2.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# Makefile for Statistical Model Suggester Testing
.PHONY: test test-unit test-integration test-coverage test-models test-auth test-main test-admin test-utils clean install-test-deps lint lint-fix
# Default target
test: test-unit test-integration
# Install testing dependencies
install-test-deps:
pip install pytest pytest-flask pytest-cov flake8
# Run all unit tests
test-unit:
python -m pytest tests/ -m "not integration" -v
# Run integration tests
test-integration:
python -m pytest tests/test_integration.py -v
# Run tests with coverage
test-coverage:
python -m pytest tests/ --cov=. --cov-report=html --cov-report=term-missing
# Run specific test categories
test-models:
python -m pytest tests/test_models.py -v
test-auth:
python -m pytest tests/test_auth_routes.py -v
test-main:
python -m pytest tests/test_main_routes.py -v
test-admin:
python -m pytest tests/test_admin_routes.py -v
test-utils:
python -m pytest tests/test_utils.py -v
# Run tests for CI/CD (minimal output)
test-ci:
python -m pytest tests/ --tb=short -q
# Run fast tests only (skip slow ones)
test-fast:
python -m pytest tests/ -m "not slow" -v
# Clean up test artifacts and temporary files
clean:
rm -rf htmlcov/
rm -rf .coverage
rm -rf .pytest_cache/
find . -type d -name __pycache__ -exec rm -rf {} +
find . -type f -name "*.pyc" -delete
find . -name ".DS_Store" -delete
find . -name "*.log" -delete
find . -name "*.tmp" -delete
find . -name "*.bak" -delete
# Linting
lint:
flake8 routes/ tests/ --max-line-length=88 --extend-ignore=E203,W503
lint-fix:
@echo "Fixing basic formatting issues..."
@echo "Note: This fixes only simple whitespace issues. Complex issues need manual fixing."
# Remove trailing whitespace
find routes/ tests/ -name "*.py" -exec sed -i '' 's/[[:space:]]*$$//' {} \;
# Remove blank lines with whitespace
find routes/ tests/ -name "*.py" -exec sed -i '' '/^[[:space:]]*$$/d' {} \;
# Help
help:
@echo "Available targets:"
@echo " test - Run all tests"
@echo " test-unit - Run unit tests only"
@echo " test-integration - Run integration tests only"
@echo " test-coverage - Run tests with coverage report"
@echo " test-models - Run model tests"
@echo " test-auth - Run authentication tests"
@echo " test-main - Run main route tests"
@echo " test-admin - Run admin tests"
@echo " test-utils - Run utility tests"
@echo " test-ci - Run tests for CI/CD"
@echo " test-fast - Run fast tests only"
@echo " clean - Clean test artifacts"
@echo " install-test-deps - Install testing dependencies"
@echo " lint - Run linters"
@echo " lint-fix - Fix basic linting issues"
@echo " help - Show this help message"