From 2e5889e7a9dfdba0b9428667ebf84da9f034b3bb Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Fri, 26 Sep 2008 10:23:34 +0000 Subject: [PATCH] Allow to relaunch the "end" of the testsuite: results collection, and results re-submission. --- .../autotest_cgal_with_cmake | 98 +++++++++++-------- 1 file changed, 57 insertions(+), 41 deletions(-) diff --git a/Scripts/developer_scripts/autotest_cgal_with_cmake b/Scripts/developer_scripts/autotest_cgal_with_cmake index 23cb7bb4ef3..9410977cba0 100755 --- a/Scripts/developer_scripts/autotest_cgal_with_cmake +++ b/Scripts/developer_scripts/autotest_cgal_with_cmake @@ -574,7 +574,8 @@ run_test_on_host_and_platform() rm -f "${CGAL_BINARY_DIR}/localtestscript" fi - cat >> "${CGAL_BINARY_DIR}/localtestscript" <> "$file" <> "${CGAL_BINARY_DIR}/localtestscript" <> "$file" <> "${CGAL_BINARY_DIR}/localtestscript" <&1 @@ -646,44 +653,51 @@ EOF log_done "${ACTUAL_LOGFILE}.test.${PLATFORM}" - # - # collect results and put them on the web - # - cd "${CGAL_TEST_DIR}" - log "${ACTUAL_LOGFILE}.test.${PLATFORM}" "PUTTING RESULTS ON THE WEB" - log "${ACTUAL_LOGFILE}.test.${PLATFORM}" "RESULTS COLLECTED ${PLATFORM}-${HOST}" - - # If this file does not exist results collection failed. Fake a results so this fact is itself reported - if [ ! -f "results_${CGAL_TESTER}_${PLATFORM}.txt" ]; then - log "${ACTUAL_LOGFILE}.test.${PLATFORM}" "Results collection for tester ${CGAL_TESTER} and platform ${PLATFORM} failed!" - echo "Results collection failed!" >> "results_${CGAL_TESTER}_${PLATFORM}.txt" - ${TAR} cf "results_${CGAL_TESTER}_${PLATFORM}.tar" "results_${CGAL_TESTER}_${PLATFORM}.txt" - ${COMPRESSOR} -9f "results_${CGAL_TESTER}_${PLATFORM}.tar" - fi - - ${TAR} cf "test_results-${HOST}.tar" "results_${CGAL_TESTER}_${PLATFORM}.tar.gz" "results_${CGAL_TESTER}_${PLATFORM}.txt" - ${COMPRESSOR} -9f "test_results-${HOST}.tar" - COMPILER=`printf "%s" "$2" | tr -c '[A-Za-z0-9]./[=-=]*_\'\''\":?() ' 'x'` - FILENAME="${CGAL_RELEASE_ID}_${CGAL_TESTER}-test`datestr`-${COMPILER}-cmake.tar.gz" - LOGFILENAME="${CGAL_RELEASE_ID}-log`datestr`-${HOST}.gz" - ${COMPRESSOR} -9f "${ACTUAL_LOGFILE}.test.${PLATFORM}" - mv "${ACTUAL_LOGFILE}.test.${PLATFORM}.gz" "${LOGS_DIR}/${LOGFILENAME}" + fi +} - log "${ACTUAL_LOGFILE}" "Test results: ${CGAL_TEST_DIR}/test_results-${HOST}.tar.gz" - - if [ -z "${DO_NOT_UPLOAD}" ]; then - put_on_web "test_results-${HOST}.tar.gz" "${FILENAME}" - fi +publish_results() +{ + HOST=${1} + PLATFORM=${2} - # - # notify the CGAL world - # - if [ ! "${MAIL_ADDRESS}" = "must_be_set_in_.autocgalrc" ]; then - for i in ${MAIL_ADDRESS}; do - echo "Notifying ${i} about autotest finished." - printf "result collection::\n${FILENAME}\n" | ${SENDMAIL} -s "autohandle" ${i} - done - fi + # + # collect results and put them on the web + # + cd "${CGAL_TEST_DIR}" + log "${ACTUAL_LOGFILE}.test.${PLATFORM}" "PUTTING RESULTS ON THE WEB" + log "${ACTUAL_LOGFILE}.test.${PLATFORM}" "RESULTS COLLECTED ${PLATFORM}-${HOST}" + + # If this file does not exist results collection failed. Fake a results so this fact is itself reported + if [ ! -f "results_${CGAL_TESTER}_${PLATFORM}.txt" ]; then + log "${ACTUAL_LOGFILE}.test.${PLATFORM}" "Results collection for tester ${CGAL_TESTER} and platform ${PLATFORM} failed!" + echo "Results collection failed!" >> "results_${CGAL_TESTER}_${PLATFORM}.txt" + ${TAR} cf "results_${CGAL_TESTER}_${PLATFORM}.tar" "results_${CGAL_TESTER}_${PLATFORM}.txt" + ${COMPRESSOR} -9f "results_${CGAL_TESTER}_${PLATFORM}.tar" + fi + + ${TAR} cf "test_results-${HOST}_${PLATFORM}.tar" "results_${CGAL_TESTER}_${PLATFORM}.tar.gz" "results_${CGAL_TESTER}_${PLATFORM}.txt" + ${COMPRESSOR} -9f "test_results-${HOST}_${PLATFORM}.tar" + COMPILER=`printf "%s" "$2" | tr -c '[A-Za-z0-9]./[=-=]*_\'\''\":?() ' 'x'` + FILENAME="${CGAL_RELEASE_ID}_${CGAL_TESTER}-test`datestr`-${COMPILER}-cmake.tar.gz" + LOGFILENAME="${CGAL_RELEASE_ID}-log`datestr`-${HOST}.gz" + ${COMPRESSOR} -9f "${ACTUAL_LOGFILE}.test.${PLATFORM}" + mv "${ACTUAL_LOGFILE}.test.${PLATFORM}.gz" "${LOGS_DIR}/${LOGFILENAME}" + + log "${ACTUAL_LOGFILE}" "Test results: ${CGAL_TEST_DIR}/test_results-${HOST}_${PLATFORM}.tar.gz" + + if [ -z "${DO_NOT_UPLOAD}" ]; then + put_on_web "test_results-${HOST}_${PLATFORM}.tar.gz" "${FILENAME}" + fi + + # + # notify the CGAL world + # + if [ ! "${MAIL_ADDRESS}" = "must_be_set_in_.autocgalrc" ]; then + for i in ${MAIL_ADDRESS}; do + echo "Notifying ${i} about autotest finished." + printf "result collection::\n${FILENAME}\n" | ${SENDMAIL} -s "autohandle" ${i} + done fi } @@ -702,6 +716,7 @@ run_test_on_host() for PLATFORM in ${PLATFORMS}; do run_test_on_host_and_platform "${HOST}" "${PLATFORM}" + publish_results "${HOST}" "${PLATFORM}" done } @@ -717,6 +732,7 @@ run_test() for HOST in ${BUILD_HOSTS}; do run_test_on_host ${HOST} & + publish_results "${HOST}" "${PLATFORM}" done }