From 82f857c7597a32c38d1378ee243a6d3daf9bd2b9 Mon Sep 17 00:00:00 2001 From: Mirco Nasuti <mirco.nasuti@chuv.ch> Date: Tue, 20 Sep 2016 14:15:41 +0200 Subject: [PATCH] tests cosmetic --- tests/test-run.sh | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/tests/test-run.sh b/tests/test-run.sh index b5fc1a215..79d5f7574 100755 --- a/tests/test-run.sh +++ b/tests/test-run.sh @@ -28,6 +28,7 @@ GATEWAY_IP=$(docker inspect backend-test | grep \"Gateway\":\ \" | sed 's/.*Gate # Test - GET groups +echo "Testing groups API..." if [ "$(curl -s ${GATEWAY_IP}:65434/services/groups)" != "$GROUPS_REF" ]; then echo "Tests failed - failed to load groups" exit 1 @@ -36,6 +37,7 @@ fi # Test - GET variables +echo "Testing variables API..." if [ "$(curl -s ${GATEWAY_IP}:65434/services/variables)" != "$VARIABLES_REF" ]; then echo "Tests failed - failed to load variables" exit 1 @@ -52,6 +54,7 @@ fi # Test - GET stats +echo "Testing stats API..." if [ "$(curl -s ${GATEWAY_IP}:65434/services/stats)" != "$STATS_REF" ]; then echo "Tests failed - failed to load stats" exit 1 @@ -60,6 +63,7 @@ fi # Test - POST requests +echo "Testing requests API..." response=$(curl -s -H "Content-Type: application/json" -X POST -d ${REQUEST_BODY} ${GATEWAY_IP}:65434/services/queries/requests) if [ "${response:52}" != "${REQUEST_REF:52}" ]; then echo "Tests failed - failed to post requests" @@ -69,9 +73,10 @@ fi # Test - POST and GET an article -curl -s -H "Content-Type: application/json" -X POST -d ${ARTICLE_BODY} ${GATEWAY_IP}:65434/services/articles +echo "Testing articles API..." +temp=$(curl -s -H "Content-Type: application/json" -X POST -d ${ARTICLE_BODY} ${GATEWAY_IP}:65434/services/articles) response=$(curl -s ${GATEWAY_IP}:65434/services/articles | sed "s/\"createdAt\":[0-9]*,//g") -response_ref=$(echo ${ARTICLE_REF} | sed "s/\"createdAt\":[0-9]*,//g") +response_ref=$(echo "${ARTICLE_REF}" | sed "s/\"createdAt\":[0-9]*,//g") if [ "${response}" != "${response_ref}" ]; then echo "Tests failed - failed to save/load article" exit 1 @@ -80,7 +85,8 @@ fi # Test - POST and GET a model -curl -s -H "Content-Type: application/json" -X POST -d ${MODEL_BODY} ${GATEWAY_IP}:65434/services/models +echo "Testing models API..." +temp=$(curl -s -H "Content-Type: application/json" -X POST -d ${MODEL_BODY} ${GATEWAY_IP}:65434/services/models) response=$(curl -s ${GATEWAY_IP}:65434/services/models | sed "s/\"createdAt\":[0-9]*,//g" | sed "s/\"date\":[0-9]*,//g") response_ref=$(echo "${MODEL_REF}" | sed "s/\"createdAt\":[0-9]*,//g" | sed "s/\"date\":[0-9]*,//g") if [ "${response}" != "${response_ref}" ]; then @@ -89,6 +95,6 @@ if [ "${response}" != "${response_ref}" ]; then fi -echo "Tests successfully passed" +echo "All tests successfully passed" exit 0 -- GitLab