Skip to content

Commit

Permalink
Make CIs test NCO mode properly. (#418)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielabdi-noaa authored Oct 30, 2022
1 parent 2f8bd26 commit b213ccc
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .cicd/scripts/srw_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ fi
# Test directories
we2e_experiment_base_dir="${workspace}/expt_dirs"
we2e_test_dir="${workspace}/tests/WE2E"
nco_dir="${workspace}/nco_dirs"

# Run the end-to-end tests.
if "${SRW_WE2E_COMPREHENSIVE_TESTS}"; then
Expand All @@ -37,7 +38,7 @@ else
fi

cd ${we2e_test_dir}
./setup_WE2E_tests.sh ${platform} ${SRW_PROJECT} ${SRW_COMPILER} ${test_type} ${we2e_experiment_base_dir}
./setup_WE2E_tests.sh ${platform} ${SRW_PROJECT} ${SRW_COMPILER} ${test_type} ${we2e_experiment_base_dir} ${nco_dir}

# Allow the tests to start before checking for status.
# TODO: Create a parameter that sets the initial start delay.
Expand Down
2 changes: 1 addition & 1 deletion parm/FV3LAM_wflow.xml
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ tasks; and the "FCST" type is used for the RUN_FCST_TN task.

<log>
{%- if run_envir == "nco" %}
&LOGDIR;/FV3LAM_wflow_{{ workflow_id }}.log
&LOGDIR;/FV3LAM_wflow.{{ workflow_id }}.log
{%- else %}
&LOGDIR;/FV3LAM_wflow.log
{%- endif %}
Expand Down
10 changes: 8 additions & 2 deletions tests/WE2E/setup_WE2E_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,15 @@

function usage {
echo
echo "Usage: $0 machine slurm_account [compiler] [test_type] [expt_dirs] | -h"
echo "Usage: $0 machine slurm_account [compiler] [test_type] [expts_dir] [nco_dirs] [run_envir] | -h"
echo
echo " machine [required] is one of: ${machines[@]}"
echo " slurm_account [required] case sensitive name of the user-specific slurm account"
echo " compiler [optional] compiler used for build"
echo " test_type [optional] test type: fundamental or comprehensive or all or any other name"
echo " expts_dir [optional] Experiment base directory"
echo " nco_dirs [optional] NCO operations root directory"
echo " run_envir [optional] either 'community' or 'nco' "
echo " -h display this help"
echo
exit 1
Expand Down Expand Up @@ -61,6 +63,9 @@ SRW_APP_DIR=$( dirname "${TESTS_DIR}" )
TOP_DIR=$( dirname "${SRW_APP_DIR}" )

EXPTS_DIR=${5:-"${TOP_DIR}/expt_dirs"}
NCO_DIR=${6:-"${TOP_DIR}/nco_dirs"}

RUN_ENVIR=${7:-""}

#----------------------------------------------------------------------
# Use exec_subdir consistent with the automated build.
Expand All @@ -83,8 +88,9 @@ source ${SRW_APP_DIR}/ush/load_modules_wflow.sh ${machine}
exec_subdir=${exec_subdir} \
compiler=${compiler} \
expt_basedir=${EXPTS_DIR} \
opsroot=${NCO_DIR} \
debug="TRUE" \
verbose="TRUE" \
cron_relaunch_intvl_mnts=4 \
run_envir="community"
run_envir=${RUN_ENVIR}

9 changes: 9 additions & 0 deletions ush/job_preamble.sh
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,18 @@ fi
function job_postamble() {

if [ "${RUN_ENVIR}" = "nco" ]; then

# Remove temp directory
cd ${DATAROOT}
[[ $KEEPDATA = "FALSE" ]] && rm -rf $DATA $DATA_SHARED

# Create symlinks to log files
local EXPTLOG=${EXPTDIR}/log
mkdir_vrfy -p ${EXPTLOG}
for i in ${LOGDIR}/*.${WORKFLOW_ID}.log; do
local LOGB=$(basename $i .${WORKFLOW_ID}.log)
ln_vrfy -sf $i ${EXPTLOG}/${LOGB}.log
done
fi

# Print exit message
Expand Down

0 comments on commit b213ccc

Please sign in to comment.