diff --git a/tests/WE2E/machine_suites/hera.txt b/tests/WE2E/machine_suites/hera.txt new file mode 100644 index 000000000..35b26e9b1 --- /dev/null +++ b/tests/WE2E/machine_suites/hera.txt @@ -0,0 +1 @@ +grid_RRFS_CONUS_25km_ics_FV3GFS_lbcs_FV3GFS_suite_GSD_SAR diff --git a/tests/WE2E/machine_suites/jet.txt b/tests/WE2E/machine_suites/jet.txt new file mode 100644 index 000000000..35b26e9b1 --- /dev/null +++ b/tests/WE2E/machine_suites/jet.txt @@ -0,0 +1 @@ +grid_RRFS_CONUS_25km_ics_FV3GFS_lbcs_FV3GFS_suite_GSD_SAR diff --git a/tests/WE2E/run_WE2E_tests.sh b/tests/WE2E/run_WE2E_tests.sh index 776c80d28..f15fb9efa 100755 --- a/tests/WE2E/run_WE2E_tests.sh +++ b/tests/WE2E/run_WE2E_tests.sh @@ -86,6 +86,7 @@ Usage: machine=\"...\" \\ account=\"...\" \\ [expt_basedir=\"...\"] \\ + [exec_subdir=\"...\"] \\ [use_cron_to_relaunch=\"...\"] \\ [cron_relaunch_intvl_mnts=\"...\"] \\ [verbose=\"...\"] \\ @@ -129,6 +130,11 @@ group the WE2E tests into subdirectories for convenience, e.g. a set of tests under subdirectory testset1, another set of tests under testset2, etc. +exec_subdir: +Optional. Argument is used to set the EXEC_SUBDIR configuration +variable. Please see the ush/default_configs.sh file for a full +description. + use_cron_to_relaunch: Argument used to explicitly set the experiment variable USE_CRON_TO_RELAUNCH in the experiment configuration files of all the WE2E tests the user wants @@ -227,6 +233,7 @@ valid_args=( \ "machine" \ "account" \ "expt_basedir" \ + "exec_subdir" \ "use_cron_to_relaunch" \ "cron_relaunch_intvl_mnts" \ "verbose" \ @@ -687,7 +694,12 @@ Please correct and rerun." MACHINE=\"${MACHINE}\" ACCOUNT=\"${ACCOUNT}\"" - if [ ! -z "${EXPT_BASEDIR}" ]; then + if [ -n "${exec_subdir}" ]; then + expt_config_str=${expt_config_str}" +EXEC_SUBDIR=\"${exec_subdir}\"" + fi + + if [ -n "${EXPT_BASEDIR}" ]; then expt_config_str=${expt_config_str}" EXPT_BASEDIR=\"${EXPT_BASEDIR}\"" fi diff --git a/tests/WE2E/setup_WE2E_tests.sh b/tests/WE2E/setup_WE2E_tests.sh new file mode 100755 index 000000000..1aad10054 --- /dev/null +++ b/tests/WE2E/setup_WE2E_tests.sh @@ -0,0 +1,91 @@ +#!/bin/bash -l + +#---------------------------------------------------------------------- +# Wrapper for the automation of UFS Short Range Weather App Workflow +# End to End Tests. +# +# The wrapper loads the appropriate workflow environment for the +# machine, and sets the machine test suite file before invoking the +# run_WE2E_tests.sh. +# +# The script is dependent on a successful build of this repo using the +# test/build.sh script in the ufs-srweather-app repository. The UFS +# build must be completed in a particular manner for this script to +# function properly, notably the location of the build and bin +# directories: +# BUILD_DIR=${APP_DIR}/build_${compiler} +# BIN_DIR=${APP_DIR}/bin_${compiler} +# +# Example: ./end_to_end_tests.sh hera zrtrr +#---------------------------------------------------------------------- + +#----------------------------------------------------------------------- +# Set variables +#----------------------------------------------------------------------- + +function usage { + echo + echo "Usage: $0 machine slurm_account | -h" + echo + echo " machine [required] is one of: ${machines[@]}" + echo " slurm_account [required] case sensitive name of the user-specific slurm account" + echo " -h display this help" + echo + exit 1 + +} + +machines=( hera jet ) + +if [ "$1" = "-h" ] ; then usage ; fi +[[ $# -le 1 ]] && usage + +machine=$1 +machine=$(echo "${machine}" | tr '[A-Z]' '[a-z]') # scripts in sorc need lower case machine name + +account=$2 + +#----------------------------------------------------------------------- +# Set directories +#----------------------------------------------------------------------- +scrfunc_fp=$( readlink -f "${BASH_SOURCE[0]}" ) +scrfunc_fn=$( basename "${scrfunc_fp}" ) +scrfunc_dir=$( dirname "${scrfunc_fp}" ) + +TESTS_DIR=$( dirname "${scrfunc_dir}" ) +REGIONAL_WORKFLOW_DIR=$( dirname "${TESTS_DIR}" ) +SRW_APP_DIR=$( dirname "${REGIONAL_WORKFLOW_DIR}" ) +TOP_DIR=$( dirname "${SRW_APP_DIR}" ) + +EXPTS_DIR=${TOP_DIR}/expt_dirs + +#----------------------------------------------------------------------- +# Set the path to the machine-specific test suite file. +#----------------------------------------------------------------------- + +auto_file=${scrfunc_dir}/machine_suites/${machine}.txt + +#---------------------------------------------------------------------- +# Use exec_subdir consistent with the automated build. +#---------------------------------------------------------------------- + +exec_subdir='bin_intel/bin' + +#----------------------------------------------------------------------- +# Run E2E Tests +#----------------------------------------------------------------------- + +# Load Python Modules +env_file="${SRW_APP_DIR}/env/wflow_${machine}.env" +source ${env_file} +echo "-- Load environment =>" $env_file + +module list + +# Run the E2E Workflow tests +./run_WE2E_tests.sh \ + tests_file=${auto_file} \ + machine=${machine} \ + account=${account} \ + exec_subdir=${exec_subdir} + diff --git a/ush/config_defaults.sh b/ush/config_defaults.sh index e7860e021..6de917fa2 100644 --- a/ush/config_defaults.sh +++ b/ush/config_defaults.sh @@ -218,10 +218,14 @@ CRON_RELAUNCH_INTVL_MNTS="03" # # dir_doc_end # +# EXEC_SUBDIR: +# The name of the subdirectory of ufs-srweather-app where executables are +# installed. #----------------------------------------------------------------------- # EXPT_BASEDIR="" EXPT_SUBDIR="" +EXEC_SUBDIR="bin" # #----------------------------------------------------------------------- # diff --git a/ush/setup.sh b/ush/setup.sh index 74426ef7d..2cbd0f6fc 100755 --- a/ush/setup.sh +++ b/ush/setup.sh @@ -401,7 +401,7 @@ SORCDIR="$HOMErrfs/sorc" SRC_DIR="${SR_WX_APP_TOP_DIR}/src" PARMDIR="$HOMErrfs/parm" MODULES_DIR="$HOMErrfs/modulefiles" -EXECDIR="${SR_WX_APP_TOP_DIR}/bin" +EXECDIR="${SR_WX_APP_TOP_DIR}/${EXEC_SUBDIR}" TEMPLATE_DIR="$USHDIR/templates" VX_CONFIG_DIR="$TEMPLATE_DIR/parm" METPLUS_CONF="$TEMPLATE_DIR/parm/metplus"