Commit 7aeba670 authored by Emmanuel Promayon's avatar Emmanuel Promayon

FIXED better log + using proper regex for testname

parent fa2977ae
......@@ -91,7 +91,8 @@ if grep --quiet "Fatal error" $CI_PROJECT_DIR/$PROJECT_LOG_DIR/ci-test.log; then
echo "" >> ${PROJECT_LOG_DIR}/rerun-test.log
echo "Re-running $testname..." >> ${PROJECT_LOG_DIR}/rerun-test.log
echo "Reason:" >> ${PROJECT_LOG_DIR}/rerun-test.log
echo "$line" >> ${PROJECT_LOG_DIR}/rerun-test.log
# add ----> at the beginning of the line to distinguished real error log during rerunning
echo "----> $line" >> ${PROJECT_LOG_DIR}/rerun-test.log
echo "" >> ${PROJECT_LOG_DIR}/rerun-test.log
ctest --extra-verbose \
-DCTEST_SITE="$CDASH_SITE" \
......@@ -105,13 +106,14 @@ if grep --quiet "Fatal error" $CI_PROJECT_DIR/$PROJECT_LOG_DIR/ci-test.log; then
-DRERUN_TESTNAME=$testname \
-S $PROJECT_SOURCE_DIR/sdk/cmake/ctest/ci-rerun.cmake > >(tee --append ${PROJECT_LOG_DIR}/rerun-test.log | grep --line-buffered -e "Test \#") 2>&1
done
if grep --quiet "\*\*\*Failed" $CI_PROJECT_DIR/$PROJECT_LOG_DIR/rerun-test.log; then
# check the rerun log
if grep --quiet "^[^-].*\*\*\*Failed" $CI_PROJECT_DIR/$PROJECT_LOG_DIR/rerun-test.log; then
echo
echo "===== Fatal errors in reran tests ====="
echo "Found fatal error in rerun test log $CI_PROJECT_DIR/$PROJECT_LOG_DIR/rerun-test.log"
echo
echo "===== Failed tests in reran tests ====="
grep -e "\*\*\*Failed" -e "SegFault" $CI_PROJECT_DIR/rerun-$PROJECT_LOG_DIR/test.log
grep -e "^[^-].*\*\*\*Failed" -e "^[^-].*SegFault" $CI_PROJECT_DIR/$PROJECT_LOG_DIR/rerun-test.log
echo
exit 1
else
......
......@@ -45,11 +45,13 @@ set(CTEST_TEST_TIMEOUT 1800)
# run test
message(STATUS "- Running test ${RERUN_TESTNAME}...")
# When testname is something-1, adding a "$" at the end, avoid rerunning the test names something-10 to something-19
set(TESTNAME_REGEX "${RERUN_TESTNAME}$")
ctest_test(BUILD "${CTEST_BINARY_DIRECTORY}" APPEND
PARALLEL_LEVEL ${NUMBER_OF_PROC} # Run test in parallel
RETURN_VALUE TEST_RES
INCLUDE ${RERUN_TESTNAME}
INCLUDE ${TESTNAME_REGEX}
)
if (NOT TEST_RES EQUAL 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