Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
6588c25
add staged data directory path for ursa
georgemccabe May 28, 2026
0838daf
initial version of regression test script -- just runs tests for curr…
georgemccabe May 28, 2026
df0569b
fix failures due to incorrect type for maxtries values
georgemccabe May 28, 2026
d77a41c
fix to allow we2e tests to run
georgemccabe May 28, 2026
3ab80ad
create python script to handle running regression test for branch or PR
georgemccabe Jun 1, 2026
91fc2de
handle Path vs string in git commands
georgemccabe Jun 1, 2026
e1f13cf
fix repo location
georgemccabe Jun 1, 2026
600a67d
run script from tests/WE2E dir from branch because run_we2e_tests.py …
georgemccabe Jun 1, 2026
cbf9a14
update version of uwtools
georgemccabe Jun 2, 2026
582894f
updates to fix running tests via subprocess to set up conda env in br…
georgemccabe Jun 2, 2026
4f4bbee
rearrange functions in order of use and remove whitespace
georgemccabe Jun 2, 2026
3c4980d
force install conda env into local conda directory to ensure it is fo…
georgemccabe Jun 3, 2026
daa8991
support creating vx_diff environment if vx_diff argument is provided
georgemccabe Jun 3, 2026
b6d1c3c
added environment file for conda env to run METplus diff_util
georgemccabe Jun 3, 2026
1cc4300
fix setting of env yaml file after dependent env var is set
georgemccabe Jun 4, 2026
9197949
start of script to run METplus diff util on each experiment's output
georgemccabe Jun 4, 2026
1ace70a
Add option to diff all files or only diff dated subdirectories to spe…
georgemccabe Jun 4, 2026
3730b4c
fix handling of success status
georgemccabe Jun 4, 2026
7616bec
print details of test results
georgemccabe Jun 4, 2026
8eb20ea
clean up import
georgemccabe Jun 4, 2026
dfc5cf7
Add staged location data for Ursa
mkavulich May 27, 2026
f079f0f
Fix issue with launching jobs from cron
mkavulich May 27, 2026
894de82
Fix setup_conda for environments where LD_LIBRARY_PATH is unset
mkavulich May 28, 2026
4514341
Fix issues with crontab submission:
mkavulich May 28, 2026
8f6b232
Attempting to get automated pulling of best track data; not quite wor…
mkavulich Jun 16, 2026
76567bc
borrow latest conda setup logic from mpas_plot repository
mkavulich Jun 16, 2026
abae915
Wording fixes, suppress "conda activate" message since setup_conda.sh…
mkavulich Jun 16, 2026
318fc64
Use full ROCOTO_PATH for all rocotorun/rocotostat invocations
mkavulich Jun 16, 2026
ab0fedb
Fix missing rocoto_path in update_expt_status skip list
mkavulich Jun 16, 2026
b90c56b
Fix setup_conda.sh to work when sourced from any directory
mkavulich Jun 16, 2026
09c39de
Use builtin cd in setup_conda.sh to bypass custom cd functions
mkavulich Jun 16, 2026
0e168c8
added --regression_dir arg, rename baseline/metplus args, and update …
georgemccabe Jun 16, 2026
a2d92e4
Added --commit argument to specify a commit to run. Added the --basel…
georgemccabe Jun 16, 2026
dae72c6
added instructions to use the regression test scripts
georgemccabe Jun 16, 2026
f15db16
fix f-string
georgemccabe Jun 16, 2026
a423309
Fetch changes if the repo has already been cloned. Checkout branch or…
georgemccabe Jun 17, 2026
f4aefa4
rename function to be more generic
georgemccabe Jun 17, 2026
6d6ea54
Merge branch 'develop' into feature/regression_tests
georgemccabe Jun 17, 2026
90b91e6
Move baseline branch/commit to its own file so the history of updatin…
georgemccabe Jun 17, 2026
d16a3ee
exit non-zero when differences are flagged
georgemccabe Jun 17, 2026
030d0b6
Pulling of A-DECK files now working!
mkavulich Jun 22, 2026
43e9d90
I'm dumb, we need to retrieve BDECK, not ADECK files. Working now!
mkavulich Jun 22, 2026
b003127
Need to unzip retrieved file
mkavulich Jun 22, 2026
a0dbfaa
Fix some commands and templates, best track pulling now fully working…
mkavulich Jun 22, 2026
e548648
Update PR and Issue templates
mkavulich Jun 22, 2026
1c48fdf
Dont overwrite conda_loc every time setup_conda.sh is invoked
mkavulich Jun 22, 2026
ac52932
Add check in setup.py for old BEST_TRACK variable name
mkavulich Jun 23, 2026
a53fb40
Fix unformatted f-string in get_obs.py
mkavulich Jun 23, 2026
6981d8f
Fix incorrect check for OBS_DIR in pcpcombine.sh for FCST tasks
mkavulich Jun 23, 2026
96241ed
Fix test for get_crontab_contents.py
mkavulich Jun 23, 2026
66f6083
Lint tcpairs.py
mkavulich Jun 23, 2026
a1aba00
Not running test_retrieve_data.py for now; need to adapt to retrieve …
mkavulich Jun 23, 2026
56d3d1c
Fix pylint check
mkavulich Jun 23, 2026
982c943
Restore fix for setup_conda.sh when LD_LIBRARY_PATH is unset
mkavulich Jun 23, 2026
2d6cd5a
ACTUALLY fix pylint check
mkavulich Jun 23, 2026
0666859
Completely disable retrieve_data.py test
mkavulich Jun 23, 2026
09e095b
Merge branch 'develop' into feature/fix_some_issues
mkavulich Jun 24, 2026
6cede53
Merge branch 'develop' into feature/regression_tests
georgemccabe Jun 25, 2026
abd32fc
merged feature/fix_some_issues branch and resolve conflicts with setu…
georgemccabe Jun 25, 2026
6be4b6b
add logging options
georgemccabe Jun 26, 2026
adef994
fix list of all tests (union not intersection)
georgemccabe Jun 26, 2026
9583f1e
print path to log file to terminal
georgemccabe Jun 30, 2026
1f85c91
add --debug command line argument to produce more log information abo…
georgemccabe Jun 30, 2026
5f85da0
log paths that are compared by diff script
georgemccabe Jun 30, 2026
f96adec
update the info about how to update the baseline used for the diff
georgemccabe Jun 30, 2026
7c32a83
remove module load of rocoto since the changes in PR #25 handle findi…
georgemccabe Jun 30, 2026
68ca84e
add instruction to ensure shared regression test directory has group …
georgemccabe Jul 1, 2026
612f3ac
Only check for OBS_DIR if obs are needed
mkavulich Jul 1, 2026
87db0b4
Better check: dont check for OBS_DIR for GenEnsProd task
mkavulich Jul 1, 2026
827a3e8
Fix error submitting TCPAIRS job on Hera: we need to specify a differ…
mkavulich Jul 2, 2026
5f021c6
Merge remote-tracking branch 'origin/develop' into feature/regression…
mkavulich Jul 9, 2026
23c38f0
Add stage directory to diff ignore list
georgemccabe Jul 15, 2026
1917126
per PR feedback from @mkavulich, rename command line argument to diff…
georgemccabe Jul 16, 2026
606a882
per PR feedback from @mkavulich, add argument to test script to run a…
georgemccabe Jul 16, 2026
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
12 changes: 7 additions & 5 deletions scripts/genensprod_or_ensemblestat.sh
Original file line number Diff line number Diff line change
Expand Up @@ -249,14 +249,16 @@ mkdir -p "${OUTPUT_DIR}"
#
#-----------------------------------------------------------------------
#
# Check for existence of top-level OBS_DIR.
# Check for existence of top-level OBS_DIR, if necessary.
#
#-----------------------------------------------------------------------
#
if [ ! -d "${OBS_DIR}" ]; then
print_err_msg_exit "\
OBS_DIR does not exist or is not a directory:
OBS_DIR = \"${OBS_DIR}\""
if [ "${MetplusToolName}" = "EnsembleStat" ]; then
if [ ! -d "${OBS_DIR}" ]; then
print_err_msg_exit "\
OBS_DIR does not exist or is not a directory:
OBS_DIR = \"${OBS_DIR}\""
fi
fi
#
#-----------------------------------------------------------------------
Expand Down
24 changes: 17 additions & 7 deletions setup_conda.sh
Original file line number Diff line number Diff line change
Expand Up @@ -88,16 +88,26 @@ fi

