Attempt to fix visual regression test fail on first run
CI Pipeline / test (20) (pull_request) Successful in 2m52s
CI Pipeline / test (18) (pull_request) Successful in 3m20s
CI Pipeline / e2e (chromium) (pull_request) Successful in 2m48s
CI Pipeline / e2e (firefox) (pull_request) Successful in 4m20s
CI Pipeline / e2e (webkit) (pull_request) Successful in 3m36s
CI Pipeline / performance (pull_request) Successful in 2m35s
CI Pipeline / storybook (pull_request) Successful in 1m24s
CI Pipeline / visual-regression (pull_request) Failing after 6m17s
CI Pipeline / lint (pull_request) Successful in 56s
CI Pipeline / build (pull_request) Successful in 1m19s
CI Pipeline / test (20) (pull_request) Successful in 2m52s
CI Pipeline / test (18) (pull_request) Successful in 3m20s
CI Pipeline / e2e (chromium) (pull_request) Successful in 2m48s
CI Pipeline / e2e (firefox) (pull_request) Successful in 4m20s
CI Pipeline / e2e (webkit) (pull_request) Successful in 3m36s
CI Pipeline / performance (pull_request) Successful in 2m35s
CI Pipeline / storybook (pull_request) Successful in 1m24s
CI Pipeline / visual-regression (pull_request) Failing after 6m17s
CI Pipeline / lint (pull_request) Successful in 56s
CI Pipeline / build (pull_request) Successful in 1m19s
This commit is contained in:
@@ -174,23 +174,35 @@ jobs:
|
||||
echo "⏳ Waiting for server to be ready..."
|
||||
npx wait-on -t 120000 "tcp:$HOST:$PORT"
|
||||
|
||||
# Verify server is actually responding
|
||||
for i in {1..10}; do
|
||||
if curl -fsS "http://$HOST:$PORT" >/dev/null 2>&1; then
|
||||
echo "✅ App is responding at http://$HOST:$PORT"
|
||||
# Verify server is actually responding to all test routes
|
||||
echo "🔍 Verifying server readiness for all test routes..."
|
||||
for i in {1..15}; do
|
||||
# Check all routes that will be tested in visual regression
|
||||
if curl -fsS "http://$HOST:$PORT" >/dev/null 2>&1 && \
|
||||
curl -fsS "http://$HOST:$PORT/blog" >/dev/null 2>&1 && \
|
||||
curl -fsS "http://$HOST:$PORT/blog/resolving-active-conflicts" >/dev/null 2>&1; then
|
||||
echo "✅ App is responding to all test routes at http://$HOST:$PORT"
|
||||
break
|
||||
else
|
||||
echo "⏳ Attempt $i/10: Server not ready yet, waiting..."
|
||||
sleep 5
|
||||
if [ $i -eq 10 ]; then
|
||||
echo "❌ Server failed to respond after 10 attempts"
|
||||
echo "⏳ Attempt $i/15: Server not ready for all routes yet, waiting..."
|
||||
sleep 3
|
||||
if [ $i -eq 15 ]; then
|
||||
echo "❌ Server failed to respond to all routes after 15 attempts"
|
||||
echo "📋 Server logs:"
|
||||
cat .next/runner.log || true
|
||||
echo "🔍 Testing individual routes:"
|
||||
curl -I "http://$HOST:$PORT" || echo "❌ Homepage failed"
|
||||
curl -I "http://$HOST:$PORT/blog" || echo "❌ Blog failed"
|
||||
curl -I "http://$HOST:$PORT/blog/resolving-active-conflicts" || echo "❌ Blog post failed"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
# Give server a moment to fully settle after all routes are ready
|
||||
echo "⏳ Allowing server to fully settle..."
|
||||
sleep 5
|
||||
|
||||
# Run visual regression tests with server monitoring
|
||||
echo "🧪 Running visual regression tests..."
|
||||
|
||||
|
||||
Reference in New Issue
Block a user