Skip to content

Commit 9f12122

Browse files
jerabekjiripatchback[bot]
authored andcommitted
Exit integration tests CI if API failed to start (#2467)
* dont run tests if API is offline (cherry picked from commit 5d55db1)
1 parent 0c7fcd8 commit 9f12122

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

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

+7-1
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)