Skip to content

Enable partial updates of expected results for testing - #852

Draft
forsyth2 wants to merge 5 commits into
issue-837-legacy-3.2.0from
partial-update-expectations
Draft

forsyth2 wants to merge 5 commits into
issue-837-legacy-3.2.0from
partial-update-expectations

Conversation

@forsyth2

@forsyth2 forsyth2 commented Aug 13, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Objectives:

  • Update the scripts that update expected results, along with accompanying documentation to allow for partial updates. For example, if we've confirmed new expected results look good for one task but not another, then we may want to only update the expected results for the former.

Select one: This pull request is...

  • a bug fix: increment the patch version
  • a small improvement: increment the minor version
  • a new feature: increment the minor version
  • an incompatible (non-backwards compatible) API change: increment the major version

Small Change

  • To merge, I will use "Squash and merge". That is, this change should be a single commit.
  • Logic: I have visually inspected the entire pull request myself.
  • Pre-commit checks: All the pre-commits checks have passed.

@forsyth2 forsyth2 self-assigned this Aug 13, 2026
@forsyth2 forsyth2 added Documentation Files in `docs` modified Testing Files in `tests` modified labels Aug 13, 2026
@forsyth2

Copy link
Copy Markdown
Collaborator Author

Updating expected results for the 8/12 test run

Set up branch
git checkout partial-update-expectations
git fetch upstream main
git rebase upstream/main
git log --oneline | head -n 4
# b5d41f34 Add auto-generated update files
# ef72638c Change term from diags to tasks
# fffd2338 Support partial updates of weekly/campaign expected test results
# 4735ef4d Merge pull request #854 from E3SM-Project/update-pre-commit-deps

lcrc_conda
rm -rf build
conda clean --all --y
conda env create -f conda/dev.yml -n zppy-pr852-20260814 
conda activate zppy-pr852-20260814 
pre-commit run --all-files
python -m pip install .

cd docs
make html
cp -r _build/ /lcrc/group/e3sm/public_html/diagnostic_output/ac.forsyth2/zppy_docs_pr852
chmod -R 755 /lcrc/group/e3sm/public_html/diagnostic_output/ac.forsyth2/zppy_docs_pr852

Visit: https://web.lcrc.anl.gov/public/e3sm/diagnostic_output/ac.forsyth2/zppy_docs_pr852/html/dev_guide/tests/update_expected_results.html

# First, let's copy over the old expected results #############################
cp -r /lcrc/group/e3sm/public_html/zppy_test_resources /lcrc/group/e3sm/public_html/zppy_test_resources_previous/expected_results_until_20260814 # < 30 min

# Second, update the expected results #########################################
# Let's update the simpler tests' results first:
cd /lcrc/group/e3sm/ac.forsyth2/zppy_main_branch_test_dirs/zppy
git status
# You might have changed branches since you ran the tests.
# Good, on correct branch: test_zppy_20260812_run1
conda activate test-zppy-main-20260812_run1
# Good, now on correct env

# Make sure the update script permissions are set up
chmod 755 tests/integration/generated/update_bash_generation_expected_files_chrysalis.sh
chmod 755 tests/integration/generated/update_campaign_expected_files_chrysalis.sh
chmod 755 tests/integration/generated/update_defaults_expected_files_chrysalis.sh
chmod 755 tests/integration/generated/update_weekly_expected_files_chrysalis.sh

# Specific to partial updates:
# Update the task list
emacs tests/integration/generated/update_weekly_expected_files_chrysalis.sh
# This doesn't have the necessary lines yet because PR #852 didn't exist when this was run!
git add -A
git commit -m "Changes made during testing"
# Remove the old templates and replace with the files from PR #852
rm tests/integration/template_update_campaign_expected_files.sh
rm tests/integration/template_update_weekly_expected_files.sh
emacs tests/integration/template_update_campaign_expected_files.sh
emacs tests/integration/template_update_weekly_expected_files.sh
git diff # Looks ok
git add -A
git commit -m "Copy changes from PR 852"
# Now, we need to re-render the generated files
python tests/integration/utils.py
git diff # Looks ok
chmod 755 tests/integration/generated/update_campaign_expected_files_chrysalis.sh
chmod 755 tests/integration/generated/update_weekly_expected_files_chrysalis.sh
# Double check we have a record of the original expected results
ls -lt /lcrc/group/e3sm/public_html/zppy_test_resources_previous/expected_results_until_20260814
# Update the task list now that it's available:
emacs tests/integration/generated/update_weekly_expected_files_chrysalis.sh
# These are the 3 tasks we know we can update the expected results for:
# tasks=("e3sm_diags" "global_time_series" "pcmdi_diags")
git add -A
git commit -m "Update the update scripts"

# These scripts update the expected results and re-run the tests:
./tests/integration/generated/update_bash_generation_expected_files_chrysalis.sh
# 1 passed in 2.84s
./tests/integration/generated/update_campaign_expected_files_chrysalis.sh
# 6 passed in 2.43s
./tests/integration/generated/update_defaults_expected_files_chrysalis.sh
# 1 passed in 0.72s

# This script only updates the expected results
./tests/integration/generated/update_weekly_expected_files_chrysalis.sh # ~30 min

Skipped because pcmdi_diags only exists in one of the subdirs

WARNING: /lcrc/group/e3sm/public_html/diagnostic_output/ac.forsyth2/zppy_weekly_comprehensive_v2_www/zppy_main_branch_test_20260812_run1/v2.LR.historical_0201/pcmdi_diags does not exist -- skipping (test_name=comprehensive_v2).
WARNING: /lcrc/group/e3sm/public_html/diagnostic_output/ac.forsyth2/zppy_weekly_bundles_www/zppy_main_branch_test_20260812_run1/v3.LR.historical_0051/pcmdi_diags does not exist -- skipping (test_name=bundles).
WARNING: /lcrc/group/e3sm/public_html/diagnostic_output/ac.forsyth2/zppy_weekly_legacy_3.1.0_comprehensive_v2_www/zppy_main_branch_test_20260812_run1/v2.LR.historical_0201/pcmdi_diags does not exist -- skipping (test_name=legacy_3.1.0_comprehensive_v2).
WARNING: /lcrc/group/e3sm/public_html/diagnostic_output/ac.forsyth2/zppy_weekly_legacy_3.1.0_bundles_www/zppy_main_branch_test_20260812_run1/v3.LR.historical_0051/pcmdi_diags does not exist -- skipping (test_name=legacy_3.1.0_bundles).
WARNING: /lcrc/group/e3sm/public_html/diagnostic_output/ac.forsyth2/zppy_weekly_legacy_3.0.0_comprehensive_v2_www/zppy_main_branch_test_20260812_run1/v2.LR.historical_0201/pcmdi_diags does not exist -- skipping (test_name=legacy_3.0.0_comprehensive_v2).
WARNING: /lcrc/group/e3sm/public_html/diagnostic_output/ac.forsyth2/zppy_weekly_legacy_3.0.0_comprehensive_v3_www/zppy_main_branch_test_20260812_run1/v3.LR.historical_0051/pcmdi_diags does not exist -- skipping (test_name=legacy_3.0.0_comprehensive_v3).
WARNING: /lcrc/group/e3sm/public_html/diagnostic_output/ac.forsyth2/zppy_weekly_legacy_3.0.0_bundles_www/zppy_main_branch_test_20260812_run1/v3.LR.historical_0051/pcmdi_diags does not exist -- skipping (test_name=legacy_3.0.0_bundles).
ls /lcrc/group/e3sm/public_html/zppy_test_resources
# Confirmed there are expected results subdirs and image lists for each cfg
ls -lt /lcrc/group/e3sm/public_html/zppy_test_resources 
# Confirmed everything was updated today 8/14

