-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
174 lines (129 loc) · 5.32 KB
/
Makefile
File metadata and controls
174 lines (129 loc) · 5.32 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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
SHELL := /bin/sh
PYTHON ?= python3
GO ?= go
PYTEST ?= pytest
BATS ?= bats
ifneq ("$(wildcard .venv/bin/python)","")
PYTHON := .venv/bin/python
endif
ifneq ("$(wildcard .venv/bin/pytest)","")
PYTEST := .venv/bin/pytest
endif
GOPATH ?= $(shell $(GO) env GOPATH)
GO_PATCH_COVER ?= $(GOPATH)/bin/go-patch-cover
MODULES = $(shell find . -type f -name "go.mod" -not -path "*/.*/*" -not -path "*/vendor/*" -exec dirname {} \;)
.PHONY: benchmark benchmark-modkit benchmark-nestjs benchmark-baseline benchmark-wire benchmark-fx benchmark-do report test test-go test-python test-shell test-scripts test-coverage test-coverage-go test-coverage-python test-patch-coverage tools setup-dev-env setup-dev-env-ci setup-dev-env-ci-scripts parity-check parity-check-modkit parity-check-nestjs benchmark-fingerprint-check benchmark-limits-check benchmark-manifest-check benchmark-raw-schema-check benchmark-summary-schema-check benchmark-schema-validate benchmark-stats-check benchmark-variance-check benchmark-benchstat-check ci-benchmark-quality-check workflow-concurrency-check workflow-budget-check workflow-inputs-check todo-debt-check report-disclaimer-check methodology-changelog-check publication-sync-check
benchmark:
bash scripts/run-all.sh
benchmark-modkit:
bash scripts/run-single.sh modkit
benchmark-nestjs:
bash scripts/run-single.sh nestjs
benchmark-baseline:
bash scripts/run-single.sh baseline
benchmark-wire:
bash scripts/run-single.sh wire
benchmark-fx:
bash scripts/run-single.sh fx
benchmark-do:
bash scripts/run-single.sh do
report:
$(PYTHON) scripts/generate-report.py
test:
$(MAKE) test-go
$(MAKE) test-scripts
test-go:
$(GO) test ./...
test-python:
@if ! command -v $(PYTEST) >/dev/null 2>&1; then \
echo "pytest not found; install with: $(PYTHON) -m pip install pytest pytest-cov"; \
exit 1; \
fi
$(PYTEST) tests/unit
test-shell:
@if ! command -v $(BATS) >/dev/null 2>&1; then \
echo "bats not found; install bats-core before running shell tests"; \
exit 1; \
fi
$(BATS) tests/integration
test-scripts:
$(MAKE) test-python
$(MAKE) test-shell
test-coverage:
$(MAKE) test-coverage-go
test-coverage-go:
@mkdir -p .coverage
@echo "mode: atomic" > .coverage/coverage.out
@for mod in $(MODULES); do \
echo "Testing coverage for module: $$mod"; \
(cd $$mod && $(GO) test -coverprofile=profile.out -covermode=atomic ./...) || exit 1; \
if [ -f $$mod/profile.out ]; then \
tail -n +2 $$mod/profile.out >> .coverage/coverage.out; \
rm $$mod/profile.out; \
fi; \
done
@printf "\nTotal Coverage:\n"
@$(GO) tool cover -func=.coverage/coverage.out | grep "total:"
test-coverage-python:
@if ! command -v $(PYTEST) >/dev/null 2>&1; then \
echo "pytest not found; install with: $(PYTHON) -m pip install pytest pytest-cov"; \
exit 1; \
fi
$(PYTEST) tests/unit --cov=scripts --cov-report=term-missing
test-patch-coverage: tools test-coverage
@echo "Comparing against origin/main..."
@git diff -U0 --no-color origin/main...HEAD > .coverage/diff.patch
@$(GO_PATCH_COVER) .coverage/coverage.out .coverage/diff.patch > .coverage/patch_coverage.out
@echo "Patch Coverage Report:"
@cat .coverage/patch_coverage.out
tools:
@echo "Installing development tools..."
@$(GO) install github.com/seriousben/go-patch-cover/cmd/go-patch-cover@latest
@echo "Done: go-patch-cover installed"
setup-dev-env:
bash scripts/setup-dev-env.sh
setup-dev-env-ci:
bash scripts/setup-dev-env.sh --ci --subset core,python-test,go-tools
setup-dev-env-ci-scripts:
bash scripts/setup-dev-env.sh --ci --subset core,python-test,shell-test,benchmark-tools
parity-check:
TARGET="$(PARITY_TARGET)" bash scripts/parity-check.sh
parity-check-modkit:
TARGET=http://localhost:3001 bash scripts/parity-check.sh
parity-check-nestjs:
TARGET=http://localhost:3002 bash scripts/parity-check.sh
benchmark-fingerprint-check:
$(PYTHON) scripts/environment-manifest.py check-fingerprint --file results/latest/environment.fingerprint.json
benchmark-limits-check:
$(PYTHON) scripts/environment-manifest.py check-limits --compose docker-compose.yml
benchmark-manifest-check:
$(PYTHON) scripts/environment-manifest.py check-manifest --file results/latest/environment.manifest.json
benchmark-raw-schema-check:
$(PYTHON) scripts/validate-result-schemas.py raw-check
benchmark-summary-schema-check:
$(PYTHON) scripts/validate-result-schemas.py summary-check
benchmark-schema-validate:
$(MAKE) benchmark-raw-schema-check
$(MAKE) benchmark-summary-schema-check
benchmark-stats-check:
$(PYTHON) scripts/benchmark-quality-check.py stats-check
benchmark-variance-check:
$(PYTHON) scripts/benchmark-quality-check.py variance-check
benchmark-benchstat-check:
$(PYTHON) scripts/benchmark-quality-check.py benchstat-check
ci-benchmark-quality-check:
$(PYTHON) scripts/benchmark-quality-check.py ci-check
report-disclaimer-check:
$(PYTHON) scripts/publication-policy-check.py report-disclaimer-check
methodology-changelog-check:
$(PYTHON) scripts/publication-policy-check.py methodology-changelog-check
publication-sync-check:
$(PYTHON) scripts/publication-policy-check.py publication-sync-check
workflow-concurrency-check:
$(PYTHON) scripts/workflow-policy-check.py concurrency-check
workflow-budget-check:
$(PYTHON) scripts/workflow-policy-check.py budget-check
workflow-inputs-check:
$(PYTHON) scripts/workflow-policy-check.py inputs-check
todo-debt-check:
$(PYTHON) scripts/todo-debt-check.py