Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix parsing the output of the testing platform
Browse files Browse the repository at this point in the history
danielealbano committed Aug 25, 2022

Verified

This commit was signed with the committer’s verified signature. The key has expired.
danielealbano Daniele Salvatore Albano
1 parent 15e7ad1 commit 3a4ae2b
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions tests/integration_tests/redis_server/bootstrap.sh
Original file line number Diff line number Diff line change
@@ -272,18 +272,24 @@ 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

if [ $JUNIT -eq 1 ];
then
JUNIT_TEST_CASE_FAILURE_XML=""
if [ $TEST_RESULT == "err" ]
if [ "${TEST_RESULT}" == "err" ]
then
JUNIT_TEST_CASE_FAILURE_XML="<failure message=\"test failed\"><![CDATA[${TEST_CASE_FAILURE_REASON}]]></failure>
"
@@ -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}"

0 comments on commit 3a4ae2b

Please sign in to comment.