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

Commit

Permalink
Verify that Mira can discover engines in swarm and k8s in CCI (#208)
Browse files Browse the repository at this point in the history
* Verify number of engines in swarm and k8s

* Use two qix engines in swarm example

* Print found and expected number of qix engines
  • Loading branch information
wennmo committed Dec 19, 2017
1 parent 1542a54 commit fedb61f
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 3 deletions.
46 changes: 43 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,25 @@ jobs:
done
echo "Mira is up and running!"
- run:
name: Verify number of engines found
command: |
set +e
# Check that Mira returns correct number of qix engines
RETRIES=0
EXPECTED_NBR_ENGINES=2
while (( NBR_ENGINES != "$EXPECTED_NBR_ENGINES" && RETRIES != 10 )); do
NBR_ENGINES=$(curl "http://localhost:9100/v1/engines" | grep -o \"metricsPort\" | wc -w)
echo "Mira returned $NBR_ENGINES qix engines"
sleep 2
RETRIES=$((RETRIES + 1 ))
done
if [ "$NBR_ENGINES" != "$EXPECTED_NBR_ENGINES" ]; then
echo "Found $NBR_ENGINES QIX Engines but expected $EXPECTED_NBR_ENGINES"
exit 1
fi
# Job for testing Mira in kubernetes
kubernetes:
Expand Down Expand Up @@ -191,6 +210,26 @@ jobs:
# Check mira health
MIRA_URL=$(sudo minikube service mira --url)
curl -fs "$MIRA_URL/v1/health"
- run:
name: Verify number of engines found
command: |
set +e
MIRA_URL=$(sudo minikube service mira --url)
# Check that Mira returns correct number of qix engines
RETRIES=0
EXPECTED_NBR_ENGINES=2
while (( NBR_ENGINES != "$EXPECTED_NBR_ENGINES" && RETRIES != 10 )); do
NBR_ENGINES=$(curl "$MIRA_URL/v1/engines" | grep -o \"metricsPort\" | wc -w)
echo "Mira returned $NBR_ENGINES qix engines"
sleep 2
RETRIES=$((RETRIES + 1 ))
done
if [ "$NBR_ENGINES" != "$EXPECTED_NBR_ENGINES" ]; then
echo "Found $NBR_ENGINES QIX Engines but expected $EXPECTED_NBR_ENGINES"
exit 1
fi
# Job for testing Mira in dns mode
dns:
Expand Down Expand Up @@ -239,15 +278,16 @@ jobs:
set +e
# Check that Mira returns correct number of qix engines
RETRIES=0
while (( NBR_ENGINES != "2" && RETRIES != 10 )); do
EXPECTED_NBR_ENGINES=2
while (( NBR_ENGINES != "$EXPECTED_NBR_ENGINES" && RETRIES != 10 )); do
NBR_ENGINES=$(curl "http://localhost:9100/v1/engines" | grep -o \"metricsPort\" | wc -w)
echo "Mira returned $NBR_ENGINES qix engines"
sleep 2
RETRIES=$((RETRIES + 1 ))
done
if [ "$NBR_ENGINES" != "2" ]; then
echo "Incorrect number of qix engines found"
if [ "$NBR_ENGINES" != "$EXPECTED_NBR_ENGINES" ]; then
echo "Found $NBR_ENGINES QIX Engines but expected $EXPECTED_NBR_ENGINES"
exit 1
fi
Expand Down
2 changes: 2 additions & 0 deletions examples/swarm/docker-compose-swarm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,7 @@ services:
image: qlikea/engine:12.113.0
ports:
- 9076:9076
deploy:
replicas: 2
labels:
qix-engine: ""

0 comments on commit fedb61f

Please sign in to comment.