fix(ci): stop the smoke test racing on SIGPIPE under pipefail
Release / Plan (reuse the published image?) (push) Successful in 4s
CI / Docker image (build and smoke test) (push) Skipped
CI / Format and clippy (push) Successful in 19s
CI / Dependency audit (push) Successful in 15s
CI / Tests (Linux) (push) Successful in 1m19s
Release / ci (push) Successful in 1m20s
Release / Build image (arm64) (push) Successful in 21s
Release / Build image (amd64) (push) Successful in 29s
Release / Publish tags (push) Successful in 15s
Release / Gitea release (push) Skipped

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Lucas RayanandClaude Sonnet 5.5 committed 2026-11-03 09:26:52 -03:00
1 parent 75df6ba642
commit ba1e8fb1d0
1 file changed
+8 -3
+8 -3
View File
@@ -25,9 +25,14 @@ for _ in $(seq 1 30); do
docker exec "$name" curl -fsS http://127.0.0.1:8788/api/health >/dev/null 2>&1 && break
sleep 1
done
docker exec "$name" curl -fsS http://127.0.0.1:8788/api/health | grep -q '"status":"ok"' || fail "/api/health did not answer"
docker exec "$name" curl -fsS http://127.0.0.1:8788/ | grep -qi '<!doctype html' || fail "dashboard is not served"
docker exec "$name" xexeu doctor --json --config /config/xexeu.toml --data-dir /data/xexeu | grep -q '"version"' || fail "xexeu doctor --json failed"
# Capture output instead of piping into `grep -q`: grep exits at the first match,
# the writer gets SIGPIPE and `pipefail` turns that into a flaky failure.
out=$(docker exec "$name" curl -fsS http://127.0.0.1:8788/api/health) || fail "/api/health did not answer"
grep -q '"status":"ok"' <<<"$out" || fail "/api/health is not ok"
out=$(docker exec "$name" curl -fsS http://127.0.0.1:8788/) || fail "dashboard did not answer"
grep -qi '<!doctype html' <<<"$out" || fail "dashboard is not served"
out=$(docker exec "$name" xexeu doctor --json --config /config/xexeu.toml --data-dir /data/xexeu) || { echo "$out" >&2; fail "xexeu doctor --json failed"; }
grep -q '"version"' <<<"$out" || fail "xexeu doctor --json has no version"
[ "$(docker inspect -f '{{if .Config.Healthcheck}}yes{{end}}' "$name")" = yes ] || fail "image has no HEALTHCHECK"
[ "$(docker exec "$name" id -u)" != 0 ] || fail "daemon runs as root"
docker stop -t 10 "$name" >/dev/null