Reliability / Testing
Undocumented APIs need observable failure.
Offline tests protect our logic. Five authenticated contracts reveal when Cookidoo changes the system around it.
Offline tests
Fast feedback on every pull request.
Unit tests use fakes and mocks for schemas, shopping-list grouping, meal planning, image preparation, credentials, and documentation integrity.
python -m pip install -r requirements-dev.txt
ruff check cookidoo_service.py schemas.py server.py tests
python -m pytest -m "not live" --strict-markers -qGitHub Actions runs the suite on Python 3.12 and 3.14 for pull requests, pushes to main, and manual dispatch.
Authenticated contracts
Five checks against the real service.
- Session-cookie authentication and official recipe parsing.
- Shopping-list response contract, including valid empty state.
- Rolling seven-day meal-plan response contract.
- Short-lived customer-image signature generation.
- Temporary recipe copy, GET, ingredient PATCH, instruction PATCH, and DELETE.
set -a
source .env
set +a
COOKIDOO_LIVE_TESTS=1 \
COOKIDOO_LIVE_MUTATIONS=1 \
python -m pytest tests/live -m live --strict-markers -vThe mutation check stores the created recipe ID and deletes it in finally. Never add a scheduled mutation without an equivalent cleanup guarantee.
Daily monitoring
A failed contract becomes an issue.
The Cookidoo live API workflow runs daily at 04:37 UTC, manually, and after relevant API changes reach main.
- Encrypted secrets:
COOKIDOO_EMAILandCOOKIDOO_PASSWORD. - Serialized workflow: a newer run cannot cancel cleanup in progress.
- Failure: open or update
Cookidoo live API regression. - Recovery: close the open regression issue automatically.
The live workflow is intentionally absent from pull-request events and must remain that way.
Regression workflow
Understand the contract before changing the assertion.
- Open the workflow run linked from the regression issue.
- Classify the failure: login, endpoint status, parsing, or response shape.
- Reproduce with the narrowest live test.
- Inspect the current upstream package version and changelog.
- Capture the current authenticated web request when necessary.
- Update service code and add a unit fixture for the new shape.
- Run offline and live tests, then verify cleanup.
Do not weaken an assertion merely to restore a green badge.