feat: add docker enviroment for tests
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user