/datumpin:testing-conventionsfrom datumpin
Tests - markers (unit/integration/contract), smoke tests, naming, factories, CI wiring, the test README bug log, running pytest. Test-first loop is tdd.
Ships in datumpin. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Test-first practice, seams, anti-patterns and mocking: call the Skill tool with tdd. This skill holds the Datumpin conventions around it.
Every test carries exactly one tier marker, so CI can select it:
[pytest]
testpaths = tests
python_files = test_*.py
addopts = --durations=10
markers =
unit: pure-function tests, no DB or network
integration: router/CRUD tests against a real test DB
contract: cross-service tests against a live dependent service
--durations=10 stays on so slow tests surface early. Directories mirror the tiers: tests/unit/, tests/integration/, tests/contract/.
A built image's own check sits outside the pytest tiers: a shell script at <service>/tests/smoke-image.sh that takes the image tag, starts the image (and any stub it needs), and checks over HTTP what only the built image can show: it starts, serves its health route and key paths, and reads its mounted config. It checks only what the built image shows.
bash <service>/tests/smoke-image.sh <tag> after building the image.docker-image's smoke-test input, before the push. The script contract lives in gitea-workflows, Images; DEVKIT's ci/tests/smoke-example.sh is the shape to copy.test_<action>_<condition>_<expected_outcome>, so the name says what broke:
test_create_common_addressing_ambiguous_source_returns_409
Test-data builders live in one factories.py (make_customer, make_source, make_addressing). Frontend tests mock the API boundary module (see tdd, mocking.md).
unit and integration.@pytest.mark.skipif(condition) and documents the reason in the CI/runner doc.gitea-workflows).A suite's README names the specific real bugs it caught, with root cause and fix, so it reads as an audit trail:
`_footer.py::apply_sort` raised TypeError on an unrecognized sort field
instead of the no-op its docstring promised — fixed, with a regression test.
Every change is built and tested in dev, the laptop's containers (gitea-workflows, Environments), before it is pushed; CI then runs the same tests again, and servers run none (gitea-workflows, Environments). The commands, per repo kind; for an app, <dev> is --env-file .env.<app>-<instance>.dev -f docker-compose.dev.yml --profile <instance>:
| Repo kind | Start the dev stack | Run the tests |
|---|---|---|
| FastAPI app (BDS, AHJ and CURATOR backends) | docker compose <dev> up -d --build | docker compose <dev> exec <service> python -m pytest -q -m "unit or integration", with <service> such as dp-api, ahj-dp-backend, curator-dp-backend |
| React frontend (AHJ, CURATOR) | the same stack | docker compose <dev> exec <frontend service> npm test, with the service such as ahj-dp-frontend, curator-dp-frontend |
| Package monorepo (PACKAGES) | docker compose -f docker-compose.dev.yml up -d | docker compose -f docker-compose.dev.yml exec <package service> python -m pytest tests/; for a JS package npm test or node --test, as its QUICKSTART lists |
| DEVKIT | none | ci/local-check.sh: every check DEVKIT's CI runs |
The marker set matches CI's python-tests (unit or integration); contract tests stay manual.
sys.path and local and CI runs match.tail or head returns the last command's status, so a killed run (exit 137) looks like success. Redirect long output to a file and read the file.pid and patch the kill call. A mock pid coerces to 1, so os.killpg/os.kill would signal process group 1, which kills the container's own processes when it runs as root.pytest-cov) at the start of a project.pytest --markers lists the three tiers, and every test carries exactly one.python -m pytest -q exits 0 inside the container, and the test README's count matches.unit and integration and excludes contract.<service>/tests/smoke-image.sh, wired through smoke-test.What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
31 skills in this plugin
/alembic-migrationsAlembic migrations in a FastAPI/SQLAlchemy service - env.py, SQLite batch mode, container-only commands. Use when adding or reviewing a migration./alignAlign - find and fix drift between code, tickets and plans. Use when a repo joins the workflow, direction changes, a milestone closes, or to clean the backlog./api-documentationDocumenting HTTP APIs - endpoint docstrings, router READMEs, docs/reference/api. Use when adding or editing a FastAPI route.npx claudepluginhub jago971/dp-cli --plugin datumpin