Add a little connectivity helper script to ensure we can clean-start tests

This commit is contained in:
R. Tyler Croy 2017-12-21 06:51:37 -08:00
parent b3c059e230
commit 7d77024b85
No known key found for this signature in database
GPG Key ID: 1426C7DC3F51E16F
2 changed files with 20 additions and 1 deletions

View File

@ -4,6 +4,7 @@ all: check
check: bats container
docker-compose up --remove-orphans -d
./test/check-connectivity
./bats/bin/bats test/*.bats
bats:
@ -12,10 +13,13 @@ bats:
container: Dockerfile nginx.conf supervisord.conf
docker build -t $(IMAGE_NAME):latest .
# Whenever the nginx.conf changes, we should down the docker-compose bits just
# to ensure we come up with something new
nginx.conf:
docker-compose down
clean: ensure-down
clean:
docker-compose down
docker rmi $(shell docker images -q -f "reference=$(IMAGE_NAME)")
rm -rf bats

15
proxy/test/check-connectivity Executable file
View File

@ -0,0 +1,15 @@
#!/usr/bin/env bash
PROXY_URL=http://127.0.0.1:8081/
for i in $(seq 1 5); do
curl -sI ${PROXY_URL} 2>&1 > /dev/null
if [ $? -ne 0 ]; then
sleep 1
else
exit 0
fi;
done;
# If we get to here without having bailed out, something is wrong
exit 1