conda activate

if ! conda env list | grep -q "^vx_workflow\s" ; then
echo "Creating vx_workflow environment..."
mamba env create -n vx_workflow --file "${SCRIPT_DIR}/environment.yml" --quiet
# if first argument is vx_diff, create that environment
# otherwise create vx_workflow
ENV_NAME=$1
ENV_YAML=${SCRIPT_DIR}/environment.yml
if [ "${ENV_NAME}" == vx_diff ]; then
ENV_YAML=${SCRIPT_DIR}/tests/regression/environment.yml
else
read -p "vx_workflow environment has already been built. Check for updates using environment.yml? (y/n) " -r
ENV_NAME=vx_workflow
fi

if ! conda env list | grep -q "^${ENV_NAME}\s" ; then
echo "Creating ${ENV_NAME} environment..."
mamba env create -n ${ENV_NAME} --file "${ENV_YAML}" --quiet
else
read -p "${ENV_NAME} environment has already been built. Check for updates using environment.yml? (y/n) " -r
echo
if [[ $REPLY =~ ^[Yy]$ ]] ; then
echo "Updating vx_workflow environment..."
mamba env update -n vx_workflow --file "${SCRIPT_DIR}/environment.yml" --prune --quiet
echo "Updating ${ENV_NAME} environment..."
mamba env update -n ${ENV_NAME} --file "${ENV_YAML}" --prune --quiet
fi
fi

conda activate vx_workflow
conda activate ${ENV_NAME}
177 changes: 177 additions & 0 deletions tests/regression/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,177 @@
# Regression Testing

## Initializing the Test Environment

1. Create regression directory

Determine a directory to store the test output, e.g. `/scratch3/BMC/dtc/dtc-vx-workflow_testing`.
This directory will be used to store the output of the end-to-end test runs
and the METplus code that contains the diff utility script.

Create the directory if it does not already exist.

```
regression_dir=/scratch3/BMC/dtc/dtc-vx-workflow_testing
mkdir -p ${regression_dir}
```

To enable other users to run the tests in this directory,
ensure that the **{regression_dir}** directory has group read/write permissions.

```
chmod g+w ${regression_dir}
```

2. Get METplus

Navigate to the test directory and clone the METplus repository,
using the develop branch.

```
regression_dir=/scratch3/BMC/dtc/dtc-vx-workflow_testing
cd ${regression_dir}
git clone git@github.com:dtcenter/METplus --branch develop
```

3. Create the Baseline Output

Run the regression test script on the develop branch of `dtc-vx-workflow`
to establish a baseline output dataset to compare to the output from other
branches and/or pull requests.
Follow the instructions under the **Generating/Updating the Baseline Output** section.

## Running the Tests

Tests can be run for a branch, pull request, or a specific commit, e.g. the baseline commit.
The `run_regression.py` script will submit a workflow for each end-to-end test case.
In the **{regression_dir}** directory,
a directory will be created named after the branch or pull request.
In that directory, the **dtc-vx-workflow** repository will be cloned using
the branch or merge commit of the pull request. The end-to-end test script
will be run from the **dtc-vx-workflow** directory.
The output will be written to a directory named **output.XXXXXXX** where
*XXXXXXX* is the latest commit has of the branch or pull request.
Subsequent runs will pull the latest changes from the branch or pull request
and rerun the tests, writing to a new **output.XXXXXXX** directory.

```text
{regression_dir}/
├── develop/
│ ├── dtc-vx-workflow/
│ ├── output.abcdef1/
│ └── output.2345678/
├── pr_10/
│ ├── dtc-vx-workflow/
│ ├── output.9abcdef/
│ └── output.1234567/
└── feature/add_HAFS_vx/
├── dtc-vx-workflow/
└── output.b252ab7/
```

The script starts the end-to-end test script using nohup.
The full path to the nohup.out is printed to the screen.
Run `tail -f` on it to see the progress of the tests.

