ci: e2e — static in-network IP for the app (bypass DNS) + post-deploy chromium diagnostics

This commit is contained in:
2026-09-19 07:53:22 +00:00
parent 0bfbd2a2e8
commit e694011302
5 changed files with 60 additions and 18 deletions
+18 -17
View File
@@ -17,19 +17,30 @@ jobs:
# The runner provides a working docker CLI out of the box (full-dind) — no endpoint
# resolution needed. Job and app containers share the daemon, so put them on one
# user-defined network and reach the app by service DNS (the job's netns has no
# default route here, so host-IP URLs are unreliable). The alias `app` is declared
# in docker-compose.ci.yml.
# user-defined network with a pinned subnet; the app gets a STATIC IP (172.39.0.10,
# declared in docker-compose.ci.yml) because Chromium got ERR_SSL_PROTOCOL_ERROR via
# the DNS alias while node-side HTTP to the same name worked — bypassing DNS removes
# that variable entirely. A stale network with a different subnet is recreated.
- name: Prepare e2e network
run: |
set -u
docker network inspect flight-ci-e2e >/dev/null 2>&1 || docker network create flight-ci-e2e
SUBNET=172.39.0.0/24
if docker network inspect flight-ci-e2e >/dev/null 2>&1; then
cur=$(docker network inspect flight-ci-e2e --format '{{(index .IPAM.Config 0).Subnet}}')
if [ "$cur" != "$SUBNET" ]; then
echo "stale flight-ci-e2e with subnet $cur — recreating with $SUBNET"
docker network rm flight-ci-e2e || true
docker network create --subnet "$SUBNET" flight-ci-e2e
fi
else
docker network create --subnet "$SUBNET" flight-ci-e2e
fi
if ! docker network connect flight-ci-e2e "$(hostname)"; then
echo "::error::failed to attach job container '$(hostname)' to flight-ci-e2e — the job must run in a container on the shared daemon (check runner config)" >&2
exit 1
fi
docker network inspect flight-ci-e2e --format 'containers on flight-ci-e2e: {{range .Containers}}{{.Name}} {{end}}'
echo "E2E_BASE_URL=http://app:3000" >> "$GITHUB_ENV"
echo "E2E_BASE_URL=http://172.39.0.10:3000" >> "$GITHUB_ENV"
- name: Setup Node
uses: actions/setup-node@v4
@@ -132,18 +143,8 @@ jobs:
# in-network app host out of any proxy path.
NO_PROXY: app,localhost,127.0.0.1,.kkhost.pl
no_proxy: app,localhost,127.0.0.1,.kkhost.pl
run: |
# --- e2e connectivity diagnostics (non-fatal; evidence for ERR_SSL_PROTOCOL_ERROR hunt) ---
echo "=== proxy env ==="
env | grep -iE '^(http_proxy|https_proxy|all_proxy|no_proxy)=' || echo "(none set)"
echo "=== /etc/hosts ==="
cat /etc/hosts
echo "=== DNS for app ==="
getent hosts app || echo "getent: no result"
echo "=== curl http://app:3000/api/version (node-side) ==="
timeout 15 curl -sv http://app:3000/api/version 2>&1 | head -40 || true
# --- end diagnostics ---
npx playwright test
# Connectivity diagnostics now run post-deploy in e2e/ci-diagnostics.ts (globalSetup).
run: npx playwright test
# The daemon is shared with production — never leave our stack or network behind.
# -v drops the named DB volume so every run seeds fresh (no schema drift between PRs).