cd /lcrc/group/e3sm/ac.forsyth2/zppy_main_branch_test_dirs/zppy
pytest tests/integration/test_bundles.py
# 2 passed in 1.53s
salloc --nodes=1 --partition=debug --time=02:00:00 --account=e3sm
bash
source ~/.bashrc
lcrc_conda
conda activate test-zppy-main-20260812_run1
pytest tests/integration/test_images.py # ~40 min
exit # Exit bash shell
exit # Exit compute note
Output

Output:

---------------------------------------------------- Captured stdout call ----------------------------------------------------
Preparing weekly cfg tests
Preparing legacy 3.1.0 cfg tests
Preparing legacy 3.0.0 cfg tests
Running 9 tests in parallel
Individual test logs will be written to test_<name>.log files
✓ Completed: bundles (3 tasks) (log: test_bundles.log)
✓ Completed: legacy_3.1.0_bundles (3 tasks) (log: test_legacy_3.1.0_bundles.log)
✓ Completed: legacy_3.1.0_comprehensive_v2 (4 tasks) (log: test_legacy_3.1.0_comprehensive_v2.log)
✓ Completed: comprehensive_v2 (4 tasks) (log: test_comprehensive_v2.log)
✓ Completed: legacy_3.0.0_comprehensive_v2 (4 tasks) (log: test_legacy_3.0.0_comprehensive_v2.log)
✓ Completed: legacy_3.0.0_bundles (3 tasks) (log: test_legacy_3.0.0_bundles.log)
✓ Completed: legacy_3.1.0_comprehensive_v3 (4 tasks) (log: test_legacy_3.1.0_comprehensive_v3.log)
✓ Completed: legacy_3.0.0_comprehensive_v3 (4 tasks) (log: test_legacy_3.0.0_comprehensive_v3.log)
✓ Completed: comprehensive_v3 (5 tasks) (log: test_comprehensive_v3.log)
Copy the output of test_images_summary.md to a Pull Request comment

Test Summary:
Test                                                    Total    Correct     Status
----------------------------------------------------------------------------------
bundles_e3sm_diags                                       1762       1762     ✓ PASS
bundles_global_time_series                                  3          3     ✓ PASS
bundles_ilamb                                             388        388     ✓ PASS
comprehensive_v2_e3sm_diags                              3816       3816     ✓ PASS
comprehensive_v2_mpas_analysis                            856          4     ✗ FAIL
comprehensive_v2_global_time_series                        12         12     ✓ PASS
comprehensive_v2_ilamb                                    776        776     ✓ PASS
comprehensive_v3_e3sm_diags                              5389       5389     ✓ PASS
comprehensive_v3_mpas_analysis                           1280          6     ✗ FAIL
comprehensive_v3_global_time_series                      1404       1404     ✓ PASS
comprehensive_v3_ilamb                                    837        837     ✓ PASS
comprehensive_v3_pcmdi_diags                              647        647     ✓ PASS
legacy_3.1.0_bundles_e3sm_diags                          1762       1762     ✓ PASS
legacy_3.1.0_bundles_global_time_series                     3          3     ✓ PASS
legacy_3.1.0_bundles_ilamb                                388        388     ✓ PASS
legacy_3.1.0_comprehensive_v2_e3sm_diags                 3816       3816     ✓ PASS
legacy_3.1.0_comprehensive_v2_mpas_analysis               856          4     ✗ FAIL
legacy_3.1.0_comprehensive_v2_global_time_series           12         12     ✓ PASS
legacy_3.1.0_comprehensive_v2_ilamb                       776        776     ✓ PASS
legacy_3.1.0_comprehensive_v3_e3sm_diags                 5385       5385     ✓ PASS
legacy_3.1.0_comprehensive_v3_mpas_analysis               856          4     ✗ FAIL
legacy_3.1.0_comprehensive_v3_global_time_series         1404       1404     ✓ PASS
legacy_3.1.0_comprehensive_v3_ilamb                       837        837     ✓ PASS
legacy_3.0.0_bundles_e3sm_diags                          1762       1762     ✓ PASS
legacy_3.0.0_bundles_global_time_series                     3          3     ✓ PASS
legacy_3.0.0_bundles_ilamb                                388        388     ✓ PASS
legacy_3.0.0_comprehensive_v2_e3sm_diags                 3816       3816     ✓ PASS
legacy_3.0.0_comprehensive_v2_mpas_analysis               856          4     ✗ FAIL
legacy_3.0.0_comprehensive_v2_global_time_series           12         12     ✓ PASS
legacy_3.0.0_comprehensive_v2_ilamb                       776        776     ✓ PASS
legacy_3.0.0_comprehensive_v3_e3sm_diags                 5385       5385     ✓ PASS
legacy_3.0.0_comprehensive_v3_mpas_analysis               856          4     ✗ FAIL
legacy_3.0.0_comprehensive_v3_global_time_series           90         90     ✓ PASS
legacy_3.0.0_comprehensive_v3_ilamb                       837        837     ✓ PASS
----------------------------------------------------------------------------------

⚠ Some tests had mismatched or missing images. Check individual log files for details.
================================================== short test summary info ===================================================
FAILED tests/integration/test_images.py::test_images - assert 856 == 4
=============================================== 1 failed in 2490.95s (0:41:30) ===============================================

cat test_images_summary.md:

Test name Total images Correct images Missing images Mismatched images
bundles_e3sm_diags 1762 1762 0 0
bundles_global_time_series 3 3 0 0
bundles_ilamb 388 388 0 0
comprehensive_v2_e3sm_diags 3816 3816 0 0
comprehensive_v2_mpas_analysis 856 4 0 852 (list, grid)
comprehensive_v2_global_time_series 12 12 0 0
comprehensive_v2_ilamb 776 776 0 0
comprehensive_v3_e3sm_diags 5389 5389 0 0
comprehensive_v3_mpas_analysis 1280 6 0 1274 (list, grid)
comprehensive_v3_global_time_series 1404 1404 0 0
comprehensive_v3_ilamb 837 837 0 0
comprehensive_v3_pcmdi_diags 647 647 0 0
legacy_3.1.0_bundles_e3sm_diags 1762 1762 0 0
legacy_3.1.0_bundles_global_time_series 3 3 0 0
legacy_3.1.0_bundles_ilamb 388 388 0 0
legacy_3.1.0_comprehensive_v2_e3sm_diags 3816 3816 0 0
legacy_3.1.0_comprehensive_v2_mpas_analysis 856 4 0 852 (list, grid)
legacy_3.1.0_comprehensive_v2_global_time_series 12 12 0 0
legacy_3.1.0_comprehensive_v2_ilamb 776 776 0 0
legacy_3.1.0_comprehensive_v3_e3sm_diags 5385 5385 0 0
legacy_3.1.0_comprehensive_v3_mpas_analysis 856 4 0 852 (list, grid)
legacy_3.1.0_comprehensive_v3_global_time_series 1404 1404 0 0
legacy_3.1.0_comprehensive_v3_ilamb 837 837 0 0
legacy_3.0.0_bundles_e3sm_diags 1762 1762 0 0
legacy_3.0.0_bundles_global_time_series 3 3 0 0
legacy_3.0.0_bundles_ilamb 388 388 0 0
legacy_3.0.0_comprehensive_v2_e3sm_diags 3816 3816 0 0
legacy_3.0.0_comprehensive_v2_mpas_analysis 856 4 0 852 (list, grid)
legacy_3.0.0_comprehensive_v2_global_time_series 12 12 0 0
legacy_3.0.0_comprehensive_v2_ilamb 776 776 0 0
legacy_3.0.0_comprehensive_v3_e3sm_diags 5385 5385 0 0
legacy_3.0.0_comprehensive_v3_mpas_analysis 856 4 0 852 (list, grid)
legacy_3.0.0_comprehensive_v3_global_time_series 90 90 0 0
legacy_3.0.0_comprehensive_v3_ilamb 837 837 0 0

Failing image check tests:

