@@ -175,13 +175,23 @@ jobs:
175
175
echo "Waiting for API services to be ready..."
176
176
sleep 20
177
177
api_success=0
178
+ set -x # Enable debug mode to show commands being executed
179
+
180
+ # Debug container status
181
+ echo "DEBUG: Container status before health check:"
182
+ docker ps
178
183
179
184
# Test health endpoint with retry
180
185
echo "Testing health endpoint..."
181
186
for attempt in {1..10}; do
182
- if curl -f http://localhost:5000/snapshot-info -s > /dev/null; then
187
+ echo "DEBUG: Attempting health check $attempt"
188
+ health_status=$(curl -f -s -w "%{http_code}" http://localhost:5000/snapshot-info -o /dev/null || echo "failed")
189
+ echo "DEBUG: Health check status code: $health_status"
190
+
191
+ if [[ "$health_status" == "200" ]]; then
183
192
echo "✅ Health check passed on attempt $attempt"
184
193
((api_success++))
194
+ echo "DEBUG: api_success value is now $api_success"
185
195
break
186
196
else
187
197
echo "⏳ Health check attempt $attempt failed, retrying..."
@@ -196,27 +206,41 @@ jobs:
196
206
197
207
# Test desktop snapshot with retry
198
208
echo "Testing desktop snapshot..."
209
+ echo "DEBUG: Starting desktop snapshot test"
199
210
for attempt in {1..5}; do
200
- if curl -f http://localhost:5000/desktop-snapshot -o /dev/null; then
211
+ echo "DEBUG: Attempting desktop snapshot $attempt"
212
+ snapshot_status=$(curl -f -s -w "%{http_code}" http://localhost:5000/desktop-snapshot -o /dev/null || echo "failed")
213
+ echo "DEBUG: Snapshot status code: $snapshot_status"
214
+
215
+ if [[ "$snapshot_status" == "200" ]]; then
201
216
echo "✅ Desktop snapshot passed on attempt $attempt"
202
217
((api_success++))
218
+ echo "DEBUG: api_success value is now $api_success"
203
219
break
204
220
else
205
221
echo "⏳ Desktop snapshot attempt $attempt failed, retrying..."
206
222
if [ $attempt -eq 5 ]; then
207
223
echo "❌ Desktop snapshot failed after 5 attempts"
224
+ echo "DEBUG: Container status after desktop snapshot failure:"
225
+ docker ps
226
+ echo "DEBUG: Checking container logs for API issues:"
227
+ docker logs --tail 20 wow-clients-client-1 2>&1 || echo "No logs available"
208
228
fi
209
229
sleep 5
210
230
fi
211
231
done
212
232
233
+ echo "DEBUG: Final api_success value: $api_success"
213
234
if [ $api_success -eq 2 ]; then
235
+ echo "DEBUG: All tests passed, setting output to PASS"
214
236
echo "result=PASS" >> $GITHUB_OUTPUT
215
237
echo "message=All API tests passed (2/2)" >> $GITHUB_OUTPUT
216
238
else
239
+ echo "DEBUG: Some tests failed, setting output to PARTIAL"
217
240
echo "result=PARTIAL" >> $GITHUB_OUTPUT
218
241
echo "message=API tests partially passed ($api_success/2)" >> $GITHUB_OUTPUT
219
242
fi
243
+ set +x # Disable debug mode
220
244
221
245
- name : Run API Test Script
222
246
id : test-api-script
0 commit comments