Skip to content

Switch to Using ClawpackTestRunner for Testing#697

Merged
rjleveque merged 70 commits into
clawpack:masterfrom
mandli:switch-test-runner
Apr 4, 2026
Merged

Switch to Using ClawpackTestRunner for Testing#697
rjleveque merged 70 commits into
clawpack:masterfrom
mandli:switch-test-runner

Conversation

@mandli
Copy link
Copy Markdown
Member

@mandli mandli commented Mar 17, 2026

This PR aims to use the new testing framework now used in AMRClaw and Classic to run regression tests from clawutil's ClawpackTestRunner class. This switches everything over to using PyTest and as much functionality as possible from there.

Major goals for this particular PR is to use the same testing structure as was in AMRClaw and Classic, but change things minimally to get things working before moving onto to larger structural changes.

@mandli mandli force-pushed the switch-test-runner branch from f7ba443 to 4f7d6bb Compare March 17, 2026 15:27
mandli added 23 commits March 18, 2026 11:25
Also adds marks for test groupings and default set of tests to run.  This
also adds new regression test data for storm surge as the test has been
changed to be more robust and cover more of the package.  This also
includes depending on a local storm file rather than attempting to
download data (covered elsewhere in a Python unit test).
The plotting tests have been split into "smoke" tests (does it raise an
exception) and actual plotting tests that can be run on request.
Included some bug fixes in storm module for formats that are tested
but not used very often.  Need to come back to fix the IBTrACS test.
Note: test_dtopo_io has been marked as expected to fail with the measured
5e-4 discrepency noted.  This may be due to the precision being used by
default to write out the files but needs follow up.
Provides seperation of structure (plotting and writing of data) similar
to how other topotools tests are carried out.
Also simplifies flagging for building the multi-layer code against LAPACK.
Also fixes some things in the testing.yml file so that it correctly archives
test output on failure and gives more output for debugging.  Also adds
so that tests that use it can be tested.
These were added, but two are currently broken as the read functions
do not work.  These have been marked as expected to fail.  The SurgeData
test now works, but did require a bug fix.
This test is failing due to what appears to be an off by one error and
just a bit of a mismatch in the regression data.  This requires more
looking into, but the test works.
Does not match gauge output yet and needs a validation pass to look at
gauge changes.
@mandli
Copy link
Copy Markdown
Member Author

mandli commented Apr 3, 2026

Phew, all the tests from before are now implemented! There are a few issues that need to be looked at though:

  1. Tests marked as xfail/xpass:
    • tests/test_storm.py::test_storm_io[ibtracs] - This is expected as ibtracs have not been fully implemented
    • tests/test_dtopotools.py::test_dtopo_io - Failing occasionally, need to look at read/write precision
    • tests/test_data.py::test_read_fgmax_data_multiple_grids - FGmaxData.read does not yet round-trip this multi-grid/point_style case correctly.
      correctly.
    • tests/test_data.py::test_dtopo_data_roundtrip - DTopoData.read currently fails to parse this written dtopo.data round-trip case.
    • examples/tsunami/island-particles/test_particles.py - Slight gauge mismatch
    • examples/tsunami/dtopo/test_dtopo.py::test_dtopo - Slight gauge mismatch
    • examples/tsunami/chile2010_adjoint/test_chile2010_adjoint_forward.py - Slight gauge mismatch
  2. Skipped
    • tests/test_dtopotools.py::test_geometry - Uses old tools and may be duplicative with use of newer tools
    • tests/test_dtopotools.py - Skipped comparison with old tools

More test coverage is possible, but if we can merge this in, we can also systematically correct the remaining regression data issues.

@mandli
Copy link
Copy Markdown
Member Author

mandli commented Apr 3, 2026

Current markers implemented (in pytest.ini):

  • Test type (choose one):
    • python: pure Python unit tests
    • regression: example-based regression tests (Fortran)
  • Execution characteristics:
    • slow: slower tests not intended for the default quick CI path
    • remote: tests that require fetching a file from the web
    • netcdf: tests requiring NetCDF support
  • Domain / feature grouping:
    • tsunami: tsunami related tests
    • storm: storm surge related tests
    • multilayer: multilayer shallow water related tests
    • adjoint: inverse/adjoint solver releated tests
    • adjoint_forward: forward runs that use inverse/adjoint solver, uses adjoint data

@mandli
Copy link
Copy Markdown
Member Author

mandli commented Apr 3, 2026

I have now split the testing into three groups:

  1. python unit testing, which will eventually also include linting.
  2. regression testing
  3. slow regression testing

There's really only one slow regression test right now, and it really does not do anything but run a longer run. The intent is that the slow regression testing will happen periodically (daily at 6 AM UTC right now). We could also add another one that would do the gallery examples, or do the Jupyter notebooks associated with the repos. Wanted to get an example running though so that we can think about how to use it.

If this looks good, I can move this structure to AMRClaw and classic when it makes sense.

@rjleveque
Copy link
Copy Markdown
Member

Merging this along with clawpack/classic#96 and clawpack/amrclaw#310.

@rjleveque rjleveque merged commit 7ef5416 into clawpack:master Apr 4, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants