Skip to content

Commit 0e03c39

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 7d72fdf commit 0e03c39

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
@@ -66,14 +66,20 @@ jobs:
6666
max_runs=10
6767
for i in $(seq 1 $max_runs); do
6868
echo "$i: checking api status..."
69-
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/)
69+
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/)
70+
echo "$RESPONSE"
7071
if [ "$RESPONSE" -ne 200 ]; then
7172
echo "API is down. Retrying in 10 seconds..."
7273
sleep 10
7374
else
7475
echo "API online."
7576
exit 0
7677
fi
78+
79+
if [ $i -eq $max_runs ]; then
80+
echo "Failed to start API after $max_runs retries."
81+
exit 1
82+
fi
7783
done
7884
7985
- name: Install integration requirements

0 commit comments

Comments
 (0)