diff --git a/tests/rt.sh b/tests/rt.sh index 66ab8bcf00..50d26b6454 100755 --- a/tests/rt.sh +++ b/tests/rt.sh @@ -14,12 +14,13 @@ usage() { echo " -c create new baseline results" echo " -e use ecFlow workflow manager" echo " -h display this help" - echo " -k keep run directory" + echo " -k keep run directory after rt.sh is completed" echo " -l runs test specified in " echo " -m compare against new baseline results" echo " -n run single test " echo " -r use Rocoto workflow manager" echo " -w for weekly_test, skip comparing baseline results" + echo " -d delete run direcotries that are not used by other tests" echo set -x exit 1 @@ -411,10 +412,11 @@ KEEP_RUNDIR=false SINGLE_NAME='' TEST_35D=false export skip_check_results=false +export delete_rundir=false TESTS_FILE='rt.conf' -while getopts ":cl:mn:wkreh" opt; do +while getopts ":cl:mn:dwkreh" opt; do case $opt in c) CREATE_BASELINE=true @@ -431,6 +433,9 @@ while getopts ":cl:mn:wkreh" opt; do TESTS_FILE='rt.conf.single' rm -f $TESTS_FILE ;; + d) + export delete_rundir=true + ;; w) export skip_check_results=true ;; @@ -459,6 +464,8 @@ while getopts ":cl:mn:wkreh" opt; do esac done +awk -F "|" '{print $5}' rt.conf | grep "\S" > keep_tests.tmp + if [[ $SINGLE_NAME != '' ]]; then rt_single fi @@ -800,6 +807,7 @@ EOF export LOG_DIR=${LOG_DIR} export DEP_RUN=${DEP_RUN} export skip_check_results=${skip_check_results} + export delete_rundir=${delete_rundir} EOF if [[ $ROCOTO == true ]]; then @@ -864,7 +872,7 @@ else echo ; echo REGRESSION TEST WAS SUCCESSFUL (echo ; echo REGRESSION TEST WAS SUCCESSFUL) >> ${REGRESSIONTEST_LOG} - rm -f fv3_*.x fv3_*.exe modules.fv3_* + rm -f fv3_*.x fv3_*.exe modules.fv3_* keep_tests.tmp [[ ${KEEP_RUNDIR} == false ]] && rm -rf ${RUNDIR_ROOT} [[ ${ROCOTO} == true ]] && rm -f ${ROCOTO_XML} ${ROCOTO_DB} *_lock.db [[ ${TEST_35D} == true ]] && rm -f tests/cpld_bmark*_20* diff --git a/tests/rt_weekly.conf b/tests/rt_weekly.conf index f8616842f3..85e25b683b 100644 --- a/tests/rt_weekly.conf +++ b/tests/rt_weekly.conf @@ -6,7 +6,7 @@ COMPILE | -DAPP=ATM -DCCPP_SUITES=FV3_GFS_v16,FV3_GFS_v16_nsstNoahmpUGWPv1 -D32B RUN | control_c768 | - wcoss_cray | fv3 | # CPLD Benchmark 35d tests -# The length of forecast is one day for the weekly tests. +# The length of forecast is 5 days for the weekly tests. COMPILE | -DAPP=S2SW -DCCPP_SUITES=FV3_GFS_v16_coupled_p8 | + hera.intel | fv3 | | RUN | cpld_bmark_p8_35d | | fv3 | | 2012010100 RUN | cpld_bmark_p8_35d | | fv3 | | 2012040100 diff --git a/tests/run_test.sh b/tests/run_test.sh index d7bf7b62ca..030ed8588e 100755 --- a/tests/run_test.sh +++ b/tests/run_test.sh @@ -266,5 +266,22 @@ fi echo " $( date +%s )" >> ${LOG_DIR}/job_${JOB_NR}_timestamp.txt +################################################################################ +# Remove RUN_DIRs if they are no longer needed by other tests +################################################################################ +if [[ ${delete_rundir} = true ]]; then + keep_run_dir=false + while read -r line; do + keep_test=$(echo $line| sed -e 's/^ *//' -e 's/ *$//') + if [[ $TEST_NAME == ${keep_test} ]]; then + keep_run_dir=true + fi + done < ${PATHRT}/keep_tests.tmp + + if [[ ${keep_run_dir} == false ]]; then + rm -rf ${RUNDIR} + fi +fi + elapsed=$SECONDS echo "Elapsed time $elapsed seconds. Test ${TEST_NAME}"