From 0c4e305cec3b29686d59599abb07b874fe98d88a Mon Sep 17 00:00:00 2001 From: rcourtman Date: Wed, 12 Nov 2025 09:01:54 +0000 Subject: [PATCH] Add port mapping verification before integration tests Tests were failing with connection refused even though healthcheck passed. This suggests the Docker port mapping may not be established when healthcheck passes. Add explicit verification step that curls localhost:7655 from the host before running tests. This will reveal if the issue is: 1. Port mapping not working (server healthy inside container but unreachable from host) 2. Server not actually running/listening 3. Timing issue where port mapping needs more time to establish If verification fails, output container logs to help diagnose the root cause. Related to #695 --- .github/workflows/release.yml | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4acc160..7ec5a70 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -105,7 +105,27 @@ jobs: exit 1 } - echo "All services healthy, running tests..." + echo "All services healthy, verifying port mapping..." + # Test that the host can actually reach the container through port mapping + for i in 1 2 3 4 5; do + if curl -f -s http://localhost:7655/api/health > /dev/null 2>&1; then + echo "Port mapping verified: Pulse server is reachable from host" + break + elif [ $i -eq 5 ]; then + echo "ERROR: Port mapping failed - cannot reach Pulse server from host" + echo "Container healthcheck passed, but host cannot connect via localhost:7655" + echo "Pulse server logs:" + docker logs pulse-test-server || true + echo "Mock GitHub logs:" + docker logs pulse-mock-github || true + exit 1 + else + echo "Attempt $i: Server not yet reachable from host, waiting..." + sleep 2 + fi + done + + echo "Running integration 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