@@ -117,20 +117,16 @@ check-env:
117
117
118
118
119
119
# =============================================================================
120
- # ▶️ SERVE & TESTING
120
+ # ▶️ SERVE
121
121
# =============================================================================
122
- # help: ▶️ SERVE & TESTING
122
+ # help: ▶️ SERVE
123
123
# help: serve - Run production Gunicorn server on :4444
124
124
# help: certs - Generate self-signed TLS cert & key in ./certs (won't overwrite)
125
125
# help: serve-ssl - Run Gunicorn behind HTTPS on :4444 (uses ./certs)
126
126
# help: dev - Run fast-reload dev server (uvicorn)
127
127
# help: run - Execute helper script ./run.sh
128
- # help: smoketest - Run smoketest.py --verbose (build container, add MCP server, test endpoints)
129
- # help: test - Run unit tests with pytest
130
- # help: test-curl - Smoke-test API endpoints with curl script
131
- # help: pytest-examples - Run README / examples through pytest-examples
132
128
133
- .PHONY : serve serve-ssl dev run test test-curl pytest-examples certs clean
129
+ .PHONY : serve serve-ssl dev run certs
134
130
135
131
# # --- Primary servers ---------------------------------------------------------
136
132
serve :
@@ -159,25 +155,6 @@ certs: ## Generate ./certs/cert.pem & ./certs/key.pem
159
155
fi
160
156
chmod 640 certs/key.pem
161
157
162
- # # --- Testing -----------------------------------------------------------------
163
- smoketest :
164
- @echo " 🚀 Running smoketest…"
165
- @./smoketest.py --verbose || { echo " ❌ Smoketest failed!" ; exit 1; }
166
- @echo " ✅ Smoketest passed!"
167
-
168
- test :
169
- @echo " 🧪 Running tests..."
170
- @test -d " $( VENV_DIR) " || make venv
171
- @/bin/bash -c " source $( VENV_DIR) /bin/activate && python3 -m pip install pytest pytest-asyncio pytest-cov -q && python3 -m pytest --maxfail=0 --disable-warnings -v"
172
-
173
- pytest-examples :
174
- @echo " 🧪 Testing README examples..."
175
- @test -d " $( VENV_DIR) " || make venv
176
- @/bin/bash -c " source $( VENV_DIR) /bin/activate && python3 -m pip install pytest pytest-examples -q && pytest -v test_readme.py"
177
-
178
- test-curl :
179
- ./test_endpoints.sh
180
-
181
158
# # --- House-keeping -----------------------------------------------------------
182
159
# help: clean - Remove caches, build artefacts, virtualenv, docs, certs, coverage, SBOM, etc.
183
160
.PHONY : clean
@@ -195,16 +172,32 @@ clean:
195
172
196
173
197
174
# =============================================================================
198
- # 📊 COVERAGE & METRICS
175
+ # 🧪 TESTING
199
176
# =============================================================================
200
- # help: 📊 COVERAGE & METRICS
177
+ # help: 🧪 TESTING
178
+ # help: smoketest - Run smoketest.py --verbose (build container, add MCP server, test endpoints)
179
+ # help: test - Run unit tests with pytest
201
180
# help: coverage - Run tests with coverage, emit md/HTML/XML + badge
202
- # help: pip-licenses - Produce dependency license inventory (markdown)
203
- # help: scc - Quick LoC/complexity snapshot with scc
204
- # help: scc-report - Generate HTML LoC & per-file metrics with scc
205
- .PHONY : coverage pip-licenses scc scc-report
181
+ # help: test-curl - Smoke-test API endpoints with curl script
182
+ # help: pytest-examples - Run README / examples through pytest-examples
183
+
184
+ .PHONY : smoketest test coverage pytest-examples test-curl
185
+
186
+ # # --- Automated checks --------------------------------------------------------
187
+ smoketest :
188
+ @echo " 🚀 Running smoketest…"
189
+ @./smoketest.py --verbose || { echo " ❌ Smoketest failed!" ; exit 1; }
190
+ @echo " ✅ Smoketest passed!"
191
+
192
+ test :
193
+ @echo " 🧪 Running tests…"
194
+ @test -d " $( VENV_DIR) " || $(MAKE ) venv
195
+ @/bin/bash -c " source $( VENV_DIR) /bin/activate && \
196
+ python3 -m pip install -q pytest pytest-asyncio pytest-cov && \
197
+ python3 -m pytest --maxfail=0 --disable-warnings -v"
206
198
207
199
coverage :
200
+ @test -d " $( VENV_DIR) " || $(MAKE ) venv
208
201
@mkdir -p $(TEST_DOCS_DIR )
209
202
@printf " # Unit tests\n\n" > $(DOCS_DIR ) /docs/test/unittest.md
210
203
@/bin/bash -c " source $( VENV_DIR) /bin/activate && \
@@ -217,13 +210,30 @@ coverage:
217
210
@/bin/bash -c " source $( VENV_DIR) /bin/activate && \
218
211
coverage report --format=markdown -m --no-skip-covered \
219
212
>> $(DOCS_DIR ) /docs/test/unittest.md"
220
- @/bin/bash -c " source $( VENV_DIR) /bin/activate && \
221
- coverage html -d $(COVERAGE_DIR ) --include=app/* "
213
+ @/bin/bash -c " source $( VENV_DIR) /bin/activate && coverage html -d $( COVERAGE_DIR) --include=app/*"
222
214
@/bin/bash -c " source $( VENV_DIR) /bin/activate && coverage xml"
223
- @/bin/bash -c " source $( VENV_DIR) /bin/activate && \
224
- coverage-badge -fo $(DOCS_DIR ) /docs/images/coverage.svg"
215
+ @/bin/bash -c " source $( VENV_DIR) /bin/activate && coverage-badge -fo $( DOCS_DIR) /docs/images/coverage.svg"
225
216
@echo " ✅ Coverage artefacts: md, HTML in $( COVERAGE_DIR) , XML & badge ✔"
226
217
218
+ pytest-examples :
219
+ @echo " 🧪 Testing README examples…"
220
+ @test -d " $( VENV_DIR) " || $(MAKE ) venv
221
+ @/bin/bash -c " source $( VENV_DIR) /bin/activate && \
222
+ python3 -m pip install -q pytest pytest-examples && \
223
+ pytest -v test_readme.py"
224
+
225
+ test-curl :
226
+ ./test_endpoints.sh
227
+
228
+ # =============================================================================
229
+ # 📊 METRICS
230
+ # =============================================================================
231
+ # help: 📊 METRICS
232
+ # help: pip-licenses - Produce dependency license inventory (markdown)
233
+ # help: scc - Quick LoC/complexity snapshot with scc
234
+ # help: scc-report - Generate HTML LoC & per-file metrics with scc
235
+ .PHONY : pip-licenses scc scc-report
236
+
227
237
pip-licenses :
228
238
@/bin/bash -c " source $( VENV_DIR) /bin/activate && python3 -m uv pip install pip-licenses"
229
239
@mkdir -p $(dir $(LICENSES_MD ) )
@@ -700,9 +710,7 @@ dockle:
700
710
701
711
# help: hadolint - Lint Containerfile/Dockerfile(s) with hadolint
702
712
.PHONY : hadolint
703
- HADOFILES := Containerfile Dockerfile Dockerfile.*
704
-
705
- # Which files to check (edit as you like)
713
+ # List of Containerfile/Dockerfile patterns to scan
706
714
HADOFILES := Containerfile Containerfile.* Dockerfile Dockerfile.*
707
715
708
716
hadolint :
0 commit comments