File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -173,6 +173,23 @@ jobs:
173173 psql -h localhost -U postgres -d postgres -c "CREATE DATABASE instant_customers" >/dev/null
174174 echo "created instant_customers (db-provider admin target)"
175175
176+ - name : Start NATS with monitoring (queue provider health-checks :8222)
177+ # Mirror of ci.yml's NATS step. internal/providers/queue/local.go
178+ # Provision() health-checks http://localhost:8222/healthz (NATSHost
179+ # defaults to "localhost"), so the TestQueue_* coverage tests need a
180+ # real NATS reachable on localhost:8222. Service containers can't pass
181+ # the `-m` monitoring flag, so we run nats-server here. NATS-DOWN tests
182+ # use the reserved non-resolvable host `nats.test`, so this does not
183+ # collide with their 503 expectations. Without this, the unit-test gate
184+ # below 503s on TestQueue_* and the deploy aborts before building.
185+ run : |
186+ docker run -d --name nats -p 4222:4222 -p 8222:8222 nats:2.10-alpine -m 8222
187+ for i in $(seq 1 15); do
188+ curl -sf http://localhost:8222/healthz >/dev/null && { echo "NATS healthy after ${i}s"; break; }
189+ echo "waiting for NATS monitoring endpoint (${i}/15)"; sleep 1
190+ done
191+ curl -sf http://localhost:8222/healthz >/dev/null || { echo "::error::NATS monitoring never came up"; exit 1; }
192+
176193 - name : Run unit tests (short, no integration deps)
177194 working-directory : api
178195 env :
You can’t perform that action at this time.
0 commit comments