Skip to content

Enable partial updates of expected results for testing - #852

Open
forsyth2 wants to merge 3 commits into
mainfrom
partial-update-expectations
Open

forsyth2 wants to merge 3 commits into
mainfrom
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 from 14c63dc to 03ce4d2 Compare September 15, 2026 00:54
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.
@forsyth2
forsyth2 force-pushed the partial-update-expectations branch 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.

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