Adding all the tests and fixes to the passengers app

This commit is contained in:
Muluhabt
2026-07-21 13:45:49 +03:00
parent 8ce2d2d874
commit f2ae9c883f
3316 changed files with 15548 additions and 37 deletions

View File

@@ -21,3 +21,21 @@ services:
tmpfs:
# Ephemeral storage — every `docker compose down` wipes the DB. Nothing to clean up.
- /var/lib/postgresql/data
# Broker for the passenger-api payment-events consumer (golevelup RabbitMQ). The API blocks boot
# until this connects. Pre-creates the `payment` vhost that PAYMENT_RABBITMQ_URL points at.
rabbitmq-e2e:
image: rabbitmq:3-management
container_name: edr-passenger-e2e-rmq
environment:
RABBITMQ_DEFAULT_USER: edr
RABBITMQ_DEFAULT_PASS: edr_secret
RABBITMQ_DEFAULT_VHOST: payment
ports:
- "5672:5672"
- "15672:15672"
healthcheck:
test: ["CMD", "rabbitmq-diagnostics", "-q", "ping"]
interval: 5s
timeout: 5s
retries: 20

View File

@@ -10,10 +10,10 @@ export DATABASE_URL="postgresql://edr:edr_secret@localhost:5544/edr_database?sch
export DATABASE_HOST=localhost DATABASE_PORT=5544 DATABASE_NAME=edr_database
export DATABASE_USER=edr DATABASE_PASSWORD=edr_secret DATABASE_SCHEMA=iam
echo "==> Starting test Postgres (port 5544)"
echo "==> Starting test Postgres (5544) + RabbitMQ (5672)"
docker compose -f "$HERE/docker-compose.yml" up -d
echo "==> Waiting for healthy"
echo "==> Waiting for Postgres healthy"
for i in $(seq 1 30); do
status="$(docker inspect --format '{{.State.Health.Status}}' edr-passenger-e2e-db 2>/dev/null || echo none)"
[ "$status" = "healthy" ] && break