Files
Spoolman/tests_integration/docker-compose-postgres.yml
Donkie e3c5f3fc1d Make the integration test suite runnable under Podman
Running tests_integration against rootless Podman surfaced three issues; none
affect the Docker/CI path:

- run.py: add a SPOOLMAN_CONTAINER_ENGINE env var (defaults to "docker") so the
  build/compose commands can be driven by podman instead.
- Dockerfile: drop `--chown=app:app` from the builder-stage COPYs. The "app"
  user only exists in the runner stage; Docker/BuildKit tolerated the dangling
  reference but Podman rejects it. Final ownership is unchanged — it is set when
  the files are copied into the runner stage.
- docker-compose-postgres.yml: add a pg_isready healthcheck and gate spoolman on
  `condition: service_healthy`, matching the mariadb/cockroachdb compose files.
  Without it spoolman raced postgres' initdb and died on connection-refused
  before running migrations.

Verified: full 4-DB suite (sqlite/postgres/mariadb/cockroachdb) green via
`SPOOLMAN_CONTAINER_ENGINE=podman uv run poe itest` — 223 tests each.
2026-07-06 12:16:17 +02:00

36 lines
824 B
YAML

version: '3.8'
services:
db:
image: postgres:11-alpine
environment:
- POSTGRES_PASSWORD=abc
- TZ='GMT+4'
- PGTZ='GMT+4'
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 1s
timeout: 5s
retries: 30
spoolman:
image: donkie/spoolman:test
environment:
- SPOOLMAN_DB_TYPE=postgres
- SPOOLMAN_DB_HOST=db
- SPOOLMAN_DB_PORT=5432
- SPOOLMAN_DB_NAME=postgres
- SPOOLMAN_DB_USERNAME=postgres
- SPOOLMAN_DB_PASSWORD=abc
- SPOOLMAN_LOGGING_LEVEL=INFO
- TZ=Europe/Stockholm
depends_on:
db:
condition: service_healthy
tester:
image: donkie/spoolman-tester:latest
volumes:
- ./tests:/tester/tests
environment:
- DB_TYPE=postgres
depends_on:
- spoolman