Skip to content
This repository has been archived by the owner on Mar 9, 2022. It is now read-only.

Commit

Permalink
Verify status code of health endpoint in CCI (#216)
Browse files Browse the repository at this point in the history
  • Loading branch information
wennmo committed Jan 8, 2018
1 parent cb5b25e commit 82881bc
Showing 1 changed file with 18 additions and 14 deletions.
32 changes: 18 additions & 14 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -138,15 +138,20 @@ jobs:
- run:
name: Check health of the Mira service
command: |
echo "Waiting for Swarm to wake up..."
SWARM_IS_DOWN="true"
set +e
while [ "$SWARM_IS_DOWN" == "true" ]; do
SWARM_IS_DOWN=$(curl http://localhost:9100/v1/health -s -f -o /dev/null || echo "true")
sleep 1
# Verify Mira health
RETRIES=0
while (( MIRA_STATUS != "200" && RETRIES != 30 )); do
MIRA_STATUS=$(curl -s -o /dev/null -w %{http_code} http://localhost:9100/v1/health)
sleep 2
RETRIES=$((RETRIES + 1 ))
done
echo "Mira is up and running!"
if [ "$MIRA_STATUS" != "200" ]; then
echo "Mira did not return status code 200 on health endpoint"
exit 1
fi
- run:
name: Verify number of engines found
command: |
Expand Down Expand Up @@ -257,21 +262,20 @@ jobs:
- run:
name: Check health of the Mira service
command: |
echo "Waiting for Swarm to wake up..."
SWARM_IS_DOWN="true"
set +e
# Verify Mira health
RETRIES=0
while (( SWARM_IS_DOWN == "true" && RETRIES != 30 )); do
SWARM_IS_DOWN=$(curl http://localhost:9100/v1/health -s -f -o /dev/null || echo "true")
while (( MIRA_STATUS != "200" && RETRIES != 30 )); do
MIRA_STATUS=$(curl -s -o /dev/null -w %{http_code} http://localhost:9100/v1/health)
sleep 2
RETRIES=$((RETRIES + 1 ))
done
if [ "$SWARM_IS_DOWN" == "true" ]; then
echo "Mira service did not start"
if [ "$MIRA_STATUS" != "200" ]; then
echo "Mira did not return status code 200 on health endpoint"
exit 1
fi
echo "Mira is up and running!"
- run:
name: Verify number of engines found
command: |
Expand Down

0 comments on commit 82881bc

Please sign in to comment.