Skip to content

Commit e507f16

Browse files
talissoncostaclaude
andcommitted
ci: Make smoke test non-blocking + merge curl checks into one loop
Failures now warn instead of hard-failing individual endpoints. The job still exits non-zero so the PR check shows a warning, but continue-on-error prevents it from blocking merge. Also consolidates the 3 separate curl checks into a single endpoint loop. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 463a059 commit e507f16

1 file changed

Lines changed: 20 additions & 23 deletions

File tree

.github/workflows/frontend-pull-request.yml

Lines changed: 20 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ jobs:
4040
name: Vercel Preview Smoke Test
4141
runs-on: ubuntu-latest
4242
timeout-minutes: 10
43+
continue-on-error: true
4344
steps:
4445
- name: Wait for Vercel deployments and smoke test
4546
env:
@@ -52,6 +53,8 @@ jobs:
5253
"Preview – flagsmith-frontend-staging"
5354
)
5455
56+
FAILED=0
57+
5558
for ENV_NAME in "${ENVIRONMENTS[@]}"; do
5659
echo "⏳ Waiting for '$ENV_NAME' deployment..."
5760
URL=""
@@ -66,8 +69,9 @@ jobs:
6669
echo "✅ '$ENV_NAME' deployed at: $URL"
6770
break
6871
elif [ "$STATE" = "failure" ] || [ "$STATE" = "error" ]; then
69-
echo "❌ '$ENV_NAME' deployment failed with state: $STATE"
70-
exit 1
72+
echo "⚠️ '$ENV_NAME' deployment failed with state: $STATE"
73+
FAILED=1
74+
continue 2
7175
fi
7276
fi
7377
sleep 10
@@ -79,29 +83,22 @@ jobs:
7983
fi
8084
8185
# Smoke test the deployment
82-
echo "🔍 Testing $URL/health ..."
83-
STATUS=$(curl -s -o /dev/null -w '%{http_code}' --max-time 30 "$URL/health")
84-
if [ "$STATUS" != "200" ]; then
85-
echo "❌ /health returned $STATUS"
86-
exit 1
87-
fi
88-
89-
echo "🔍 Testing $URL/config/project-overrides ..."
90-
STATUS=$(curl -s -o /dev/null -w '%{http_code}' --max-time 30 "$URL/config/project-overrides")
91-
if [ "$STATUS" != "200" ]; then
92-
echo "❌ /config/project-overrides returned $STATUS"
93-
exit 1
94-
fi
95-
96-
echo "🔍 Testing $URL/ ..."
97-
STATUS=$(curl -s -o /dev/null -w '%{http_code}' --max-time 30 "$URL/")
98-
if [ "$STATUS" != "200" ]; then
99-
echo "❌ / returned $STATUS (this is the index page served by the Express server)"
100-
exit 1
101-
fi
86+
for ENDPOINT in "/health" "/config/project-overrides" "/"; do
87+
echo "🔍 Testing $URL$ENDPOINT ..."
88+
STATUS=$(curl -s -o /dev/null -w '%{http_code}' --max-time 30 "$URL$ENDPOINT")
89+
if [ "$STATUS" != "200" ]; then
90+
echo "⚠️ $ENDPOINT returned $STATUS"
91+
FAILED=1
92+
fi
93+
done
10294
103-
echo "✅ All smoke tests passed for '$ENV_NAME'"
95+
echo "✅ Smoke tests done for '$ENV_NAME'"
10496
echo ""
10597
done
10698
99+
if [ "$FAILED" -ne 0 ]; then
100+
echo "⚠️ Some smoke tests failed — see above for details"
101+
exit 1
102+
fi
103+
107104
echo "🎉 All Vercel preview deployments are healthy"

0 commit comments

Comments
 (0)