Test name Total images Correct images Missing images Mismatched images
comprehensive_v2_mpas_analysis 856 4 0 852 (list, grid)
comprehensive_v3_mpas_analysis 1280 6 0 1274 (list, grid)
legacy_3.1.0_comprehensive_v2_mpas_analysis 856 4 0 852 (list, grid)
legacy_3.1.0_comprehensive_v3_mpas_analysis 856 4 0 852 (list, grid)
legacy_3.0.0_comprehensive_v2_mpas_analysis 856 4 0 852 (list, grid)
legacy_3.0.0_comprehensive_v3_mpas_analysis 856 4 0 852 (list, grid)

Good, this table matches the mpas_analysis table from the 8/12 test run. That is, e3sm_diags, global_time_series, and pcmdi_diags have had their expected results successfully updated (no image check failures), but the mpas_analysis expected results were correctly skipped in the update.

@forsyth2 forsyth2 left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've visually inspected the code and tested it out here, so I believe this is ready to merge.

@forsyth2

Copy link
Copy Markdown
Collaborator Author

I think this PR may need to be merged independently of the environment tracking noted here . The expected-results-updater script just chooses which output directories to copy over. To actually populate those dirs with environment notes, we'd need to update the test script itself. And that's what #871 is doing. Specifically:

When producing results, include an environment description for each task. For example, global_time_series/env_description.txt would include the commit hash of zppy-interfaces it was using, and a printout of the conda environment package versions.

@forsyth2
forsyth2 force-pushed the partial-update-expectations branch 2 times, most recently from 03ce4d2 to 7cfba4b Compare September 15, 2026 00:55
@forsyth2

Copy link
Copy Markdown
Collaborator Author

Updating expected results for the 9/4 test run. We got confirmation that pcmdi_diags could have its expected results updated, but not e3sm_diags, so we will only update expected results for the former.

Set up branch
cd ~/ez/zppy
git status
# nothing to commit, working tree clean
git checkout partial-update-expectations
git log --oneline | head -n 4
# b5d41f34 Add auto-generated update files
# ef72638c Change term from diags to tasks
# fffd2338 Support partial updates of weekly/campaign expected test results
# 4735ef4d Merge pull request #854 from E3SM-Project/update-pre-commit-deps

# Good, commit titles match https://github.com/E3SM-Project/zppy/pull/852/commits
# Hashes don't match though. We need to update the GitHub branch since we rebased 
# on an earlier results update.
git push -f upstream partial-update-expectations

git fetch upstream main
git rebase upstream/main
git log --oneline | head -n 4
# 7cfba4b1 Add auto-generated update files
# 1ecb557d Change term from diags to tasks
# 9c6c5185 Support partial updates of weekly/campaign expected test results
# 5232fe30 Rank image check failures by severity (#865)

# Push the latest commit hashes
git push -f upstream partial-update-expectations
# Good, https://github.com/E3SM-Project/zppy/pull/852/commits is updated.

lcrc_conda
rm -rf build
conda clean --all --y
conda env create -f conda/dev.yml -n zppy-pr852-20260914 
conda activate zppy-pr852-20260904
pre-commit run --all-files
python -m pip install .
Copy over the old expected results
ls -lt /lcrc/group/e3sm/public_html/zppy_test_resources
# Updated 9/4

# To know when each specific task had its expected results updated, check:
ls -lt /lcrc/group/e3sm/public_html/zppy_test_resources/expected_comprehensive_v3/
# Sep  4 mpas_analysis
# Sep  4 e3sm_diags
# Aug 14 pcmdi_diags
# Aug 14 global_time_series
# May 20 livvkit
# May 20 ilamb
cp -r /lcrc/group/e3sm/public_html/zppy_test_resources /lcrc/group/e3sm/public_html/zppy_test_resources_previous/expected_results_until_20260914 # <30 minutes
Update the expected results
# Let's update the simpler tests' results first:
cd /lcrc/group/e3sm/ac.forsyth2/zppy_main_branch_test_dirs/zppy
git status
# Good, on correct branch: On branch test_zppy_20260904_run1
# Some changed files exist
git add -A
git commit -m "Testing" --no-verify
git log --oneline | head -n 20
# fdca17c7 Testing
# b72f1d03 Ignore hairlines when looking for changed values
# 4992994e Rank the cosmetic sample by how much actually differs
# 7fd3dbc6 Separate images that did not change from ones that look cosmetic
# a3eec64a Testing
# 35fb99ba Describe how images differ, not why
# ec3fe89f Do not claim a panel changed when only labels did
# da893007 Settle unchanged images from their file bytes
# ee8b0b03 Do not fail when every image is unchanged
# 3fb3d241 Testing
# 7775d42f Name the likely cause on each diff grid row
# 8588ffb2 Hide unused axes on the last page of the diff grid
# e13ee3e0 Label and order the diff grid PDF by severity
# 2dd4d83c Ignore scattered spots when looking for changed values
# ce369bd5 Document how to review image check results
# 3bbacefd Rank image check failures by severity instead of listing them flat
# 31f3d9cd Detect small isolated changes such as a changed number
# 5c346f72 Add image severity scorer
# d0aa0826 Testing
# 77f4ab66 Append try# suffix to image_check_failures dir instead of overwriting (#861)

# Let's drop these extra commits from testing https://github.com/E3SM-Project/zppy/pull/865
git checkout -b test_zppy_20260904_run1_backup20260914
git checkout test_zppy_20260904_run1
git rebase -i 77f4ab66 # Drop later commits
git log --oneline | head -n 2
# d0aa0826 Testing
# 77f4ab66 Append try# suffix to image_check_failures dir instead of overwriting (#861)

conda activate test-zppy-main-20260828_run1
# Good, now on correct env

# Make sure the update script permissions are set up
chmod 755 tests/integration/generated/update_bash_generation_expected_files_chrysalis.sh
chmod 755 tests/integration/generated/update_campaign_expected_files_chrysalis.sh
chmod 755 tests/integration/generated/update_defaults_expected_files_chrysalis.sh
chmod 755 tests/integration/generated/update_weekly_expected_files_chrysalis.sh

# Specific to partial updates:
# Update the task list
emacs tests/integration/generated/update_weekly_expected_files_chrysalis.sh
# This doesn't have the necessary lines yet because PR #852 didn't exist when this was run!
# Remove the old templates and replace with the files from PR #852
rm tests/integration/template_update_campaign_expected_files.sh
rm tests/integration/template_update_weekly_expected_files.sh
# Recall ~/ez/zppy is on the branch for PR #852
cp ~/ez/zppy/tests/integration/template_update_campaign_expected_files.sh tests/integration/template_update_campaign_expected_files.sh
cp ~/ez/zppy/tests/integration/template_update_weekly_expected_files.sh tests/integration/template_update_weekly_expected_files.sh
git diff # Looks ok
git add -A
git commit -m "Copy changes from PR 852"
# Now, we need to re-render the generated files
emacs tests/integration/utils.py # Confirm ALL cfgs_to_run and tasks_to_run are set to run
python tests/integration/utils.py
git status
	# modified:   tests/integration/generated/update_campaign_expected_files_chrysalis.sh
	# modified:   tests/integration/generated/update_weekly_expected_files_chrysalis.sh
chmod 755 tests/integration/generated/update_campaign_expected_files_chrysalis.sh
chmod 755 tests/integration/generated/update_weekly_expected_files_chrysalis.sh
# Double check we have a record of the original expected results
ls -lt /lcrc/group/e3sm/public_html/zppy_test_resources_previous/expected_results_until_20260914
# Update the task list now that it's available:
emacs tests/integration/generated/update_weekly_expected_files_chrysalis.sh
# What we know we can update the expected results for:
# tasks=("pcmdi_diags")
git add -A
git commit -m "Update the update scripts"

# All the non-image-checker integration tests passed, so we can skip these steps:
# These scripts update the expected results and re-run the tests:
# ./tests/integration/generated/update_bash_generation_expected_files_chrysalis.sh
# ./tests/integration/generated/update_campaign_expected_files_chrysalis.sh
# ./tests/integration/generated/update_defaults_expected_files_chrysalis.sh

