From 3a4ae2b7795d348d312ed412c67c15985faffef9 Mon Sep 17 00:00:00 2001 From: Daniele Salvatore Albano Date: Thu, 25 Aug 2022 23:10:47 +0200 Subject: [PATCH] Fix parsing the output of the testing platform --- tests/integration_tests/redis_server/bootstrap.sh | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/tests/integration_tests/redis_server/bootstrap.sh b/tests/integration_tests/redis_server/bootstrap.sh index 7903f5015..ebdbe0507 100755 --- a/tests/integration_tests/redis_server/bootstrap.sh +++ b/tests/integration_tests/redis_server/bootstrap.sh @@ -272,10 +272,16 @@ do TEST_NUMBER=$((TEST_NUMBER + 1)) TEST_NAME_GREP=$(printf '%q' "$TEST_NAME") - TEST_RESULT=$($CAT $TESTS_RESULTS_PATH | $GREP -v "\->" | $EGREP -e "\]: ${TEST_NAME_GREP} (\(|in ${TEMP_FOLDER}/tests)" | $CUT -d"[" -f 2 | $CUT -d"]" -f 1) + TEST_RESULT=$($CAT $TESTS_RESULTS_PATH | $GREP -v "\->" | $EGREP -e "\]: ${TEST_NAME_GREP} (\([0-9]+ ms\)|in ${TEMP_FOLDER}/tests)" | $CUT -d"[" -f 2 | $CUT -d"]" -f 1) + + if [ ! "${TEST_RESULT}" == "err" ] && [ ! "${TEST_RESULT}" == "ok" ] + then + echo "Unknown test result: ${TEST_RESULT}" + $CAT $TESTS_RESULTS_PATH | $GREP -v "\->" | $EGREP -e "\]: ${TEST_NAME_GREP} (\([0-9]+ ms\)|in ${TEMP_FOLDER}/tests)" + fi TEST_CASE_FAILURE_REASON="" - if [ $TEST_RESULT == "err" ] + if [ "${TEST_RESULT}" == "err" ] then TEST_CASE_FAILURE_REASON=$($CAT $TESTS_RESULTS_PATH | $EGREP -e "\-> \[err\]: ${TEST_NAME_GREP} in" -A 1 | tail -n 1) fi @@ -283,7 +289,7 @@ do if [ $JUNIT -eq 1 ]; then JUNIT_TEST_CASE_FAILURE_XML="" - if [ $TEST_RESULT == "err" ] + if [ "${TEST_RESULT}" == "err" ] then JUNIT_TEST_CASE_FAILURE_XML=" " @@ -298,7 +304,7 @@ EOF fi echo -n "> [${TEST_NUMBER}/${TOTAL_TESTS_COUNT}] Test '${TEST_NAME}' " - if [ $TEST_RESULT == "err" ] + if [ "${TEST_RESULT}" == "err" ] then echo -ne $RED echo -n "failed: ${TEST_CASE_FAILURE_REASON}"