fix(ci): fail fast when smoke container exits
This commit is contained in:
Vendored
+13
-1
@@ -147,6 +147,12 @@ pipeline {
|
|||||||
ready=0
|
ready=0
|
||||||
for attempt in $(seq 1 90); do
|
for attempt in $(seq 1 90); do
|
||||||
if curl -fsS "http://127.0.0.1:$host_port/" >/dev/null; then ready=1; break; fi
|
if curl -fsS "http://127.0.0.1:$host_port/" >/dev/null; then ready=1; break; fi
|
||||||
|
if ! ./scripts/ci-docker.sh inspect --format '{{.State.Running}}' "$smoke_name" 2>/dev/null | grep -qx true; then
|
||||||
|
echo "Smoke container exited before becoming ready (attempt $attempt)." >&2
|
||||||
|
./scripts/ci-docker.sh logs "$smoke_name" || true
|
||||||
|
./scripts/ci-docker.sh inspect "$smoke_name" || true
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
sleep 2
|
sleep 2
|
||||||
done
|
done
|
||||||
test "$ready" = 1 || { ./scripts/ci-docker.sh logs "$smoke_name" || true; exit 1; }
|
test "$ready" = 1 || { ./scripts/ci-docker.sh logs "$smoke_name" || true; exit 1; }
|
||||||
@@ -157,9 +163,15 @@ pipeline {
|
|||||||
ready=0
|
ready=0
|
||||||
for attempt in $(seq 1 60); do
|
for attempt in $(seq 1 60); do
|
||||||
if curl -fsS "http://127.0.0.1:$host_port/" >/dev/null; then ready=1; break; fi
|
if curl -fsS "http://127.0.0.1:$host_port/" >/dev/null; then ready=1; break; fi
|
||||||
|
if ! ./scripts/ci-docker.sh inspect --format '{{.State.Running}}' "$smoke_name" 2>/dev/null | grep -qx true; then
|
||||||
|
echo "Smoke container exited after restart (attempt $attempt)." >&2
|
||||||
|
./scripts/ci-docker.sh logs "$smoke_name" || true
|
||||||
|
./scripts/ci-docker.sh inspect "$smoke_name" || true
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
sleep 2
|
sleep 2
|
||||||
done
|
done
|
||||||
test "$ready" = 1
|
test "$ready" = 1 || { ./scripts/ci-docker.sh logs "$smoke_name" || true; exit 1; }
|
||||||
curl -fsS -H 'Content-Type: application/json' \
|
curl -fsS -H 'Content-Type: application/json' \
|
||||||
--data '{"password":"ImageFind-Smoke-2026!"}' \
|
--data '{"password":"ImageFind-Smoke-2026!"}' \
|
||||||
"http://127.0.0.1:$host_port/api/v1/auth/login" | grep -q 'csrf'
|
"http://127.0.0.1:$host_port/api/v1/auth/login" | grep -q 'csrf'
|
||||||
|
|||||||
Reference in New Issue
Block a user