# This script only updates the expected results
./tests/integration/generated/update_weekly_expected_files_chrysalis.sh # <10 min

Skipped because pcmdi_diags only exists for some cfgs:

WARNING: /lcrc/group/e3sm/public_html/diagnostic_output/ac.forsyth2/zppy_weekly_comprehensive_v2_www/zppy_main_branch_test_20260904_run1/v2.LR.historical_0201/pcmdi_diags does not exist -- skipping (test_name=comprehensive_v2).
WARNING: /lcrc/group/e3sm/public_html/diagnostic_output/ac.forsyth2/zppy_weekly_bundles_www/zppy_main_branch_test_20260904_run1/v3.LR.historical_0051/pcmdi_diags does not exist -- skipping (test_name=bundles).
WARNING: /lcrc/group/e3sm/public_html/diagnostic_output/ac.forsyth2/zppy_weekly_legacy_3.1.0_comprehensive_v2_www/zppy_main_branch_test_20260904_run1/v2.LR.historical_0201/pcmdi_diags does not exist -- skipping (test_name=legacy_3.1.0_comprehensive_v2).
WARNING: /lcrc/group/e3sm/public_html/diagnostic_output/ac.forsyth2/zppy_weekly_legacy_3.1.0_bundles_www/zppy_main_branch_test_20260904_run1/v3.LR.historical_0051/pcmdi_diags does not exist -- skipping (test_name=legacy_3.1.0_bundles).
WARNING: /lcrc/group/e3sm/public_html/diagnostic_output/ac.forsyth2/zppy_weekly_legacy_3.0.0_comprehensive_v2_www/zppy_main_branch_test_20260904_run1/v2.LR.historical_0201/pcmdi_diags does not exist -- skipping (test_name=legacy_3.0.0_comprehensive_v2).
WARNING: /lcrc/group/e3sm/public_html/diagnostic_output/ac.forsyth2/zppy_weekly_legacy_3.0.0_comprehensive_v3_www/zppy_main_branch_test_20260904_run1/v3.LR.historical_0051/pcmdi_diags does not exist -- skipping (test_name=legacy_3.0.0_comprehensive_v3).
WARNING: /lcrc/group/e3sm/public_html/diagnostic_output/ac.forsyth2/zppy_weekly_legacy_3.0.0_bundles_www/zppy_main_branch_test_20260904_run1/v3.LR.historical_0051/pcmdi_diags does not exist -- skipping (test_name=legacy_3.0.0_bundles).
ls /lcrc/group/e3sm/public_html/zppy_test_resources
# Confirmed there are expected results subdirs and image lists for each cfg
ls -lt /lcrc/group/e3sm/public_html/zppy_test_resources 
# Confirmed the two pcmdi-diags-containing dirs were updated today 9/14.
# All image lists were updated today 9/14.
# Everything else was last updated 9/4.
Rerun the tests against the new expected results
cd /lcrc/group/e3sm/ac.forsyth2/zppy_main_branch_test_dirs/zppy
git status
# On branch test_zppy_20260904_run1
# nothing to commit, working tree clean
pytest tests/integration/test_bundles.py
# 2 passed in 1.74s
salloc --nodes=1 --partition=debug --time=02:00:00 --account=e3sm
bash
source ~/.bashrc
lcrc_conda
conda activate test-zppy-main-20260828_run1
python -m pip install .
pytest tests/integration/test_images.py 

exit # Exit bash shell
exit # Exit compute note

Output:

------------------------------------------------ Captured stdout call -------------------------------------------------
Preparing weekly cfg tests
Preparing legacy 3.1.0 cfg tests
Preparing legacy 3.0.0 cfg tests
Running 9 tests in parallel
Individual test logs will be written to test_<name>.log files
✓ Completed: bundles (3 tasks) (log: test_bundles.log)
✓ Completed: legacy_3.1.0_bundles (3 tasks) (log: test_legacy_3.1.0_bundles.log)
✓ Completed: legacy_3.1.0_comprehensive_v2 (4 tasks) (log: test_legacy_3.1.0_comprehensive_v2.log)
✓ Completed: comprehensive_v2 (4 tasks) (log: test_comprehensive_v2.log)
✓ Completed: legacy_3.0.0_bundles (3 tasks) (log: test_legacy_3.0.0_bundles.log)
✓ Completed: legacy_3.0.0_comprehensive_v2 (4 tasks) (log: test_legacy_3.0.0_comprehensive_v2.log)
✓ Completed: legacy_3.1.0_comprehensive_v3 (4 tasks) (log: test_legacy_3.1.0_comprehensive_v3.log)
✓ Completed: comprehensive_v3 (5 tasks) (log: test_comprehensive_v3.log)
✓ Completed: legacy_3.0.0_comprehensive_v3 (4 tasks) (log: test_legacy_3.0.0_comprehensive_v3.log)
Copy the output of test_images_summary.md to a Pull Request comment

Test Summary:
Test                                                    Total    Correct     Status
----------------------------------------------------------------------------------
bundles_e3sm_diags                                       1843       1843     ✓ PASS
bundles_global_time_series                                  3          3     ✓ PASS
bundles_ilamb                                             388        388     ✓ PASS
comprehensive_v2_e3sm_diags                              3870       3869     ✗ FAIL
comprehensive_v2_mpas_analysis                            856        856     ✓ PASS
comprehensive_v2_global_time_series                        12         12     ✓ PASS
comprehensive_v2_ilamb                                    776        776     ✓ PASS
comprehensive_v3_e3sm_diags                              5447       5447     ✓ PASS
comprehensive_v3_mpas_analysis                           1280       1280     ✓ PASS
comprehensive_v3_global_time_series                      1404       1404     ✓ PASS
comprehensive_v3_ilamb                                    837        837     ✓ PASS
comprehensive_v3_pcmdi_diags                              647        647     ✓ PASS
legacy_3.1.0_bundles_e3sm_diags                          1843       1843     ✓ PASS
legacy_3.1.0_bundles_global_time_series                     3          3     ✓ PASS
legacy_3.1.0_bundles_ilamb                                388        388     ✓ PASS
legacy_3.1.0_comprehensive_v2_e3sm_diags                 3870       3867     ✗ FAIL
legacy_3.1.0_comprehensive_v2_mpas_analysis               856        856     ✓ PASS
legacy_3.1.0_comprehensive_v2_global_time_series           12         12     ✓ PASS
legacy_3.1.0_comprehensive_v2_ilamb                       776        776     ✓ PASS
legacy_3.1.0_comprehensive_v3_e3sm_diags                 5443       5443     ✓ PASS
legacy_3.1.0_comprehensive_v3_mpas_analysis               856        856     ✓ PASS
legacy_3.1.0_comprehensive_v3_global_time_series         1404       1404     ✓ PASS
legacy_3.1.0_comprehensive_v3_ilamb                       837        837     ✓ PASS
legacy_3.0.0_bundles_e3sm_diags                          1843       1843     ✓ PASS
legacy_3.0.0_bundles_global_time_series                     3          3     ✓ PASS
legacy_3.0.0_bundles_ilamb                                388        388     ✓ PASS
legacy_3.0.0_comprehensive_v2_e3sm_diags                 3870       3869     ✗ FAIL
legacy_3.0.0_comprehensive_v2_mpas_analysis               856        856     ✓ PASS
legacy_3.0.0_comprehensive_v2_global_time_series           12         12     ✓ PASS
legacy_3.0.0_comprehensive_v2_ilamb                       776        776     ✓ PASS
legacy_3.0.0_comprehensive_v3_e3sm_diags                 5443       5443     ✓ PASS
legacy_3.0.0_comprehensive_v3_mpas_analysis               856        856     ✓ PASS
legacy_3.0.0_comprehensive_v3_global_time_series           90         90     ✓ PASS
legacy_3.0.0_comprehensive_v3_ilamb                       837        837     ✓ PASS
----------------------------------------------------------------------------------

