Commit db76075e authored by Emmanuel Promayon's avatar Emmanuel Promayon

UPDATED creating rerun log file whatever happens + improved log

parent cf355c53
......@@ -168,6 +168,7 @@ stages:
paths:
- ${PROJECT_LOG_DIR}/test.log
- ${PROJECT_LOG_DIR}/ci-test.log
- ${PROJECT_LOG_DIR}/rerun-test.log
when: always
expire_in: 7 days
......
......@@ -82,10 +82,17 @@ if grep --quiet "Fatal error" $CI_PROJECT_DIR/$PROJECT_LOG_DIR/ci-test.log; then
grep -e "\*\*\*Failed" -e "SegFault" $CI_PROJECT_DIR/$PROJECT_LOG_DIR/test.log
echo
echo "===== Re-run failed ====="
echo "Checking $CI_PROJECT_DIR/$PROJECT_LOG_DIR/test.log for failed test" > ${PROJECT_LOG_DIR}/rerun-test.log
echo "" >> ${PROJECT_LOG_DIR}/rerun-test.log
# loop over failed
grep -e "\*\*\*Failed" -e "SegFault" $CI_PROJECT_DIR/$PROJECT_LOG_DIR/test.log |
while IFS= read -r line; do
testname=$(echo $line | sed -r 's/.+[0-9]+:\s(.*)\s\..*/\1/g')
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
echo "" >> ${PROJECT_LOG_DIR}/rerun-test.log
ctest -VV \
-DCTEST_SITE="$CDASH_SITE" \
-DCI_MODE="$CAMITK_CI_MODE" \
......@@ -103,5 +110,6 @@ if grep --quiet "Fatal error" $CI_PROJECT_DIR/$PROJECT_LOG_DIR/ci-test.log; then
echo "Re-run OK"
fi
else
echo "Everything OK. No test needed to be re-ran." > ${PROJECT_LOG_DIR}/rerun-test.log
echo "OK"
fi
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