Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
cca9dea
Convert test module to new clawpack test runner
mandli Mar 17, 2026
e3809fd
Convert test_units to pytest
mandli Mar 17, 2026
96120fd
Add new testing matrix for GitHub CI
mandli Mar 17, 2026
a9f359c
Select only working tesets and update action versions
mandli Mar 17, 2026
a2e3976
Temporarily disable linting
mandli Mar 17, 2026
4f7d6bb
Update bowl-slosh
mandli Mar 17, 2026
cb65c85
Add storm surge Ike regression test to new tests
mandli Mar 18, 2026
04b1468
Remove gauge 1 from storm regression test
mandli Mar 18, 2026
cb41daf
Handle finer case for ike test
mandli Mar 18, 2026
14877b8
Correct CI testing path
mandli Mar 18, 2026
b1d7b4e
Add pandas dependency to CI
mandli Mar 18, 2026
74f7ac2
Convert over test_util.py
mandli Mar 23, 2026
6e0fc81
Add topo_topotools to new testing framework
mandli Mar 23, 2026
ebd1595
Remove plot marker, rely on skipping of test when matplotlib is not p…
mandli Mar 23, 2026
9329cd9
Rework unstructured, remote and netcdf tests
mandli Mar 23, 2026
e68af2c
Convert over storm tests
mandli Mar 23, 2026
6cb61c8
Fix up unit tests
mandli Mar 23, 2026
cfe84cd
Convert test_dtopotools
mandli Mar 23, 2026
aa509b1
Merge test_etopo1 into test_topotools
mandli Mar 23, 2026
6212472
Move tests from isaac to test_storm
mandli Mar 24, 2026
0512d85
Fix categorization bug and add tests
mandli Mar 24, 2026
811f719
Update multi-layer plane_wave test regression data
mandli Mar 24, 2026
b779bb4
Add LAPACK as a dependency for multi-layer testing
mandli Mar 24, 2026
fefc57d
Add netcdf4 python package to CI
mandli Mar 24, 2026
2e02a73
Remove old regression tests
mandli Mar 24, 2026
7569354
Add more data module tests
mandli Mar 26, 2026
339992d
Convert over dtopo test
mandli Mar 26, 2026
aa07545
Convert particles test
mandli Mar 26, 2026
daf03f7
Correct testing.yml path to test
mandli Mar 26, 2026
87d2e06
Add netcdf bowl-slosh test
mandli Mar 27, 2026
79c6e54
Add netcdf libraries to system installs
mandli Mar 27, 2026
d24cd4b
Update Isaac test and depend on local ATCF data
mandli Mar 27, 2026
7b940ad
Add Isaac test
mandli Mar 30, 2026
566d372
Correct some path inconsistencies
mandli Mar 30, 2026
097c1fc
Lengthen all file name character strings to 512
mandli Mar 31, 2026
4ca6c0a
Adjoint test has been converted
mandli Mar 31, 2026
450afeb
Add adjoint test mark
mandli Mar 31, 2026
1f45700
Correct path and add xfail mark to adjoint test
mandli Mar 31, 2026
6420341
Consolidate common testing functionality into test runner class
mandli Apr 1, 2026
71a5a0d
Use test load_module functionality
mandli Apr 1, 2026
324a011
Add adjoint_forward pytest mark
mandli Apr 1, 2026
a60acf3
Fix xarray issue with storm
mandli Apr 1, 2026
1937fad
Remove extraneous set_data
mandli Apr 1, 2026
702ac13
Update regression data for isaac
mandli Apr 1, 2026
a658b06
Add scipy testing dependency
mandli Apr 1, 2026
19e898b
Fix isaac storm file tests
mandli Apr 2, 2026
41c9e93
Fix pointing to load_module
mandli Apr 2, 2026
5073858
Fix another problematic load_module
mandli Apr 2, 2026
95a8b5a
Switch to fullpath_module
mandli Apr 2, 2026
6c7d693
Fix archiving for CI
mandli Apr 2, 2026
372ee11
Enable verbose reporting in test CI
mandli Apr 3, 2026
b019378
Remove debugging and reenable all tests
mandli Apr 3, 2026
c551a9d
Turn on debugging for CI
mandli Apr 3, 2026
259e0dc
Try enabling more tests for CI
mandli Apr 3, 2026
3f552da
Turn back on all python tests
mandli Apr 3, 2026
60644c9
Add fix for tests breaking with write_geoclaw
mandli Apr 3, 2026
44943eb
Turn back on all tests
mandli Apr 3, 2026
7474f71
Remove leftover old adjoint test
mandli Apr 3, 2026
3ab25da
Update test readme and make minor tests adjustments
mandli Apr 3, 2026
0615165
Tweak markers and testing steps
mandli Apr 3, 2026
716190d
Rework CI testing
mandli Apr 3, 2026
c41f467
Add slow tests GitHub action
mandli Apr 3, 2026
d329fcd
Add missing flagging script for CI
mandli Apr 3, 2026
fa5ae8c
Add compiler support back to python
mandli Apr 3, 2026
ed37878
Correct path inconsistencies in CI actions
mandli Apr 3, 2026
309ede4
Setup Ike test for slow regression comparison
mandli Apr 3, 2026
f8c1a1a
Standarize CLI calling of tests
mandli Apr 3, 2026
702896c
Missed a couple
mandli Apr 3, 2026
dd61442
Add missing save in tests
mandli Apr 3, 2026
15ecc0d
Correct some incorrect saves
mandli Apr 3, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 83 additions & 0 deletions .github/scripts/set_test_env.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
#!/usr/bin/env bash

# Configure CI test environment variables for GeoClaw workflows.
# Usage:
# source .github/scripts/set_test_env.sh regression <compiler> <build>

set -euo pipefail

test_group="${1:-}"
compiler="${2:-}"
build="${3:-}"

if [[ -z "${test_group}" || -z "${compiler}" || -z "${build}" ]]; then
echo "Usage: source .github/scripts/set_test_env.sh <test_group> <compiler> <build>"
return 1 2>/dev/null || exit 1
fi

case "${test_group}" in
regression|slow)
case "${compiler}" in
gcc)
case "${build}" in
debug)
export FFLAGS="-O0 -g -fcheck=all -fbacktrace -fbounds-check -ffpe-trap=invalid,zero,overflow -finit-real=nan -finit-integer=nan -Wall -Wunderflow -Wextra -Wconversion -Wuninitialized -Warray-bounds -Wshadow -Wno-unused-function -Wno-unused-variable -Wno-unused-parameter -Wno-unused-label -Wno-unused-but-set-variable"
export OMP_NUM_THREADS=1
;;
opt)
export FFLAGS="-O1 -fopenmp -funroll-loops -finline-functions -ftree-vectorize -fstack-protector-strong"
export OMP_NUM_THREADS=2
;;
*)
echo "Unknown build type: ${build}"
return 1 2>/dev/null || exit 1
;;
esac
;;
intel|intel-classic)
case "${build}" in
debug)
export FFLAGS="-O0 -debug all -check all -warn all,nodec,interfaces -gen_interfaces -traceback -fpe0 -ftrapuv -init=snan,arrays -check bounds"
export OMP_NUM_THREADS=1
;;
opt)
export FFLAGS="-O -qopenmp -unroll -finline-functions -inline-forceinline -ipo -ip"
export OMP_NUM_THREADS=2
;;
*)
echo "Unknown build type: ${build}"
return 1 2>/dev/null || exit 1
;;
esac
;;
lfortran)
case "${build}" in
debug)
export FFLAGS=""
export OMP_NUM_THREADS=1
;;
opt)
export FFLAGS="--fast --openmp"
export OMP_NUM_THREADS=2
;;
*)
echo "Unknown build type: ${build}"
return 1 2>/dev/null || exit 1
;;
esac
;;
nvidia-hpc|flang)
echo "${compiler} compiler not yet supported"
return 1 2>/dev/null || exit 1
;;
*)
echo "Unknown compiler: ${compiler}"
return 1 2>/dev/null || exit 1
;;
esac
;;
*)
echo "Unknown test group: ${test_group}"
return 1 2>/dev/null || exit 1
;;
esac
79 changes: 79 additions & 0 deletions .github/workflows/slow-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: Slow tests

