-
Notifications
You must be signed in to change notification settings - Fork 48
Expand file tree
/
Copy pathMakefile
More file actions
107 lines (86 loc) · 3.67 KB
/
Copy pathMakefile
File metadata and controls
107 lines (86 loc) · 3.67 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
.PHONY: setup quality quality-ci quality-full pre-pr lint-fix lint typecheck test-fast test-full
.PHONY: test-stack-up test-stack-down test-all test-cov test-entity
.PHONY: test-int test-bdd test-e2e creative-formats-refresh
setup:
uv run python scripts/setup-dev.py
# Recapture the reference format fixture from the pinned creative agent. Run only when
# the pin or the agent's catalog changes; the reviewed fixture diff is the drift gate.
# Brings up the pinned agent if needed (idempotent). See issue #1418.
creative-formats-refresh:
@./scripts/creative-agent-stack.sh up
uv run python scripts/refresh-reference-formats.py --url $$(./scripts/creative-agent-stack.sh url)
quality-ci:
uv run ruff format --check .
uv run ruff check .
uv run mypy src/ --config-file=mypy.ini
uv run python .pre-commit-hooks/check_code_duplication.py
uv run python .pre-commit-hooks/check-gam-auth-support.py
uv run python scripts/hooks/check_response_attribute_access.py $$(find src -name '*.py')
uv run python .pre-commit-hooks/check_roundtrip_tests.py
uv run python scripts/verify_feature_error_codes.py --uc UC-002 UC-003
uv run python .pre-commit-hooks/check_route_conflicts.py
uv run python .pre-commit-hooks/check_type_ignore_count.py
uv run python .pre-commit-hooks/check_ruff_complexity_count.py
uv run python .pre-commit-hooks/check_mypy_untyped_defs_count.py
uv run python .pre-commit-hooks/check_docs_links.py
uv run python .pre-commit-hooks/check_hardcoded_urls.py $$(find templates static -type f \( -name '*.html' -o -name '*.js' \) 2>/dev/null)
quality:
$(MAKE) quality-ci
uv run pytest tests/unit/ -x
quality-full:
$(MAKE) quality
./run_all_tests.sh ci
pre-pr: quality-full
@echo ""
@echo "✅ All CI checks passed — safe to push and create PR"
lint-fix:
uv run ruff format .
uv run ruff check --fix .
lint:
uv run ruff check .
typecheck:
uv run mypy src/ --config-file=mypy.ini
test-fast:
uv run pytest tests/unit/ -x
test-full:
./run_all_tests.sh ci
# ─── tox-based test targets ──────────────────────────────────────
test-stack-up:
@echo "Starting Docker test stack..."
@./scripts/test-stack.sh up
test-stack-down:
@echo "Stopping Docker test stack..."
@./scripts/test-stack.sh down
test-all: test-stack-up
tox -p; rc=$$?; $(MAKE) test-stack-down; exit $$rc
test-cov:
@echo "Opening coverage report..."
@open htmlcov/index.html 2>/dev/null || xdg-open htmlcov/index.html 2>/dev/null || echo "Open htmlcov/index.html in your browser"
# ─── Single-suite convenience targets ──────────────────────────
# Usage:
# make test-int TARGET=tests/integration/test_products.py
# make test-int TARGET=tests/integration/test_products.py ARGS="-k test_brand -v"
# make test-bdd TARGET=tests/bdd/ ARGS="-k uc004"
# make test-e2e TARGET=tests/e2e/test_mcp.py
test-int:
ifndef TARGET
$(error TARGET is required. Usage: make test-int TARGET=tests/integration/test_file.py)
endif
scripts/run-test.sh --db $(TARGET) $(ARGS)
test-bdd:
ifndef TARGET
scripts/run-test.sh --db tests/bdd/ $(ARGS)
else
scripts/run-test.sh --db $(TARGET) $(ARGS)
endif
test-e2e:
ifndef TARGET
$(error TARGET is required. Usage: make test-e2e TARGET=tests/e2e/test_file.py)
endif
scripts/run-test.sh --stack $(TARGET) $(ARGS)
# ─── Entity-scoped test runs ────────────────────────────────────
# Usage: make test-entity ENTITY=delivery
# make test-entity ENTITY="creative and unit"
ENTITY ?= ""
test-entity:
uv run pytest tests/unit/ tests/integration/ tests/e2e/ tests/admin/ -m "$(ENTITY)" -x -v