Commit 186480c8 authored by Kevin Vujic's avatar Kevin Vujic

Finished docker testing

parent ff9742db
MAX_RETRIES="30"
RETRY_INTERVAL="1"
COUNTER="1"
if [ -z "$1" ]; then
echo "ERROR: Host variable not set! Please pass the host to ping to"
exit -2
else
HOSTNAME="$1"
fi
if [ -z "$2" ]; then
echo "No timeout specified, taking ${MAX_RETRIES} seconds as default timeout"
else
MAX_RETRIES="$2"
fi
if [ -z "$3" ]; then
echo "No polling interval specified, taking ${RETRY_INTERVAL} seconds as default interval"
else
RETRY_INTERVAL="$3"
fi
echo "Waiting for Host to start..."
echo "Host: $HOSTNAME"
echo "Timeout: $MAX_RETRIES"
echo "Interval: $RETRY_INTERVAL"
while [ "$COUNTER" -le "${MAX_RETRIES}" ]; do
curl -s "$HOSTNAME" > /dev/null
EXIT_STATUS="$?"
if [ $EXIT_STATUS -eq 0 ]; then
echo "Server up and running!"
exit 0
fi
echo "Waiting for Host [${COUNTER}/${MAX_RETRIES}]";
COUNTER=$(($COUNTER + 1))
sleep "${RETRY_INTERVAL}"
done
echo "Server did not respond within ${MAX_RETRIES} seconds!"
exit -1
......@@ -36,6 +36,9 @@ if [ "$?" != "0" ]; then
exit $?
fi
echo "Checking server availability"
docker exec -t "${DOCKER_CONTAINER_NAME}" "/bin/bash" "./check_server_availability.sh" "http://localhost:3000" "60" "1"
echo "Running E2E-Tests inside docker image"
docker exec -t "${DOCKER_CONTAINER_NAME}" \
robot -d "tests/e2e_tests/robotframefork/reports/e2e_tests" \
......@@ -61,6 +64,6 @@ echo "You can view the testresults in: '${TEST_REPORTS_DIR}'"
echo "Cleaning up docker space"
docker rmi -f ${DOCKER_IMAGE_NAME} > /dev/null 2>&1
docker rm -f ${DOCKER_CONTAINER_NAME} > /dev/null 2>&1
docker image prune
docker image prune -f
exit "${TEST_STATUS}"
COUNTER="1"
MAX_RETRIES="30"
HOSTNAME="http://localhost:3000"
while [ [ ! ping -c1 ${HOSTNAME} /dev/null 2>&1 ] && "$COUNTER" ]; do
echo "Waiting for Host [${COUNTER}/${MAX_RETRIES}]";
sleep 1
done ;
if [ ! ping -c1 ${HOSTNAME} > /dev/null 2>&1 ]; then
echo "Server did not respond within ${MAX_RETRIES} seconds!"
exit -1
fi
echo "Server up and running!"
exit 0
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment