From bb376166412ed0a2a804f95637e29d62c5ba8bf6 Mon Sep 17 00:00:00 2001 From: "Christina.Holt" Date: Thu, 2 Sep 2021 21:31:21 +0000 Subject: [PATCH 1/3] Moving script consistent with new dir. --- tests/WE2E/end_to_end_tests.sh | 89 ++++++++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100755 tests/WE2E/end_to_end_tests.sh diff --git a/tests/WE2E/end_to_end_tests.sh b/tests/WE2E/end_to_end_tests.sh new file mode 100755 index 000000000..15f62716b --- /dev/null +++ b/tests/WE2E/end_to_end_tests.sh @@ -0,0 +1,89 @@ +#!/bin/bash -l + +#---------------------------------------------------------------------- +# Automation of UFS Short Range Weather App Worfklow End to End Tests. +# +# The script is dependant on a successful build of this repo. +# 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} +# +# With the creating of a test_log directory and output files describing +# the result of each workflow status, a testing framework is established. +# The user must verify the contents of each experiment file in test_log/ +# to check workflow success or failure. +# +# Example: . end_to_end_tests.sh hera zrtrr +#---------------------------------------------------------------------- + +#----------------------------------------------------------------------- +# Set variables +#----------------------------------------------------------------------- + +branches=( rrfs_ci ) + +export machine=$1 +machine=`echo "${machine}" | tr '[A-Z]' '[a-z]'` # scripts in sorc need lower case machine name + +export account=$2 +account=`echo "${account}"` + + +#----------------------------------------------------------------------- +# Choose experiment. ( Full list in ./baselines_list.txt) +#----------------------------------------------------------------------- + +expts=( grid_RRFS_CONUS_25km_ics_HRRR_lbcs_RAP_suite_RRFS_v1alpha ) +#expts=( grid_RRFS_CONUS_25km_ics_FV3GFS_lbcs_FV3GFS_suite_GFS_v15p2 ) +#expts=( grid_RRFS_CONUS_13km_ics_FV3GFS_lbcs_FV3GFS_suite_GFS_v15p2 ) +#expts=( grid_RRFS_CONUS_13km_ics_HRRR_lbcs_RAP_suite_HRRR ) +#expts=( inline_post ) +#expts=( grid_RRFS_CONUS_13km_ics_FV3GFS_lbcs_FV3GFS_suite_GFS_v15p2 grid_RRFS_CONUS_25km_ics_HRRR_lbcs_RAP_suite_RRFS_v1alpha ) + +#----------------------------------------------------------------------- +# Set directories +#----------------------------------------------------------------------- + +scrfunc_fp=$( readlink -f "${BASH_SOURCE[0]}" ) +scrfunc_fn=$( basename "${scrfunc_fp}" ) +scrfunc_dir=$( dirname "${scrfunc_fp}" ) + +REGIONAL_WORKFLOW_DIR=$( dirname "${scrfunc_dir}" ) +SRW_APP_DIR=$( dirname "${REGIONAL_WORKFLOW_DIR}" ) +TOP_DIR=$( dirname "${SRW_APP_DIR}" ) +TESTS_DIR=${REGIONAL_WORKFLOW_DIR}/tests + +BRANCH_DIR_NAME=ufs-srweather-app-${branches} +APP_DIR=${TOP_DIR}/${BRANCH_DIR_NAME} +EXPTS_DIR=${TOP_DIR}/expt_dirs + +#---------------------------------------------------------------------- +# Temporary fix to set EXECDIR in setup.sh appropriately. +#---------------------------------------------------------------------- + +sed -i 's|EXECDIR="${SR_WX_APP_TOP_DIR}/bin"|EXECDIR="${SR_WX_APP_TOP_DIR}/bin_intel/bin"|g' "${REGIONAL_WORKFLOW_DIR}/ush/setup.sh" + +#----------------------------------------------------------------------- +# Run E2E Tests +#----------------------------------------------------------------------- + +# Load Python Modules +source ${APP_DIR}/env/wflow_${machine}.env +cmd="${APP_DIR}/env/wflow_${machine}.env" + +echo "-- Python command =>" $cmd + + +# If experiments list file exists, remove it, and add the experiemnts to a new expts list file +if [ -f "auto_expts_list.txt" ] ; then + rm "auto_expts_list.txt" +fi +echo ${expts} > auto_expts_list.txt + +# Run the E2E Workflow tests +#./run_experiments.sh expts_file=auto_expts_list.txt machine=${machine} account=${account} use_cron_to_relaunch=FALSE +./run_experiments.sh expts_file=auto_expts_list.txt machine=${machine} account=${account} + + From 0647f1fda17f5bc689bf8c18b592df9104ae4649 Mon Sep 17 00:00:00 2001 From: "Christina.Holt" Date: Thu, 2 Sep 2021 21:31:46 +0000 Subject: [PATCH 2/3] Remove old script. --- tests/end_to_end_tests.sh | 89 --------------------------------------- 1 file changed, 89 deletions(-) delete mode 100644 tests/end_to_end_tests.sh diff --git a/tests/end_to_end_tests.sh b/tests/end_to_end_tests.sh deleted file mode 100644 index 15f62716b..000000000 --- a/tests/end_to_end_tests.sh +++ /dev/null @@ -1,89 +0,0 @@ -#!/bin/bash -l - -#---------------------------------------------------------------------- -# Automation of UFS Short Range Weather App Worfklow End to End Tests. -# -# The script is dependant on a successful build of this repo. -# 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} -# -# With the creating of a test_log directory and output files describing -# the result of each workflow status, a testing framework is established. -# The user must verify the contents of each experiment file in test_log/ -# to check workflow success or failure. -# -# Example: . end_to_end_tests.sh hera zrtrr -#---------------------------------------------------------------------- - -#----------------------------------------------------------------------- -# Set variables -#----------------------------------------------------------------------- - -branches=( rrfs_ci ) - -export machine=$1 -machine=`echo "${machine}" | tr '[A-Z]' '[a-z]'` # scripts in sorc need lower case machine name - -export account=$2 -account=`echo "${account}"` - - -#----------------------------------------------------------------------- -# Choose experiment. ( Full list in ./baselines_list.txt) -#----------------------------------------------------------------------- - -expts=( grid_RRFS_CONUS_25km_ics_HRRR_lbcs_RAP_suite_RRFS_v1alpha ) -#expts=( grid_RRFS_CONUS_25km_ics_FV3GFS_lbcs_FV3GFS_suite_GFS_v15p2 ) -#expts=( grid_RRFS_CONUS_13km_ics_FV3GFS_lbcs_FV3GFS_suite_GFS_v15p2 ) -#expts=( grid_RRFS_CONUS_13km_ics_HRRR_lbcs_RAP_suite_HRRR ) -#expts=( inline_post ) -#expts=( grid_RRFS_CONUS_13km_ics_FV3GFS_lbcs_FV3GFS_suite_GFS_v15p2 grid_RRFS_CONUS_25km_ics_HRRR_lbcs_RAP_suite_RRFS_v1alpha ) - -#----------------------------------------------------------------------- -# Set directories -#----------------------------------------------------------------------- - -scrfunc_fp=$( readlink -f "${BASH_SOURCE[0]}" ) -scrfunc_fn=$( basename "${scrfunc_fp}" ) -scrfunc_dir=$( dirname "${scrfunc_fp}" ) - -REGIONAL_WORKFLOW_DIR=$( dirname "${scrfunc_dir}" ) -SRW_APP_DIR=$( dirname "${REGIONAL_WORKFLOW_DIR}" ) -TOP_DIR=$( dirname "${SRW_APP_DIR}" ) -TESTS_DIR=${REGIONAL_WORKFLOW_DIR}/tests - -BRANCH_DIR_NAME=ufs-srweather-app-${branches} -APP_DIR=${TOP_DIR}/${BRANCH_DIR_NAME} -EXPTS_DIR=${TOP_DIR}/expt_dirs - -#---------------------------------------------------------------------- -# Temporary fix to set EXECDIR in setup.sh appropriately. -#---------------------------------------------------------------------- - -sed -i 's|EXECDIR="${SR_WX_APP_TOP_DIR}/bin"|EXECDIR="${SR_WX_APP_TOP_DIR}/bin_intel/bin"|g' "${REGIONAL_WORKFLOW_DIR}/ush/setup.sh" - -#----------------------------------------------------------------------- -# Run E2E Tests -#----------------------------------------------------------------------- - -# Load Python Modules -source ${APP_DIR}/env/wflow_${machine}.env -cmd="${APP_DIR}/env/wflow_${machine}.env" - -echo "-- Python command =>" $cmd - - -# If experiments list file exists, remove it, and add the experiemnts to a new expts list file -if [ -f "auto_expts_list.txt" ] ; then - rm "auto_expts_list.txt" -fi -echo ${expts} > auto_expts_list.txt - -# Run the E2E Workflow tests -#./run_experiments.sh expts_file=auto_expts_list.txt machine=${machine} account=${account} use_cron_to_relaunch=FALSE -./run_experiments.sh expts_file=auto_expts_list.txt machine=${machine} account=${account} - - From 03599544a24f064c58994573ca943ae21cf8fd48 Mon Sep 17 00:00:00 2001 From: "Christina.Holt" Date: Thu, 2 Sep 2021 21:48:40 +0000 Subject: [PATCH 3/3] Clean up a few minor things. --- tests/WE2E/end_to_end_tests.sh | 64 ++++++++++++++++++++-------------- 1 file changed, 37 insertions(+), 27 deletions(-) diff --git a/tests/WE2E/end_to_end_tests.sh b/tests/WE2E/end_to_end_tests.sh index 15f62716b..8f6145494 100755 --- a/tests/WE2E/end_to_end_tests.sh +++ b/tests/WE2E/end_to_end_tests.sh @@ -3,44 +3,55 @@ #---------------------------------------------------------------------- # Automation of UFS Short Range Weather App Worfklow End to End Tests. # -# The script is dependant on a successful build of this repo. +# The script is dependant 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} -# +# BUILD_DIR=${APP_DIR}/build_${compiler} +# BIN_DIR=${APP_DIR}/bin_${compiler} +# # With the creating of a test_log directory and output files describing # the result of each workflow status, a testing framework is established. # The user must verify the contents of each experiment file in test_log/ -# to check workflow success or failure. +# to check workflow success or failure. # -# Example: . end_to_end_tests.sh hera zrtrr +# Example: ./end_to_end_tests.sh hera zrtrr #---------------------------------------------------------------------- #----------------------------------------------------------------------- # Set variables #----------------------------------------------------------------------- -branches=( rrfs_ci ) +branches=( rrfs_ci ) + +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 ) + +if [ "$1" = "-h" ] ; then usage ; fi +[[ $# -le 1 ]] && usage export machine=$1 -machine=`echo "${machine}" | tr '[A-Z]' '[a-z]'` # scripts in sorc need lower case machine name +machine=$(echo "${machine}" | tr '[A-Z]' '[a-z]') # scripts in sorc need lower case machine name export account=$2 -account=`echo "${account}"` - #----------------------------------------------------------------------- -# Choose experiment. ( Full list in ./baselines_list.txt) +# Choose experiment. #----------------------------------------------------------------------- expts=( grid_RRFS_CONUS_25km_ics_HRRR_lbcs_RAP_suite_RRFS_v1alpha ) -#expts=( grid_RRFS_CONUS_25km_ics_FV3GFS_lbcs_FV3GFS_suite_GFS_v15p2 ) -#expts=( grid_RRFS_CONUS_13km_ics_FV3GFS_lbcs_FV3GFS_suite_GFS_v15p2 ) -#expts=( grid_RRFS_CONUS_13km_ics_HRRR_lbcs_RAP_suite_HRRR ) -#expts=( inline_post ) -#expts=( grid_RRFS_CONUS_13km_ics_FV3GFS_lbcs_FV3GFS_suite_GFS_v15p2 grid_RRFS_CONUS_25km_ics_HRRR_lbcs_RAP_suite_RRFS_v1alpha ) #----------------------------------------------------------------------- # Set directories @@ -50,10 +61,11 @@ scrfunc_fp=$( readlink -f "${BASH_SOURCE[0]}" ) scrfunc_fn=$( basename "${scrfunc_fp}" ) scrfunc_dir=$( dirname "${scrfunc_fp}" ) -REGIONAL_WORKFLOW_DIR=$( dirname "${scrfunc_dir}" ) +WE2E_DIR=$( dirname "${scrfunc_dir}" ) +TESTS_DIR=$( dirname "${WE2E_DIR}" ) +REGIONAL_WORKFLOW_DIR=$( dirname "${TESTS_DIR}" ) SRW_APP_DIR=$( dirname "${REGIONAL_WORKFLOW_DIR}" ) TOP_DIR=$( dirname "${SRW_APP_DIR}" ) -TESTS_DIR=${REGIONAL_WORKFLOW_DIR}/tests BRANCH_DIR_NAME=ufs-srweather-app-${branches} APP_DIR=${TOP_DIR}/${BRANCH_DIR_NAME} @@ -70,20 +82,18 @@ sed -i 's|EXECDIR="${SR_WX_APP_TOP_DIR}/bin"|EXECDIR="${SR_WX_APP_TOP_DIR}/bin_i #----------------------------------------------------------------------- # Load Python Modules -source ${APP_DIR}/env/wflow_${machine}.env cmd="${APP_DIR}/env/wflow_${machine}.env" +source ${cmd} -echo "-- Python command =>" $cmd - +echo "-- Load environment =>" $cmd # If experiments list file exists, remove it, and add the experiemnts to a new expts list file -if [ -f "auto_expts_list.txt" ] ; then - rm "auto_expts_list.txt" -fi -echo ${expts} > auto_expts_list.txt +auto_file="auto_expts_list.txt" + +rm -rf ${auto_file} +echo ${expts} > ${auto_file} # Run the E2E Workflow tests -#./run_experiments.sh expts_file=auto_expts_list.txt machine=${machine} account=${account} use_cron_to_relaunch=FALSE -./run_experiments.sh expts_file=auto_expts_list.txt machine=${machine} account=${account} +./run_WE2E_tests.sh tests_file=${auto_file} machine=${machine} account=${account}