Files
papercrate/docs/testing.md
T
nils 2713dcb047
ci / docker (backend, backend/Dockerfile, backend) (push) Successful in 15m15s
ci / docker (frontend, frontend/Dockerfile, frontend) (push) Successful in 15m14s
Initial commit
2025-10-17 18:07:39 +02:00

708 B

Integration Test Setup

The backend integration tests talk to a real Postgres database. To spin up an ephemeral instance locally, use the dedicated compose file:

docker compose -f docker-compose.test.yml up -d

This starts Postgres on port 5433 with the database/user both named papercrate and password papercrate_test. Point the test harness at it:

export TEST_DATABASE_URL=postgres://papercrate:papercrate_test@localhost:5433/papercrate_test

Run the tests as usual:

cargo test

When you are done, stop the container:

docker compose -f docker-compose.test.yml down

The compose file uses a tmpfs volume, so each run starts with a clean database.