Skip to content

Commit f8954b1

Browse files
committed
fix tests
1 parent 6359b50 commit f8954b1

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

.github/workflows/health-check.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -90,41 +90,41 @@ jobs:
9090
yarn build
9191
echo "✅ Application built successfully"
9292
93-
- name: Test Application Startup and API Endpoints
93+
- name: Test Application Startup and API Endpoints
9494
run: |
9595
echo "Testing application startup and critical API endpoints..."
96-
96+
9797
# Start the app in background
9898
yarn start &
9999
APP_PID=$!
100-
100+
101101
# Wait for app to start
102102
sleep 15
103-
103+
104104
# Test if app responds
105105
curl -f http://localhost:3000 || {
106106
echo "❌ Application failed to start or respond"
107107
kill $APP_PID 2>/dev/null
108108
exit 1
109109
}
110110
echo "✅ Application starts and responds successfully"
111-
111+
112112
# Test MQTT brokers endpoint (no auth required)
113113
curl -f http://localhost:3000/api/mqtt/brokers || {
114114
echo "❌ MQTT brokers API endpoint failed"
115115
kill $APP_PID 2>/dev/null
116116
exit 1
117117
}
118118
echo "✅ MQTT brokers API endpoint responds correctly"
119-
119+
120120
# Test plate-reads endpoint with test payload (skip auth check for CI)
121121
echo "Testing plate-reads endpoint with test payload..."
122122
HTTP_STATUS=$(curl -w "%{http_code}" -X POST \
123123
-H "Content-Type: application/json" \
124124
-d @test-payload.json \
125125
-s -o /dev/null \
126126
http://localhost:3000/api/plate-reads)
127-
127+
128128
if [ "$HTTP_STATUS" -eq 200 ] || [ "$HTTP_STATUS" -eq 401 ]; then
129129
echo "✅ Plate-reads endpoint is responding (status: $HTTP_STATUS)"
130130
if [ "$HTTP_STATUS" -eq 401 ]; then
@@ -134,13 +134,13 @@ jobs:
134134
echo "❌ Plate-reads API endpoint failed with status: $HTTP_STATUS"
135135
kill $APP_PID 2>/dev/null
136136
exit 1
137-
fi
138-
137+
}
138+
139139
# Verify database connectivity with app running
140140
echo "Verifying database connectivity..."
141141
PLATE_COUNT=$(psql $DATABASE_URL -t -c "SELECT COUNT(*) FROM plates;")
142142
echo "✅ Database accessible from app environment (plates table has $PLATE_COUNT records)"
143-
143+
144144
# Cleanup
145145
kill $APP_PID 2>/dev/null
146146
echo "✅ All application and API tests completed successfully"

0 commit comments

Comments
 (0)