Skip to content

Commit 790a1b3

Browse files
[PR #2467/5d55db11 backport][stable-4.9] Exit integration tests CI if API failed to start (#2469)
Exit integration tests CI if API failed to start (#2467) * dont run tests if API is offline (cherry picked from commit 5d55db1) Co-authored-by: Jiří Jeřábek (Jiri Jerabek) <[email protected]>
1 parent 0c7fcd8 commit 790a1b3

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

.github/workflows/ci-docker-compose-integration.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,20 @@ jobs:
6060
max_runs=10
6161
for i in $(seq 1 $max_runs); do
6262
echo "$i: checking api status..."
63-
RESPONSE=$(curl -s -o /dev/null -w "%{http_code}" -u "${{ env.DJANGO_SUPERUSER_USERNAME }}:${{ env.DJANGO_SUPERUSER_PASSWORD }}" -LI http://localhost:5001/api/galaxy/pulp/api/v3/status/)
63+
RESPONSE=$(curl -s -o /dev/null -w "%{http_code}" -u "${{ env.DJANGO_SUPERUSER_USERNAME }}:${{ env.DJANGO_SUPERUSER_PASSWORD }}" -LI http://localhost:5001${{ env.PULP_GALAXY_API_PATH_PREFIX }}pulp/api/v3/status/)
64+
echo "$RESPONSE"
6465
if [ "$RESPONSE" -ne 200 ]; then
6566
echo "API is down. Retrying in 10 seconds..."
6667
sleep 10
6768
else
6869
echo "API online."
6970
exit 0
7071
fi
72+
73+
if [ $i -eq $max_runs ]; then
74+
echo "Failed to start API after $max_runs retries."
75+
exit 1
76+
fi
7177
done
7278
7379
- name: Install integration requirements

0 commit comments

Comments
 (0)