Skip to content

Commit 8737dc3

Browse files
committed
fix(ci): always print smoke failure summary
1 parent 3a75c1e commit 8737dc3

1 file changed

Lines changed: 19 additions & 1 deletion

File tree

test/e2e/smoke/run.sh

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,24 @@ cleanup_cluster() {
124124
kind delete cluster --name "$CLUSTER_NAME" 2>/dev/null || true
125125
}
126126

127+
finish_smoke() {
128+
local exit_code=$?
129+
set +e
130+
131+
if [[ "$exit_code" -ne 0 ]]; then
132+
FAILED=true
133+
fi
134+
135+
cleanup_cluster
136+
if $FAILED; then
137+
red "✗ Smoke test FAILED"
138+
else
139+
green "✓ Smoke test PASSED"
140+
fi
141+
142+
exit "$exit_code"
143+
}
144+
127145
# ── Step 1: ensure kind cluster ──
128146
ensure_cluster() {
129147
if kind get clusters 2>/dev/null | grep -q "^$CLUSTER_NAME$"; then
@@ -444,7 +462,7 @@ send_request() {
444462

445463
# ── Main ──
446464
main() {
447-
trap 'exit_code=$?; if [[ "$exit_code" -ne 0 ]]; then FAILED=true; fi; cleanup_cluster; if $FAILED; then red "✗ Smoke test FAILED"; else green "✓ Smoke test PASSED"; fi; exit "$exit_code"' EXIT
465+
trap finish_smoke EXIT
448466

449467
if [[ "$BOOTSTRAP" == "true" ]]; then
450468
ensure_cluster

0 commit comments

Comments
 (0)