-
Notifications
You must be signed in to change notification settings - Fork 36
Expand file tree
/
Copy pathMakefile
More file actions
137 lines (110 loc) · 3.87 KB
/
Makefile
File metadata and controls
137 lines (110 loc) · 3.87 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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
.PHONY: help install install-dev sync test test-unit test-integration test-validation test-cfn clean format lint check
# Default target
help:
@echo "Scylla Machine Image - Makefile Commands"
@echo "========================================"
@echo ""
@echo "Setup:"
@echo " make install Install dependencies using uv"
@echo " make install-dev Install all dependencies including dev tools"
@echo " make sync Sync dependencies from lock file"
@echo ""
@echo "Testing:"
@echo " make test Run all tests (excluding integration)"
@echo " make test-unit Run unit tests only"
@echo " make test-validation Run validation tests (CloudFormation)"
@echo " make test-integration Run integration tests (requires AWS creds)"
@echo " make test-cfn Run CloudFormation tests"
@echo " make test-all Run ALL tests including integration"
@echo ""
@echo "Code Quality:"
@echo " make format Format code with black and ruff"
@echo " make lint Run linters (ruff)"
@echo " make check Run all checks (lint + type check)"
@echo ""
@echo "Cleanup:"
@echo " make clean Remove cache and temporary files"
@echo ""
@echo "Environment Variables:"
@echo " AWS_REGION=us-east-1"
@echo " RUN_CFN_INTEGRATION_TESTS=1 (enable integration tests)"
# Installation targets
install:
uv sync --extra test --extra aws
install-dev:
uv sync --all-extras
sync:
uv sync
# Testing targets
test:
uv run pytest tests/ -m "not integration" -v
test-unit:
uv run pytest tests/ -m "unit" -v
test-validation:
uv run pytest tests/test_cloudformation.py -m "validation" -v
test-integration:
@echo "⚠️ WARNING: This will create AWS resources that may incur costs!"
@sleep 2
RUN_CFN_INTEGRATION_TESTS=1 uv run pytest tests/ -m "integration" -v -s
test-cfn:
uv run pytest tests/test_cloudformation.py -v
test-all:
@echo "⚠️ WARNING: This will create AWS resources that may incur costs!"
@sleep 2
RUN_CFN_INTEGRATION_TESTS=1 uv run pytest tests/ -v -s
# Code quality targets
format:
uv run ruff format lib/ tests/ tools/
uv run ruff check --fix lib/ tests/ tools/
lint:
uv run ruff check lib/ tests/ tools/
type-check:
uv run mypy lib/ --ignore-missing-imports
check: lint type-check
@echo "✅ All checks passed!"
# Cleanup targets
clean:
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 ".ruff_cache" -exec rm -rf {} + 2>/dev/null || true
find . -type d -name ".mypy_cache" -exec rm -rf {} + 2>/dev/null || true
find . -type f -name "*.pyc" -delete 2>/dev/null || true
rm -rf build/ dist/ htmlcov/ .coverage 2>/dev/null || true
@echo "✅ Cleanup complete!"
# UV-specific targets
uv-lock:
uv lock
uv-update:
uv lock --upgrade
uv-add:
@read -p "Package name: " pkg; \
uv add $$pkg
uv-add-dev:
@read -p "Package name: " pkg; \
uv add --dev $$pkg
# Quick test runners for specific scenarios
quick-test:
uv run pytest tests/ -m "not slow and not integration" -v
watch-test:
uv run pytest-watch tests/ -m "not integration"
# CloudFormation specific
cfn-validate:
uv run pytest tests/test_cloudformation.py::TestCloudFormationTemplate -v
cfn-integration:
@echo "⚠️ Creating AWS CloudFormation stack for testing..."
@sleep 2
RUN_CFN_INTEGRATION_TESTS=1 uv run pytest tests/test_cloudformation.py::TestCloudFormationDeployment -v -s
cfn-example:
uv run python tests/example_cfn_usage.py
# Coverage
coverage:
uv run pytest tests/ --cov=lib --cov-report=html --cov-report=term -m "not integration"
@echo "Coverage report generated in htmlcov/index.html"
# Build
build:
uv build
# Run specific test
run-test:
@read -p "Test path (e.g., tests/test_file.py::test_name): " test_path; \
uv run pytest $$test_path -v -s