Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding hooks for running on-prem automated WE2E tests. #676

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions tests/WE2E/machine_suites/hera.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
grid_RRFS_CONUS_25km_ics_FV3GFS_lbcs_FV3GFS_suite_GSD_SAR
1 change: 1 addition & 0 deletions tests/WE2E/machine_suites/jet.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
grid_RRFS_CONUS_25km_ics_FV3GFS_lbcs_FV3GFS_suite_GSD_SAR
14 changes: 13 additions & 1 deletion tests/WE2E/run_WE2E_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ Usage:
machine=\"...\" \\
account=\"...\" \\
[expt_basedir=\"...\"] \\
[exec_subdir=\"...\"] \\
[use_cron_to_relaunch=\"...\"] \\
[cron_relaunch_intvl_mnts=\"...\"] \\
[verbose=\"...\"] \\
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -227,6 +233,7 @@ valid_args=( \
"machine" \
"account" \
"expt_basedir" \
"exec_subdir" \
"use_cron_to_relaunch" \
"cron_relaunch_intvl_mnts" \
"verbose" \
Expand Down Expand Up @@ -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
Expand Down
91 changes: 91 additions & 0 deletions tests/WE2E/setup_WE2E_tests.sh
Original file line number Diff line number Diff line change
@@ -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}

4 changes: 4 additions & 0 deletions ush/config_defaults.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
#
JeffBeck-NOAA marked this conversation as resolved.
Show resolved Hide resolved
#-----------------------------------------------------------------------
#
Expand Down
2 changes: 1 addition & 1 deletion ush/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down