⚠ Some tests had mismatched or missing images. Check individual log files for details.
=============================================== short test summary info ===============================================
FAILED tests/integration/test_images.py::test_images - assert 3870 == 3869
============================================ 1 failed in 852.64s (0:14:12) ============================================

cat test_images_summary.md:

Test name Total images Correct images Missing images Mismatched images
bundles_e3sm_diags 1843 1843 0 0
bundles_global_time_series 3 3 0 0
bundles_ilamb 388 388 0 0
comprehensive_v2_e3sm_diags 3870 3869 0 1 (list, grid)
comprehensive_v2_mpas_analysis 856 856 0 0
comprehensive_v2_global_time_series 12 12 0 0
comprehensive_v2_ilamb 776 776 0 0
comprehensive_v3_e3sm_diags 5447 5447 0 0
comprehensive_v3_mpas_analysis 1280 1280 0 0
comprehensive_v3_global_time_series 1404 1404 0 0
comprehensive_v3_ilamb 837 837 0 0
comprehensive_v3_pcmdi_diags 647 647 0 0
legacy_3.1.0_bundles_e3sm_diags 1843 1843 0 0
legacy_3.1.0_bundles_global_time_series 3 3 0 0
legacy_3.1.0_bundles_ilamb 388 388 0 0
legacy_3.1.0_comprehensive_v2_e3sm_diags 3870 3867 0 3 (list, grid)
legacy_3.1.0_comprehensive_v2_mpas_analysis 856 856 0 0
legacy_3.1.0_comprehensive_v2_global_time_series 12 12 0 0
legacy_3.1.0_comprehensive_v2_ilamb 776 776 0 0
legacy_3.1.0_comprehensive_v3_e3sm_diags 5443 5443 0 0
legacy_3.1.0_comprehensive_v3_mpas_analysis 856 856 0 0
legacy_3.1.0_comprehensive_v3_global_time_series 1404 1404 0 0
legacy_3.1.0_comprehensive_v3_ilamb 837 837 0 0
legacy_3.0.0_bundles_e3sm_diags 1843 1843 0 0
legacy_3.0.0_bundles_global_time_series 3 3 0 0
legacy_3.0.0_bundles_ilamb 388 388 0 0
legacy_3.0.0_comprehensive_v2_e3sm_diags 3870 3869 0 1 (list, grid)
legacy_3.0.0_comprehensive_v2_mpas_analysis 856 856 0 0
legacy_3.0.0_comprehensive_v2_global_time_series 12 12 0 0
legacy_3.0.0_comprehensive_v2_ilamb 776 776 0 0
legacy_3.0.0_comprehensive_v3_e3sm_diags 5443 5443 0 0
legacy_3.0.0_comprehensive_v3_mpas_analysis 856 856 0 0
legacy_3.0.0_comprehensive_v3_global_time_series 90 90 0 0
legacy_3.0.0_comprehensive_v3_ilamb 837 837 0 0

The test output reduces correctly to the following, which correctly matches the 9/4 test run minus the pcmdi_diags errors.

Test name Total images Correct images Missing images Mismatched images
comprehensive_v2_e3sm_diags 3870 3869 0 1 (list, grid)
legacy_3.1.0_comprehensive_v2_e3sm_diags 3870 3867 0 3 (list, grid)
legacy_3.0.0_comprehensive_v2_e3sm_diags 3870 3869 0 1 (list, grid)

@forsyth2

Copy link
Copy Markdown
Collaborator Author

We probably want to update the expected results for all tasks except failed tasks we explicitly don't have confirmation for yet. That is, we should update the expected results even if the image checker tests pass for a task.

For example:

ls -lt /lcrc/group/e3sm/public_html/zppy_test_resources/expected_comprehensive_v3

currently shows:

Aug 14 global_time_series

because global_time_series hasn't failed an image checker test in a month. However, it has had commits added in that time. That means, when it eventually does have an image checker failure, the updated test script of #871 is going to list all commits since 8/14 as possible reasons for failure, rather than simply the commits made since the last test run.

@forsyth2

Copy link
Copy Markdown
Collaborator Author

Promoting the 9/28 test run results to be the new expected results baseline. There, we saw that all diffs were to be expected. That means we can do an umbrella/blanket-update of the expected results.

Set up branch
cd ~/ez/zppy
git status
# On branch issue-869-improve-test-automation
# nothing to commit, working tree clean
git checkout partial-update-expectations
git log --oneline | head -n 4
# 7cfba4b1 Add auto-generated update files
# 1ecb557d Change term from diags to tasks
# 9c6c5185 Support partial updates of weekly/campaign expected test results
# 5232fe30 Rank image check failures by severity (#865)

# Good, has the 3 commits of https://github.com/E3SM-Project/zppy/pull/852/commits
# Titles and hashes match.

lcrc_conda
rm -rf build
conda clean --all --y
conda env create -f conda/dev.yml -n zppy-pr852-20260930 
conda activate zppy-pr852-20260930
pre-commit run --all-files
python -m pip install .
Copy over the old expected results
ls -lt /lcrc/group/e3sm/public_html/zppy_test_resources
# Updated 9/4, 9/14

# To know when each specific task had its expected results updated, check:
ls -lt /lcrc/group/e3sm/public_html/zppy_test_resources/expected_comprehensive_v3/
# Sep  4 mpas_analysis
# Sep  4 e3sm_diags
# Aug 14 pcmdi_diags
# Aug 14 global_time_series
# May 20 livvkit
# May 20 ilamb
cp -r /lcrc/group/e3sm/public_html/zppy_test_resources /lcrc/group/e3sm/public_html/zppy_test_resources_previous/expected_results_until_20260930 # <30 minutes
Update the expected results
# Let's update the simpler tests' results first:
cd /lcrc/group/e3sm/ac.forsyth2/zppy_main_branch_test_dirs/zppy
git status
# Good, on correct branch: On branch test_zppy_20260928_run6
# Some changed files exist
git add -A
git commit -m "Testing" --no-verify
git log --oneline | head -n 36
# db567d5c Testing
# c7dbac38 Guard apply_conda_install_line's conda install with set +u/-u
# ...
# 0b1dc8b8 Automate image checker, add per-task env descriptions, and auto-generate test report
# 64bffc9f Merge pull request #815 from E3SM-Project/zppy_pcmdi_enhancement

# Recall ~/ez/zppy is on the branch for PR #852
cp ~/ez/zppy/tests/integration/template_update_campaign_expected_files.sh tests/integration/template_update_campaign_expected_files.sh
cp ~/ez/zppy/tests/integration/template_update_weekly_expected_files.sh tests/integration/template_update_weekly_expected_files.sh
git diff # Looks ok
git add -A
git commit -m "Copy changes from PR 852"
# Now, we need to re-render the generated files
emacs tests/integration/utils.py # Confirm ALL cfgs_to_run and tasks_to_run are set to run
python tests/integration/utils.py
git status
# modified:   tests/integration/generated/update_campaign_expected_files_chrysalis.sh
# modified:   tests/integration/generated/update_weekly_expected_files_chrysalis.sh

# Make sure the update script permissions are set up
chmod 755 tests/integration/generated/update_bash_generation_expected_files_chrysalis.sh
chmod 755 tests/integration/generated/update_campaign_expected_files_chrysalis.sh
chmod 755 tests/integration/generated/update_defaults_expected_files_chrysalis.sh
chmod 755 tests/integration/generated/update_weekly_expected_files_chrysalis.sh

# Double check we have a record of the original expected results
ls -lt /lcrc/group/e3sm/public_html/zppy_test_resources_previous/expected_results_until_20260930
# Update the task list now that it's available:
emacs tests/integration/generated/update_weekly_expected_files_chrysalis.sh
# What we know we can update the expected results for:
# tasks=()
# We can actually leave it empty so that everything gets updated. 9/28 was a fully passing run (after accounting for expected diffs)
git add -A
git commit -m "Update the update scripts"

