fix: add coverage configuration and test infrastructure for push and utils modules

Add coverage tooling to CI workflow, Makefile, and pyproject.toml dependencies.
Introduce new test suites for push notification helpers (base64 encoding, HKDF,
authorization JWT) and utility functions (safe_next, strip_html, mention extraction,
badge/xp awarding, milestone checks) with a session-scoped local_db fixture.
This commit is contained in:
2026-06-05 18:33:35 +00:00
parent f05b6a4faf
commit 1eeb789e9c
7 changed files with 153 additions and 4 deletions
+19 -1
View File
@@ -7,7 +7,7 @@ LOCUST_SPAWN_RATE ?= 5
LOCUST_RUN_TIME ?= 120s
DEVPLACE_RATE_LIMIT ?= 1000000
.PHONY: install dev clean test test-headed locust locust-headless
.PHONY: install dev clean test test-headed coverage coverage-headed coverage-html locust locust-headless
install:
pip install -e .
@@ -24,6 +24,24 @@ test:
test-headed:
PLAYWRIGHT_HEADLESS=0 python -m pytest tests/ -v --tb=line -x
coverage:
rm -f .coverage .coverage.*
COVERAGE_PROCESS_START=$(CURDIR)/.coveragerc PLAYWRIGHT_HEADLESS=1 \
python -m coverage run -m pytest tests/ -p no:xdist --tb=line
python -m coverage combine
python -m coverage report
coverage-headed:
rm -f .coverage .coverage.*
COVERAGE_PROCESS_START=$(CURDIR)/.coveragerc PLAYWRIGHT_HEADLESS=0 \
python -m coverage run -m pytest tests/ -p no:xdist --tb=line
python -m coverage combine
python -m coverage report
coverage-html: coverage
python -m coverage html
@echo "Report written to htmlcov/index.html"
locust:
export DEVPLACE_DATABASE_URL="sqlite:///$(LOCUST_DB)"; \
export DEVPLACE_RATE_LIMIT=$(DEVPLACE_RATE_LIMIT); \