Add healthcheck wait and container logging to integration tests

Integration tests were failing because the workflow didn't wait for containers
to be healthy before running Playwright tests.

Changes:
- Wait for mock-github container healthcheck to pass (60s timeout)
- Wait for pulse-test-server healthcheck to pass (60s timeout)
- Output container logs if healthcheck fails for debugging
- Remove arbitrary sleep 20 in favor of actual healthcheck verification

This will help diagnose why the pulse server isn't responding on port 7655.

Related to workflow run 19281966710.
This commit is contained in:
rcourtman 2025-11-12 00:26:36 +00:00
parent 295ba31022
commit 8cb3a9ee67

View file

@ -89,8 +89,23 @@ jobs:
MOCK_STALE_RELEASE: "false"
run: |
docker-compose -f docker-compose.test.yml up -d
# Allow services to settle before running Playwright
sleep 20
# Wait for services to be healthy
echo "Waiting for mock-github to be healthy..."
timeout 60 sh -c 'until docker inspect --format="{{json .State.Health.Status}}" pulse-mock-github | grep -q "healthy"; do sleep 2; done' || {
echo "Mock GitHub failed to become healthy"
docker logs pulse-mock-github
exit 1
}
echo "Waiting for pulse-test-server to be healthy..."
timeout 60 sh -c 'until docker inspect --format="{{json .State.Health.Status}}" pulse-test-server | grep -q "healthy"; do sleep 2; done' || {
echo "Pulse server failed to become healthy"
docker logs pulse-test-server
exit 1
}
echo "All services healthy, running tests..."
npx playwright test tests/01-happy-path.spec.ts tests/02-bad-checksums.spec.ts --reporter=list
docker-compose -f docker-compose.test.yml down -v