ci: run the integration suites inside the stack's own network
All checks were successful
Build and deploy / Validate source (push) Successful in 4s
Build and deploy / Integration suite on a real stack (push) Successful in 1m12s
Build and deploy / Secret scan and release gate (push) Successful in 5s
Build and deploy / Publish images and notify Portainer (push) Successful in 1m50s
All checks were successful
Build and deploy / Validate source (push) Successful in 4s
Build and deploy / Integration suite on a real stack (push) Successful in 1m12s
Build and deploy / Secret scan and release gate (push) Successful in 5s
Build and deploy / Publish images and notify Portainer (push) Successful in 1m50s
The suites connected to localhost:<published port>, which works for a developer but not on a containerised runner: published ports live in the host's network namespace, so the runner container gets connection refused. Run them from inside the stack instead, against the gateway by service name. SITE_BASE_URL and SITE_HOST_HEADER make that possible without weakening what is under test: the Host stays "localhost", so the gateway's host check and TrustedHostMiddleware see exactly what a localhost run produces, and the tests that deliberately send their own Host still override it. S3_PUBLIC_ENDPOINT has to agree, because presigned URLs are signed against it and the signature covers the host, so it cannot be rewritten afterwards. CI points the whole stack at http://storage:9000 so the URLs it hands out are reachable by whoever follows them. The browser suites still need Chrome to reach the stack from the runner, which the same namespace split prevents. They now check reachability and skip with a warning instead of failing with a bare connection error; recorded as ROADMAP 5.10, since they are the only coverage for the artwork editor. Verified both ways: the six suites pass inside the network, and an unchanged developer localhost run still passes, as do both browser suites locally. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -45,6 +45,10 @@ jobs:
|
||||
API_PORT: "28000"
|
||||
STORAGE_PORT: "29000"
|
||||
STORAGE_CONSOLE_PORT: "29001"
|
||||
# Presigned URLs are signed against this endpoint, so it must be reachable
|
||||
# by whoever follows them. The suites run inside the network, so it has to
|
||||
# be the service name, not a published port on the host.
|
||||
S3_PUBLIC_ENDPOINT: http://storage:9000
|
||||
COMPOSE: docker compose -f compose.local.yaml
|
||||
steps:
|
||||
- name: Checkout
|
||||
@@ -60,12 +64,20 @@ jobs:
|
||||
$COMPOSE up --build -d --wait --wait-timeout 600
|
||||
$COMPOSE ps
|
||||
|
||||
# Run inside the stack's own network. The runner is itself a container, so
|
||||
# ports published on the host's loopback are in a different namespace and
|
||||
# unreachable from here. SITE_HOST_HEADER keeps the Host the gateway and
|
||||
# TrustedHostMiddleware expect, so the configuration under test is the same
|
||||
# one a developer exercises on localhost.
|
||||
- name: API and workflow regressions
|
||||
run: |
|
||||
python3 -m local.smoke_test
|
||||
python3 -m local.workflow_test
|
||||
python3 -m local.security_test
|
||||
python3 -m local.scanning_test
|
||||
for suite in smoke_test workflow_test security_test scanning_test; do
|
||||
echo "--- $suite"
|
||||
$COMPOSE exec -T \
|
||||
-e SITE_BASE_URL=http://site \
|
||||
-e SITE_HOST_HEADER=localhost \
|
||||
api python -m "local.$suite"
|
||||
done
|
||||
|
||||
- name: Runtime and retention regressions
|
||||
run: |
|
||||
@@ -90,6 +102,14 @@ jobs:
|
||||
echo "Install google-chrome-stable or set CHROME_BIN to gate on them."
|
||||
exit 0
|
||||
fi
|
||||
# Chrome runs here, in the runner container, and reaches the stack only
|
||||
# through ports published on the host. When the runner is itself a
|
||||
# container those are in another namespace, so check before running
|
||||
# rather than failing with a bare connection error. See ROADMAP 5.10.
|
||||
if ! wget -q -T 5 -O /dev/null "http://localhost:${SITE_PORT}/health"; then
|
||||
echo "::warning::Stack not reachable from the runner; browser regressions were NOT run."
|
||||
exit 0
|
||||
fi
|
||||
echo "Using $CHROME_BIN"
|
||||
node local/artwork_browser_test.mjs
|
||||
node local/browser_test.mjs
|
||||
|
||||
Reference in New Issue
Block a user