### Generating/Updating the Baseline Output

Calling the `run_regression.py` script with the `--baseline` argument will
run the end-to-end tests for the baseline commit and create a symbolic link
named **output.baseline** in the regression directory.
The baseline commit is stored in the `regression_baseline.py` file in the
**BASELINE_COMMIT** variable.

To update the baseline version, note the first 7 characters of the latest
commit on the develop branch after the changes that modify the output
have been merged.
Open the `regression_baseline.py` file and modify the value of the
**BASELINE_COMMIT** variable to the new commit hash.
**Be sure to commit the change to the develop branch of `dtc-vx-workflow`.**
If the output from the baseline commit has already been generated locally,
the script will skip the tests and update the symbolic link to the baseline commit.

```
account=dtc

machine=ursa
regression_dir=/scratch3/BMC/dtc/dtc-vx-workflow_testing

cd dtc-vx-workflow
python3 ./tests/regression/run_regression.py \
--baseline \
--account ${account} \
--machine ${machine} \
--regression_dir ${regression_dir}
```

### Running on a Branch

```
branch=develop
account=dtc

machine=ursa
regression_dir=/scratch3/BMC/dtc/dtc-vx-workflow_testing

cd dtc-vx-workflow
python3 ./tests/regression/run_regression.py \
--branch ${branch} \
--account ${account} \
--machine ${machine} \
--regression_dir ${regression_dir}
```

### Running on a Pull Request

The instructions for running on a pull request are nearly the same as for running on a branch.
The only difference is that the pull request number is specified using the `--pr` argument instead
of specifying the branch name using the `--branch` argument.

```
pr_number=10
account=dtc

machine=ursa
regression_dir=/scratch3/BMC/dtc/dtc-vx-workflow_testing

cd dtc-vx-workflow
python3 ./tests/regression/run_regression.py \
--pr ${pr_number} \
--account ${account} \
--machine ${machine} \
--regression_dir ${regression_dir}
```

### Running on a Subset of Tests

The `--tests` argument can be provided to the `run_regression.py` script
to define a subset of tests to run.
The format of the argument is the same as the `--tests` argument to the
`tests/WE2E/run_we2e_tests.py` script.
The default behavior is to pass `--tests all` to the `run_we2e_tests.py` script.

## Running the Diff Utility

To run the METplus diff utility, call the `run_diff.py` script,
passing the path to the output directory of the end-to-end tests.
By default, the output.baseline directory is used as the baseline.
You can override this by passing the `--baseline` argument.
You can also override the location of METplus to use with the `--metplus` argument.

The default behavior is to run the diff utility on all files in the dated subdirectories
under the output directory, because these are assumed to contain the actual MET output.
The `--diff_inputs` argument can be added to run the diff utility on each
output directory, which includes the input observation files.
A list of keywords to skip workflow files are defined in the `run_diff.py`
script in the **SKIP_KEYWORDS** variable.

```
regression_dir=/scratch3/BMC/dtc/dtc-vx-workflow_testing
test_dir=${regression_dir}/feature/my_branch_name/output.abcdef1

cd dtc-vx-workflow
source ./setup_conda.sh vx_diff
python3 ./tests/regression/run_diff.py \
${test_dir} \
--regression_dir ${regression_dir}
```
7 changes: 7 additions & 0 deletions tests/regression/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
name: vx_diff
channels:
- conda-forge
dependencies:
- pandas~=3.0.3
- netcdf4~=1.7.4
- pillow~=12.2.0
2 changes: 2 additions & 0 deletions tests/regression/regression_baseline.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
BASELINE_COMMIT = "84b78ac3"
BASELINE_BRANCH = "develop"
8 changes: 8 additions & 0 deletions tests/regression/regression_common.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# default directory for regression test files (Ursa)
DEFAULT_REGRESSION_DIR = "/scratch3/BMC/dtc/dtc-vx-workflow_testing"

# repository for dtc-vx-workflow git clone
WORKFLOW_REPO = "dtcenter/dtc-vx-workflow"

# string to used in diff results to indicate a test was not run
NOT_RUN = "NOT RUN"
Loading
Loading