This document outlines how io4dolfinx is tested, covering both local development
testing and the Continuous Integration (CI) process on GitHub Actions.
You will find the updated coverage reports for the latest version on main tested against stable and nightly versions of dolfinx at the following links:
The library uses pytest for testing. To execute the tests locally, you first
need to install the library and its dependencies.
Install the library with the optional test dependencies to ensure you have
packages like pytest, coverage, and ipyparallel
python3 -m pip install ".[test]"To execute all tests in the repository, run:
python3 -m pytest .Some tests require specific datasets to verify compatibility with older software versions.
Some tests check the capability of reading data created with the legacy version of DOLFIN. To create this dataset, start a docker container with legacy DOLFIN, for instance:
docker run -ti -v $(pwd):/root/shared -w /root/shared --rm ghcr.io/scientificcomputing/fenics:2024-02-19Then, inside this container, call:
python3 ./tests/create_legacy_data.py --output-dir=legacySome tests check the capability to read data generated by adios4dolfinx<0.7.2.
To generate data for these tests use the following commands:
docker run -ti -v $(pwd):/root/shared -w /root/shared --rm ghcr.io/fenics/dolfinx/dolfinx:v0.7.3Then, inside the container, call:
python3 -m pip install adios4dolfinx==0.7.1
python3 ./tests/create_legacy_checkpoint.py --output-dir=legacy_checkpointThe repository relies on several GitHub Actions workflows to ensure code quality and compatibility across different environments.
This is the primary workflow triggered on pushes to main, pull requests, and
scheduled nightly runs. It runs on ubuntu-24.04 using the official DOLFINx
docker container
.
Workflow Steps:
- Linting & Formatting: Checks code style using
ruffand type consistency withmypy. - Data Generation: * Creates legacy DOLFIN data using the
create_legacy_data.ymlworkflow.- Creates legacy
adios4dolfinxcheckpoints usingcreate_legacy_checkpoint.yml.
- Creates legacy
- Test Execution:
- Installs the package with MPI-enabled
h5py. - Runs the standard test suite with
coverage. - Runs parallel tests using
mpirun -n 4 ... mpi4py -m pytest.
- Installs the package with MPI-enabled
- Reporting: Combines coverage reports and uploads them as artifacts.
To ensure broad support, specific workflows test against different configurations:
-
MPI & ADIOS2 Versions (
test_package_openmpi.yml):- Tests against both
openmpiandmpichimplementations using theghcr.io/fenics/test-envcontainers. - Verifies compatibility with different ADIOS2 versions (e.g.,
v2.10.2,v2.11.0) .
- Tests against both
-
Operating System (
test_redhat.yml):- Runs the full test suite inside a RedHat-based container
(
docker.io/fenicsproject/test-env:current-redhat) to guarantee functionality on non-Debian systems .
- Runs the full test suite inside a RedHat-based container
(
Ensures the documentation builds correctly with jupyter-book on every push and
pull request, preventing documentation regressions.