Testing¶
python3.12 -m venv .venv && source .venv/bin/activate
make install # pip install -e ".[dev]"
make lint # ruff check + format --check
make test # pytest
make run # uvicorn :8000
Rules¶
- Tests never hit the network:
httpx.MockTransport+tests/fixtures/*.xml;tests/conftest.pyfails anyLLMClientbuilt without a transport. - The fake LLM (
app/summarize/fake.py,FakeLLM(mode, chat_mode=...)) covers briefs, reports and chat deterministically; HTTP form:python -m app.summarize.fake_server. - Cluster fixtures are labelled (
tests/fixtures/demo/stories.yaml); add live false merges/misses there sotests/test_cluster.pycovers them. - API changes:
make openapiregeneratesdocs/openapi.v1.json;tests/test_api_v1.pyfails while it's stale. - Docs changes:
make docsrunsscripts/check_docs.py+mkdocs build --strict.
Docker e2e¶
python scripts/docker_e2e.py [--timeout 900] [--keep] [--out timeline.txt] —
fresh volume, fixture feed/search servers, fake LLM over HTTP; waits for
published stories and asserts none unpublished reach the feed. CI job
docker-e2e; works on Windows (stdlib only).