on:
workflow_dispatch:
schedule:
- cron: '0 6 * * *'

env:
CLAW: ${{ github.workspace }}

jobs:
slow-tests:
name: >
slow - ${{ matrix.os }} - ${{ matrix.toolchain.compiler }} ${{ matrix.build }} - py ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
build: [opt]
python-version: ['3.12']
toolchain:
- {compiler: gcc, version: 14}

steps:
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y libblas-dev liblapack-dev libnetcdf-dev libnetcdff-dev pkg-config

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6.2.0
with:
python-version: ${{ matrix.python-version }}

- name: Set up compilers
uses: fortran-lang/setup-fortran@v1.9.0
id: setup-fortran
with:
compiler: ${{ matrix.toolchain.compiler }}
version: ${{ matrix.toolchain.version }}

- name: Install python dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 meson-python ninja pytest numpy pandas xarray
pip install scipy netCDF4

- name: Checkout Clawpack
uses: actions/checkout@v6.0.2
with:
repository: clawpack/clawpack
submodules: true

- name: Checkout GeoClaw branch
uses: actions/checkout@v6.0.2
with:
path: geoclaw

- name: Install clawpack python
run: |
pip install --no-build-isolation --editable .

- name: Run Slow Tests
run: |
cd ${CLAW}/geoclaw
source .github/scripts/set_test_env.sh slow "${{ matrix.toolchain.compiler }}" "${{ matrix.build }}"
echo "FFLAGS: $FFLAGS"
echo "OMP_NUM_THREADS: $OMP_NUM_THREADS"
pytest --basetemp=${CLAW}/geoclaw/pytest_tmp -vv -s -o addopts="" \
-m "slow"

- name: Upload test results
if: failure()
uses: actions/upload-artifact@v7
with:
name: test_results_slow_${{ matrix.os }}_${{ matrix.toolchain.compiler }}_${{ matrix.build }}
path: ${{ env.CLAW }}/geoclaw/pytest_tmp
if-no-files-found: ignore
205 changes: 166 additions & 39 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
@@ -1,57 +1,184 @@
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python

name: Python application
name: Test GeoClaw

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

workflow_dispatch:

permissions:
contents: read

jobs:
build:
env:
CLAW: ${{ github.workspace }}

runs-on: ubuntu-latest
jobs:
python-tests:
name: >
python - ${{ matrix.os }} - ${{ matrix.toolchain.compiler }} - py ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
python-version: '3.12'
toolchain: {compiler: gcc, version: 14}
- os: ubuntu-latest
python-version: '3.13'
toolchain: {compiler: gcc, version: 14}
- os: macos-latest
python-version: '3.12'
toolchain: {compiler: gcc, version: 15}
- os: macos-latest
python-version: '3.13'
toolchain: {compiler: gcc, version: 15}

steps:
- name: Set up Python 3.10
uses: actions/setup-python@v5
- name: Install system dependencies
run: |
if [ "${{ matrix.os }}" == "ubuntu-latest" ]; then
sudo apt-get update
sudo apt-get install -y libblas-dev liblapack-dev libnetcdf-dev libnetcdff-dev pkg-config
elif [ "${{ matrix.os }}" == "macos-latest" ]; then
brew update
brew install netcdf-fortran
fi
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6.2.0
with:
python-version: "3.10"
- name: Checkout clawpack
uses: actions/checkout@v4.1.5
python-version: ${{ matrix.python-version }}

- name: Set up compilers
uses: fortran-lang/setup-fortran@v1.9.0
id: setup-fortran
with:
compiler: ${{ matrix.toolchain.compiler }}
version: ${{ matrix.toolchain.version }}

- name: Install python dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 meson-python ninja pytest numpy pandas xarray
pip install scipy netCDF4

- name: Checkout Clawpack
uses: actions/checkout@v6.0.2
with:
repository: clawpack/clawpack
- name: Install dependencies
submodules: true

- name: Checkout GeoClaw branch
uses: actions/checkout@v6.0.2
with:
path: geoclaw

- name: Install clawpack python
run: |
pip install --no-build-isolation --editable .

# Temporarily disable linting
# - name: Lint with flake8
# if: ${{ matrix.build == 'debug' }}
# run: |
# cd ${CLAW}/geoclaw
# # stop the build if there are Python syntax errors or undefined names
# flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics --exclude dev
# # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
# flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics

- name: Run Python Unit Tests
run: |
cd ${CLAW}/geoclaw
pytest --basetemp=${CLAW}/geoclaw/pytest_tmp -vv -s -o addopts="" \
-m "python"

- name: Upload test results
if: failure()
uses: actions/upload-artifact@v7
with:
name: test_results_python_${{ matrix.os }}_${{ matrix.toolchain.compiler }}_py${{ matrix.python-version }}
path: ${{ env.CLAW }}/geoclaw/pytest_tmp
if-no-files-found: ignore

regression-tests:
name: >
regression - ${{ matrix.os }} - ${{ matrix.toolchain.compiler }} ${{ matrix.build }} - py ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
build: [debug, opt]
python-version: ['3.12']
toolchain:
- {compiler: gcc, version: 14}
- {compiler: gcc, version: 15}
exclude:
- os: ubuntu-latest
toolchain: {compiler: gcc, version: 15}
- os: macos-latest
toolchain: {compiler: gcc, version: 14}

steps:
- name: Install system dependencies
if: ${{ matrix.toolchain.compiler != 'intel' && matrix.toolchain.compiler != 'intel-classic' }}
run: |
if [ "${{ matrix.os }}" == "ubuntu-latest" ]; then
sudo apt-get update
sudo apt-get install -y libblas-dev liblapack-dev libnetcdf-dev libnetcdff-dev pkg-config
elif [ "${{ matrix.os }}" == "macos-latest" ]; then
brew update
brew install netcdf-fortran
fi
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6.2.0
with:
python-version: ${{ matrix.python-version }}

- name: Set up compilers
uses: fortran-lang/setup-fortran@v1.9.0
id: setup-fortran
with:
compiler: ${{ matrix.toolchain.compiler }}
version: ${{ matrix.toolchain.version }}

- name: Install python dependencies
run: |
sudo apt-get update
sudo apt-get install gfortran
# sudo apt-get liblapack-pic
sudo apt-get install liblapack-dev
sudo apt-get install libnetcdf-dev libnetcdff-dev
python -m pip install --upgrade pip
pip install flake8 pytest
- name: Setup clawpack super repository
run: |
git submodule init
git submodule update
pip install --user -e .
- name: Setup geoclaw
run: |
cd geoclaw
git checkout ${{ github.ref }}
- name: Lint with flake8
run: |
cd geoclaw
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics --exclude old_dtopotools.py
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
cd geoclaw
pytest
pip install flake8 meson-python ninja pytest numpy pandas xarray
pip install scipy netCDF4

- name: Checkout Clawpack
uses: actions/checkout@v6.0.2
with:
repository: clawpack/clawpack
submodules: true

- name: Checkout GeoClaw branch
uses: actions/checkout@v6.0.2
with:
path: geoclaw

- name: Install clawpack python
run: |
pip install --no-build-isolation --editable .

- name: Run Regression Tests
run: |
cd ${CLAW}/geoclaw
source .github/scripts/set_test_env.sh regression "${{ matrix.toolchain.compiler }}" "${{ matrix.build }}"
echo "FFLAGS: $FFLAGS"
echo "OMP_NUM_THREADS: $OMP_NUM_THREADS"
pytest --basetemp=${CLAW}/geoclaw/pytest_tmp -vv -s -o addopts="" \
-m "regression and not slow and not adjoint"

- name: Upload test results
if: failure()
uses: actions/upload-artifact@v7
with:
name: test_results_${{ matrix.os }}_${{ matrix.toolchain.compiler }}_${{ matrix.build }}
path: ${{ env.CLAW }}/geoclaw/pytest_tmp
if-no-files-found: ignore
10 changes: 10 additions & 0 deletions examples/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
"""Configuration for PyTest"""

import pytest

def pytest_addoption(parser):
parser.addoption('--save', action='store_true')

@pytest.fixture
def save(request):
return request.config.getoption("--save", False)
Loading
Loading