Skip to content

Commit

Permalink
Prevent duplicate case generation in generate_workflows.sh (NOAA-EMC#…
Browse files Browse the repository at this point in the history
…3217)

This prevents generate_workflows.sh from generating multiple, identical
test cases.

Resolves NOAA-EMC#3213
  • Loading branch information
DavidHuber-NOAA authored Jan 10, 2025
1 parent ed95546 commit b850b10
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions workflow/generate_workflows.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ function _usage() {
directory up from this script's residing directory.
-b Run build_all.sh with default flags
(build the UFS, UPP, UFS_Utils, and GFS-utils only
(build the UFS, UPP, UFS_Utils, and GFS-utils only)
-u Update submodules before building and/or generating experiments.
-y "list of YAMLs to run"
If this option is not specified, the default case (C48_ATM) will be
run. This option is overidden by -G or -E (see below).
run. This option is incompatible with -G, -E, or -S.
Example: -y "C48_ATM C48_S2SW C96C48_hybatmDA"
-Y /path/to/directory/with/YAMLs
Expand All @@ -43,7 +43,6 @@ function _usage() {
Run all valid SFS cases in the specified YAML directory.
NOTES:
- Only one of -G -E or -S may be specified
- Valid cases are determined by the experiment:system key as
well as the skip_ci_on_hosts list in each YAML.
Expand Down Expand Up @@ -223,6 +222,22 @@ else
done
fi

# Empty the _yaml_list array if -G, -E, and/or -S were selected
if [[ "${_run_all_gfs}" == "true" || \
"${_run_all_gefs}" == "true" || \
"${_run_all_sfs}" == "true" ]]; then

# Raise an error if the user specified a yaml list and any of -G -E -S
if [[ "${_specified_yaml_list}" == "true" ]]; then
echo "Ambiguous case selection."
echo "Please select which tests to run explicitly with -y \"list of tests\" or"
echo "by specifying -G (all GFS), -E (all GEFS), and/or -S (all SFS), but not both."
exit 3
fi

_yaml_list=()
fi

# If -S is specified, exit (for now).
# TODO when SFS tests come online, enable this option.
if [[ "${_run_all_sfs}" == "true" ]]; then
Expand Down

0 comments on commit b850b10

Please sign in to comment.