# All the non-image-checker integration tests passed, 
# so the following steps are only necessary to update the modified-date.
# BUT we have to run each command twice, 
# because the tests auto-delete output directories on passing runs, so initially there's nothing to transfer.
# These scripts update the expected results and re-run the tests:
./tests/integration/generated/update_bash_generation_expected_files_chrysalis.sh
# 1 passed in 0.61s
./tests/integration/generated/update_campaign_expected_files_chrysalis.sh
# 1 passed in 0.59s
./tests/integration/generated/update_defaults_expected_files_chrysalis.sh
# 1 passed in 0.68s

# This script only updates the expected results
./tests/integration/generated/update_weekly_expected_files_chrysalis.sh # <10 min
cp: cannot stat '/lcrc/group/e3sm/public_html/diagnostic_output/ac.forsyth2/zppy_weekly_legacy_3.1.0_comprehensive_v2_www/zppy_main_branch_test_20260928_run6/v2.LR.historical_0201': No such file or directory
./tests/integration/generated/update_weekly_expected_files_chrysalis.sh: line 95: cd: /lcrc/group/e3sm/public_html/zppy_test_resources/expected_legacy_3.1.0_comprehensive_v2: No such file or directory
cp: cannot stat '/lcrc/group/e3sm/public_html/diagnostic_output/ac.forsyth2/zppy_weekly_legacy_3.1.0_bundles_www/zppy_main_branch_test_20260928_run6/v3.LR.historical_0051': No such file or directory
./tests/integration/generated/update_weekly_expected_files_chrysalis.sh: line 95: cd: /lcrc/group/e3sm/public_html/zppy_test_resources/expected_legacy_3.1.0_bundles: No such file or directory
cp: cannot stat '/lcrc/group/e3sm/public_html/diagnostic_output/ac.forsyth2/zppy_weekly_legacy_3.0.0_comprehensive_v2_www/zppy_main_branch_test_20260928_run6/v2.LR.historical_0201': No such file or directory
./tests/integration/generated/update_weekly_expected_files_chrysalis.sh: line 95: cd: /lcrc/group/e3sm/public_html/zppy_test_resources/expected_legacy_3.0.0_comprehensive_v2: No such file or directory
cp: cannot stat '/lcrc/group/e3sm/public_html/diagnostic_output/ac.forsyth2/zppy_weekly_legacy_3.0.0_bundles_www/zppy_main_branch_test_20260928_run6/v3.LR.historical_0051': No such file or directory
./tests/integration/generated/update_weekly_expected_files_chrysalis.sh: line 95: cd: /lcrc/group/e3sm/public_html/zppy_test_resources/expected_legacy_3.0.0_bundles: No such file or directory

Missing the legacy cfgs we deleted, of course.

ls /lcrc/group/e3sm/public_html/zppy_test_resources
# Confirmed there are expected results subdirs and image lists for each cfg
ls -lt /lcrc/group/e3sm/public_html/zppy_test_resources 
# The only thing not updated today 9/30 arte the image lists for the legacy cfgs we deleted.
Rerun the tests against the new expected results
cd /lcrc/group/e3sm/ac.forsyth2/zppy_main_branch_test_dirs/zppy
git status
# On branch test_zppy_20260928_run6
# nothing to commit, working tree clean
pytest tests/integration/test_bundles.py
# 2 passed in 4.16s
salloc --nodes=1 --partition=debug --time=02:00:00 --account=e3sm
bash
source ~/.bashrc
lcrc_conda
conda activate test-zppy-issue-869-improve-test-automation-20260928_run6 
python -m pip install .
pytest tests/integration/test_images.py
# 1 passed in 397.69s (0:06:37)

exit # Exit bash shell
exit # Exit compute note

Good, everything passes, as expected.

# To update only a subset, comment out the line above and use e.g.:
# campaigns=("cryosphere")

for campaign in "${campaigns[@]}"

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The update here failed because there was no actual to copy over to expected (presumably because the test had passed before and therefore cleaned up its output space). Claude suggests adding a guard like the following

src=test_campaign_${campaign}_output/post/scripts
if ! ls ${src}/*.settings >/dev/null 2>&1; then
    echo "No .settings files in ${src}; run the test once first. Skipping ${campaign}."
    continue
fi

between echo ${campaign} and rm -rf below.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The commit titled "Ensure test output exists" (currently a30efc5) addresses this issue here and in similar places.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is actually still not the best solution. The issue is that the tests (e.g., tests/integration/test_campaign.py) delete the output (e.g., os.system("rm -r test_campaign_water_cycle_override_output")) if successful, in an attempt to clean up. This rerun of the test is just relying on the test failing (because there's no baseline to compare against) and thus not cleaning up.

@forsyth2
forsyth2 force-pushed the partial-update-expectations branch from 7cfba4b to a30efc5 Compare October 10, 2026 00:39
@forsyth2
forsyth2 changed the base branch from main to issue-837-legacy-3.2.0 October 10, 2026 00:43
@forsyth2

Copy link
Copy Markdown
Collaborator Author

To use the latest testing improvements, I've rebased on #886, which in turn is based on #871. I therefore changed the target branch of this PR to be #886's branch.

@forsyth2
forsyth2 marked this pull request as draft October 10, 2026 00:46
@forsyth2
forsyth2 added this pull request to stack #887 October 10, 2026 00:46
@forsyth2
forsyth2 force-pushed the partial-update-expectations branch from a30efc5 to 9c1e077 Compare October 10, 2026 00:51
@forsyth2

Copy link
Copy Markdown
Collaborator Author

Promoting the 10/09 Unified rc3 Chrysalis test run results to be the new expected results baseline. There, we saw that all diffs were to be expected. That means we can do an umbrella/blanket-update of the expected results.

Set up branch
cd ~/ez/zppy
git status
# nothing to commit, working tree clean
git checkout partial-update-expectations
git log --oneline | head -n 5 # Based on top of #886, which is based on top of #871
# 9c1e0775 Ensure test output exists
# d9b32126 Add auto-generated update files
# 8d0441f8 Change term from diags to tasks
# 0de1c9c8 Support partial updates of weekly/campaign expected test results
# 14821d6a Replace legacy 3.1.0/3.0.0 with 3.2.0

# Good, has the 4 commits of https://github.com/E3SM-Project/zppy/pull/852/commits
# Titles and hashes match.

lcrc_conda
rm -rf build
conda clean --all --y
conda env create -f conda/dev.yml -n zppy-pr852-20261009
conda activate zppy-pr852-20261009
pre-commit run --all-files
python -m pip install .
Copy over the old expected results
ls -lt /lcrc/group/e3sm/public_html/zppy_test_resources
# Updated 9/30, 9/14

# To know when each specific task had its expected results updated, check:
ls -lt /lcrc/group/e3sm/public_html/zppy_test_resources/expected_comprehensive_v3/
# All updated 9/30
cp -r /lcrc/group/e3sm/public_html/zppy_test_resources /lcrc/group/e3sm/public_html/zppy_test_resources_previous/expected_results_until_20261009 # <30 minutes
Update the expected results
# Let's update the simpler tests' results first:
cd /lcrc/group/e3sm/ac.forsyth2/zppy_main_branch_test_dirs/zppy
git status
# Good, on correct branch: On branch test_zppy_20261009_run1
# Some changed files exist
git add -A
git commit -m "Testing" --no-verify
git log --oneline | head -n 3
# 99411ab7 Testing
# 8bfc1cbd Add UNIFIED_LOAD_SCRIPT option to test a specific E3SM-Unified
# 79eb98c3 Allow testing zppy from E3SM-Unified in automated test script

# Recall ~/ez/zppy is on the branch for PR #852
cp ~/ez/zppy/tests/integration/template_update_campaign_expected_files.sh tests/integration/template_update_campaign_expected_files.sh
cp ~/ez/zppy/tests/integration/template_update_weekly_expected_files.sh tests/integration/template_update_weekly_expected_files.sh
cp ~/ez/zppy/tests/integration/template_update_bash_generation_expected_files.sh tests/integration/template_update_bash_generation_expected_files.sh
cp ~/ez/zppy/tests/integration/template_update_defaults_expected_files.sh tests/integration/template_update_defaults_expected_files.sh
git diff # Looks ok
git add -A
git commit -m "Copy changes from PR 852"
# Now, we need to re-render the generated files
emacs tests/integration/utils.py # Confirm ALL cfgs_to_run and tasks_to_run are set to run
# Remove these since we aren't testing them anymore
        # "weekly_legacy_3.1.0_comprehensive_v3",
        # "weekly_legacy_3.0.0_comprehensive_v3",
# Don't worry about adding the 3.2.0 cfg in since this test run never ran that cfg.

python tests/integration/utils.py
git status
# modified:   tests/integration/generated/update_bash_generation_expected_files_chrysalis.sh
# modified:   tests/integration/generated/update_campaign_expected_files_chrysalis.sh
# modified:   tests/integration/generated/update_defaults_expected_files_chrysalis.sh
# modified:   tests/integration/generated/update_weekly_expected_files_chrysalis.sh
# modified:   tests/integration/utils.py

# Make sure the update script permissions are set up
chmod 755 tests/integration/generated/update_bash_generation_expected_files_chrysalis.sh
chmod 755 tests/integration/generated/update_campaign_expected_files_chrysalis.sh
chmod 755 tests/integration/generated/update_defaults_expected_files_chrysalis.sh
chmod 755 tests/integration/generated/update_weekly_expected_files_chrysalis.sh

# Double check we have a record of the original expected results
ls -lt /lcrc/group/e3sm/public_html/zppy_test_resources_previous/expected_results_until_20261009
# Update the task list now that it's available (via PR 852):
emacs tests/integration/generated/update_weekly_expected_files_chrysalis.sh
# What we know we can update the expected results for:
# tasks=()
# We can actually leave it empty so that everything gets updated. 10/09 was a fully passing run (after accounting for expected diffs)
git add -A
git commit -m "Update the update scripts"

# This script only updates the expected results:
./tests/integration/generated/update_weekly_expected_files_chrysalis.sh # <10 min 18:50
cp: cannot stat '/lcrc/group/e3sm/public_html/diagnostic_output/ac.forsyth2/zppy_weekly_legacy_3.2.0_comprehensive_v3_www/zppy_main_branch_test_20261009_run1/v3.LR.historical_0051': No such file or directory
./tests/integration/generated/update_weekly_expected_files_chrysalis.sh: line 91: cd: /lcrc/group/e3sm/public_html/zppy_test_resources/expected_legacy_3.2.0_comprehensive_v3: No such file or directory

Missing the legacy 3.2.0 cfgs since we didn't run that test.

# We need to get into the Unified RC
source /lcrc/soft/climate/e3sm-unified/test_e3sm_unified_1.14.0rc3_chrysalis.sh

# These scripts update the expected results and re-run the tests:
./tests/integration/generated/update_bash_generation_expected_files_chrysalis.sh
# 1 passed in 4.07s
./tests/integration/generated/update_campaign_expected_files_chrysalis.sh
# 6 passed in 2.27s
./tests/integration/generated/update_defaults_expected_files_chrysalis.sh
# 1 passed in 0.58s

ls /lcrc/group/e3sm/public_html/zppy_test_resources
# Confirmed there are expected results subdirs and image lists for each cfg
ls -lt /lcrc/group/e3sm/public_html/zppy_test_resources
# Updates today 10/09 (also 9/30, 9/14, but only for obsolete cfgs)
Rerun the tests against the new expected results
cd /lcrc/group/e3sm/ac.forsyth2/zppy_main_branch_test_dirs/zppy
git status
# On branch test_zppy_20261009_run1
# nothing to commit, working tree clean
pytest tests/integration/test_bundles.py
# 2 passed in 0.85s
salloc --nodes=1 --partition=debug --time=02:00:00 --account=e3sm
bash
source ~/.bashrc
# We need to get into the Unified RC
source /lcrc/soft/climate/e3sm-unified/test_e3sm_unified_1.14.0rc3_chrysalis.sh
pytest tests/integration/test_images.py
# 1 passed in 353.99s (0:05:53)

exit # Exit bash shell
exit # Exit compute note

Good, everything passes, as expected.

@forsyth2
forsyth2 force-pushed the partial-update-expectations branch from 9c1e077 to 3b24eb4 Compare October 14, 2026 17:52
@forsyth2 forsyth2 mentioned this pull request Oct 14, 2026
3 tasks done
@forsyth2
forsyth2 force-pushed the partial-update-expectations branch from 3b24eb4 to 48ffaef Compare October 16, 2026 18:19
@forsyth2
forsyth2 force-pushed the partial-update-expectations branch from 48ffaef to a71f07d Compare October 16, 2026 23:02
@forsyth2

Copy link
Copy Markdown
Collaborator Author

Promoting the 2026-10-16 Pre-E3SM Unified 1.14.0rc4 Chrysalis test results to be the new expected results baseline. There, we saw that all diffs were to be expected. That means we can do an umbrella/blanket-update of the expected results.

Set up branch
cd ~/ez/zppy
git status
# nothing to commit, working tree clean
git checkout partial-update-expectations
git log --oneline | head -n 5 
# a71f07df Ensure test output exists
# b1bbb531 Add auto-generated update files
# f5f4b267 Change term from diags to tasks
# 92fe6799 Support partial updates of weekly/campaign expected test results
# 758bcbe5 Handle missing image baselines without crashing image tests

# Good, has the 4 commits of https://github.com/E3SM-Project/zppy/pull/852/commits
# Titles and hashes match.
# Based on top of #886, #871

lcrc_conda
conda activate zppy-pr871-improve-test 
pre-commit run --all-files
python -m pip install .
Copy over the old expected results
ls -lt /lcrc/group/e3sm/public_html/zppy_test_resources
# Updated 10/9 (also 9/30, 9/14 for obsolete tests)

# To know when each specific task had its expected results updated, check:
ls -lt /lcrc/group/e3sm/public_html/zppy_test_resources/expected_comprehensive_v3/
# All updated 10/9
cp -r /lcrc/group/e3sm/public_html/zppy_test_resources /lcrc/group/e3sm/public_html/zppy_test_resources_previous/expected_results_until_20261019 # <30 minutes
Update the expected results
# Let's update the simpler tests' results first:
cd /lcrc/group/e3sm/ac.forsyth2/zppy_main_branch_test_dirs/zppy
git status
# Good, on correct branch: On branch test_zppy_20261016_run1
# Some changed files exist
git add -A
git commit -m "Testing" --no-verify
git log --oneline | head -n 7
# 36148e35 Testing
# dc8ab27f Testing
# a71f07df Ensure test output exists
# b1bbb531 Add auto-generated update files
# f5f4b267 Change term from diags to tasks
# 92fe6799 Support partial updates of weekly/campaign expected test results
# 758bcbe5 Handle missing image baselines without crashing image tests

# This branch is already based off #852, #862, #871
# So, it has the updater scripts.

cat tests/integration/utils.py
# "cfgs_to_run": [
#     "weekly_bundles",
#     "weekly_comprehensive_v2",
#     "weekly_comprehensive_v3",
#     "weekly_legacy_3.2.0_comprehensive_v3",
# ],
python tests/integration/utils.py
git status
# As expected, nothing needed to be updated.

# Make sure the update script permissions are set up
chmod 750 tests/integration/generated/update_bash_generation_expected_files_chrysalis.sh
chmod 750 tests/integration/generated/update_campaign_expected_files_chrysalis.sh
chmod 750 tests/integration/generated/update_defaults_expected_files_chrysalis.sh
chmod 750 tests/integration/generated/update_weekly_expected_files_chrysalis.sh

# Double check we have a record of the original expected results
ls -lt /lcrc/group/e3sm/public_html/zppy_test_resources_previous/expected_results_until_20261019
# Update the task list now that it's available (via PR 852):
emacs tests/integration/generated/update_weekly_expected_files_chrysalis.sh
# What we know we can update the expected results for:
# tasks=()
# We can actually leave it empty so that everything gets updated. 10/19 was a fully passing run (after accounting for expected diffs)

# This script only updates the expected results:
./tests/integration/generated/update_weekly_expected_files_chrysalis.sh

# We need to install the conda env used during the test now
conda activate test-zppy-partial-update-expectations-20261016_run1

# These scripts update the expected results and re-run the tests:
./tests/integration/generated/update_bash_generation_expected_files_chrysalis.sh
# 1 passed in 4.04s
./tests/integration/generated/update_campaign_expected_files_chrysalis.sh
# 6 passed in 3.25s
./tests/integration/generated/update_defaults_expected_files_chrysalis.sh
# 1 passed in 1.41s

ls /lcrc/group/e3sm/public_html/zppy_test_resources
# Confirmed there are expected results subdirs and image lists for each cfg
ls -lt /lcrc/group/e3sm/public_html/zppy_test_resources
# Updates today 10/19 (also 9/30, 9/14, but only for obsolete cfgs)
Rerun the tests against the new expected results
cd /lcrc/group/e3sm/ac.forsyth2/zppy_main_branch_test_dirs/zppy
git status
# On branch test_zppy_20261016_run1
# nothing to commit, working tree clean
pytest tests/integration/test_bundles.py
# 2 passed in 1.50s
salloc --nodes=1 --partition=debug --time=02:00:00 --account=e3sm
bash
source ~/.bashrc
# We need to get into the Unified RC
lcrc_conda
conda activate test-zppy-partial-update-expectations-20261016_run1
pytest tests/integration/test_images.py
# 1 passed in 508.07s (0:08:28)
exit # Exit bash shell
exit # Exit compute note

Good, everything passes, as expected.

@forsyth2
forsyth2 force-pushed the partial-update-expectations branch from a71f07d to a48dd33 Compare October 20, 2026 16:07
@forsyth2

forsyth2 commented Oct 20, 2026 •

Copy link
Copy Markdown
Collaborator Author

I noticed:ls /lcrc/group/e3sm/public_html/zppy_test_resources/expected_comprehensive_v3/ includes image_check_failures_comprehensive_v3_try2. I don't think that would affect test results since it's not a task name, but we should probably update the expected results baseline updater script to specifically exclude anything prefixed with image_check_failures/.

@forsyth2
forsyth2 force-pushed the partial-update-expectations branch from a48dd33 to 5c768fd Compare October 30, 2026 17:32
@forsyth2

Copy link
Copy Markdown
Collaborator Author

The latest commit, 3fa4066, addresses the comment above.

I had noticed a couple issues:

Issue 1: `image_check_failures` is showing up
cd /lcrc/group/e3sm/public_html/zppy_test_resources
ls expected_comprehensive_v3/
# e3sm_diags                                  mpas_analysis
# global_time_series                          pcmdi_diags
# ilamb                                       provenance.20261016_191005_414768.cfg
# image_check_failures_comprehensive_v3_try2  provenance.20261016_191005_414768.settings
# livvkit
grep image_check_failures image_list_expected_* | wc -l
# 13,716 occurrences
Issue 2: legacy 3.0.0 and 3.1.0 are still showing up in expected results even though they've been replaced by legacy 3.2.0
cd /lcrc/group/e3sm/public_html/zppy_test_resources

ls
# expected_bash_files
# expected_bundles
# expected_comprehensive_v2
# expected_comprehensive_v3
# expected_legacy_3.0.0_comprehensive_v3
# expected_legacy_3.1.0_comprehensive_v3
# expected_legacy_3.2.0_comprehensive_v3
# image_list_expected_bundles.txt
# image_list_expected_comprehensive_v2.txt
# image_list_expected_comprehensive_v3.txt
# image_list_expected_legacy_3.0.0_bundles.txt
# image_list_expected_legacy_3.0.0_comprehensive_v2.txt
# image_list_expected_legacy_3.0.0_comprehensive_v3.txt
# image_list_expected_legacy_3.1.0_bundles.txt
# image_list_expected_legacy_3.1.0_comprehensive_v2.txt
# image_list_expected_legacy_3.1.0_comprehensive_v3.txt
# image_list_expected_legacy_3.2.0_comprehensive_v3.txt
# test_campaign_cryosphere_expected_files
# test_campaign_cryosphere_override_expected_files
# test_campaign_high_res_v1_expected_files
# test_campaign_none_expected_files
# test_campaign_water_cycle_expected_files
# test_campaign_water_cycle_override_expected_files
# test_defaults_expected_files


ls *legacy_3.0.0*
# image_list_expected_legacy_3.0.0_bundles.txt
# image_list_expected_legacy_3.0.0_comprehensive_v2.txt
# image_list_expected_legacy_3.0.0_comprehensive_v3.txt

# expected_legacy_3.0.0_comprehensive_v3:
# e3sm_diags          ilamb    mpas_analysis  provenance.20260929_003221_561557.cfg
# global_time_series  livvkit  pcmdi_diags    provenance.20260929_003221_561557.settings

ls *legacy_3.1.0*
# image_list_expected_legacy_3.1.0_bundles.txt
# image_list_expected_legacy_3.1.0_comprehensive_v2.txt
# image_list_expected_legacy_3.1.0_comprehensive_v3.txt

# expected_legacy_3.1.0_comprehensive_v3:
# e3sm_diags          ilamb    mpas_analysis  provenance.20260929_003209_423067.cfg
# global_time_series  livvkit  pcmdi_diags    provenance.20260929_003209_423067.settings

Claude did agree that since image_checker.py checks specific task names, it should be safe to run the test even with these extra files -- they're just clutter that can be removed in the next expected results baseline update.

Previously, update_weekly_expected_files_*.sh and
update_campaign_expected_files.sh always overwrote every diag
subdirectory (e.g. e3sm_diags, mpas_analysis, ilamb, ...) or every
campaign in one pass, making it impossible to accept new results for
one diagnostic while leaving another pinned to its old expected output.

- template_update_weekly_expected_files.sh: add a `diags` selector
  array. Empty (default) preserves the old full-wipe-and-copy
  behavior. Populated (e.g. diags=("e3sm_diags")), only those
  subdirectories are refreshed; "bundle_files" is selectable the
  same way for the bundle*.bash copy step. The image list is still
  generated by walking the full directory, so it reflects both
  updated and untouched diags.

- template_update_campaign_expected_files.sh: hardcoded campaign
  list replaced with a `campaigns` array for the same kind of subset
  updates.

- template_update_bash_generation_expected_files.sh and
  template_update_defaults_expected_files.sh: unchanged -- each
  produces a single expected-files dir with nothing to partially select.

- docs/source/dev_guide/tests/update_expected_results.rst: document
  the new selectors and note the full backup step should still
  always run first.

This diff was generated by Claude (Anthropic).
Add the `update_` files that `python tests/integration/utils.py` creates.
…lures

- Prune expected_legacy_* dirs and image lists for legacy versions other
  than the current one, so replaced versions (e.g. 3.0.0, 3.1.0) no longer
  linger after a bump. Driven by a new `legacy_version` variable.
- Remove image_check_failures_* by glob rather than exact name. The image
  checker appends _tryN to the directory name on reruns, so the exact-name
  rm missed it and the directory was copied into the expected files.
- Exclude image_check_failures_* from the generated image lists.

Generated with Claude.
@forsyth2
forsyth2 force-pushed the partial-update-expectations branch from 3fa4066 to b789c78 Compare October 30, 2026 23:43
@forsyth2 forsyth2 mentioned this pull request Oct 30, 2026
1 of 17 tasks

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Documentation Files in `docs` modified Testing Files in `tests` modified

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant