feat: add docker enviroment for tests

This commit is contained in:
2026-10-05 23:00:11 +01:00
parent 8b34da4c88
commit e64b7ac548
5 changed files with 52 additions and 4 deletions
+11
View File
@@ -26,6 +26,7 @@ Maintain a deliberately small, self-hosted rota application for a non-profit bar
- SQLite by default
- No frontend build step or JavaScript framework
- Docker Compose for self-hosting
- Docker Compose `test` profile for running tests independently of the host Python environment
## Important files
@@ -57,6 +58,16 @@ python -m compileall -q app
pytest -q
```
Prefer the containerized suite when the host Python environment is uncertain:
```bash
make test-docker
# or
docker compose --profile test run --rm --build tests
```
The `test` target of the `Dockerfile` installs `requirements-dev.txt` on top of the app image and runs `pytest` with throwaway settings (`SECRET_KEY`, `DATABASE_URL`, `INITIAL_ADMIN_PASSWORD`). It mounts no host volumes and does not read `.env`, so it is safe on a fresh clone.
For route/UI changes also start the app and verify `/health`, `/login`, the rota, admin month editor, and swap workflow.
## Security notes