Reading a failing check#
HydroModPy has one pull-request gate and a set of focused workflows under
.github/workflows/. A job name starts with the domain that failed, so a red
check says where to look before you open the log. The table of workflow files,
triggers and jobs is generated from the YAML and never drifts:
CI workflows. This page is the triage: what each domain
means and how to reproduce it. The workflows are the one place that holds the test
commands, and tools/ci/local.py replays their Linux steps on your machine.
The main gate#
CI / Main Gate (main-ci.yml) runs on every push and pull request to
main or dev. It is the signal to read after each push. Its jobs, in the
order they matter:
Quality / ruffandSecurity / gitleaksare the style and the secret scan, the same as the pre-commit hooks.Architecture / layers, surface and two threadsrunstests/unit/architecture/: the layer matrix, the run layouts, the public surface, the code rules and the gate that plays two runs in two threads of one process.Characterization / produced runruns one realhmp runof the synthetic aquifer intests/fixtures/projects/getting_startedand reads back only what it left on disk.Tests / fast markerruns thefasttests on Python 3.11, 3.12 and 3.13, then the port tests with every solver binary installed andHMP_REQUIRE_BINARIESset, so a missing binary fails instead of skipping.Tests / unitruns the docstring examples, the unit tier, the process tests and the tests that reach the mesh and the calibration, under branch coverage. Tests markedwhiteboxrun in their own serial step.Tests / scenariosplays the small synthetic projects oftests/scenariosonce each, in parallel and under the same coverage. Theirpython -m hydromodpychildren count throughpatch = ["subprocess"]ofpyproject.toml.Coverage / floors per sub-packagecombines the data of the two jobs above and runspython tools/ci/coverage_floors.py check tools/ci/coverage_floors.toml. The table holds one floor for each sub-package ofhydromodpy/and one for the modules at the top of each package. It fails on a floor missed, on a sub-package without a line and on a line that names a path the tree no longer has. The floors only go up:coverage_floors.py measure tools/ci/coverage_floors.toml --writeraises each one to half a point under the measure. A floor goes down only when files enter or leave its sub-package, with the reason in a comment on its line.Proof / tests removed lose nothingruns when a change removes test functions.tools/ci/proof.py selectfinds the removed functions, the modules they stood for and the tests that import those modules, andproof.py provehands them totools/ci/removal_proof.py check. The check measures both sides and fails when a covered line, a covered branch or a killed mutant of those modules is lost. A loss in another module is listed as outside the bound and does not fail, because a test outside the measure may run that line. Exit code 0 means proved, 1 a loss named inproof/report.json, 2 a refusal. It refuses a change that also editshydromodpy/, because the proof compares the same library code: remove the tests in a change of their own. A pull request is one change against its base. A push is proved commit by commit withproof.py range, so a commit that only removes tests passes beside a commit that only edits the library. It also refuses a proof whose mutants would take more than 45 minutes: split the change, and the weekly package proof takes the rest. A push that removes no test ends in under a minute.Tests / integrationrunstests/integrationafter the unit job.Regression / fast solversruns the fast regression cases with solver binaries installed.Package / wheel smokebuilds the wheel and the sdist, installs the wheel in a clean environment on Python 3.11, 3.12 and 3.13, and runshmp doctor --format json.Package / example catalogrunstools/ci/check_example_catalog.py, which hashes every filehydromodpy/project/examples/catalog.tomlnames.Typing / mypy baselineis advisory: it does not block a merge.
Other workflows#
These run when their inputs change, on a schedule, or on demand.
Docs / Sphinx(docs.yml) builds the site strictly, then runscheck_pageandcheck_site, then fails if the build changed a tracked file underdocs/source.Docs / Deploy Pages (multi-version)(docs-deploy-pages.yml) builds one branch or tag and publishes it to its own folder ofdocs.hydromodpy.fr.Performance / Benchmarkscompares pairwise benchmark ratios to the committed baseline.Docker / Build Smokebuilds the image with the tagciand checks the entry points:hmp --help,hmp --versionandpython -m hydromodpy_server --help. Then it writes thenwtisland oftests/scenarios/factory.py, runs it in the image, checks thatprovenance.jsonseals the image digest, and replays it withhmp replay <run> --strictin the same image. The replay must bebit. On av*.*.*tag, thepublishjob pushes the image toghcr.iowith the version as its tag, and aslatestwhen the version is not a pre-release. The digest goes to the job summary and to theimage-digestartifact, and the same run and replay play on the published image pulled by its digest.Solver / PETSc Smokevalidates the conda-forge PETSc stack and the Boussinesq smoke suite. It also has a weekly run.CI / Workflow Lintrunsactionlinton workflow files.Security / Dependency Auditrunspip-auditon pull requests that change dependencies, and weekly.Nightly / Linux Suitesruns the extensive regression, the validation without PETSc and the integration coverage onmainanddev.Weekly / Cross Platformruns the supported Python versions on Linux, macOS and Windows, the end-to-end tier and the full regression. It has three more jobs.Weekly / frozen MODFLOW 6 gmsh run and its tolerancereplays the frozen run oftests/regression/frozen_replaywith one BLAS thread, then with four. Each replay writes its class and its field-scale gaps to the fileHMP_REPLAY_REPORTnames, and the processor and the numpy build go beside them in thetolerance-<run id>artifact. The job fails unless both replays arebit. A red here on a new processor is a measure, and the tolerance class is written by hand from the artifact.Weekly / package proofrunsproof.py week: each commit of the last seven days that removes tests is proved against its parent at the package scope, 300 minutes in all. A commit that also editshydromodpy/is listed as changed, a commit past the budget as left.Weekly / Windows server path and two processesruns onwindows-latestwithHMP_REQUIRE_WINDOWSset. It runs every test markedwindows, so a Windows proof that skips fails the job. Then it runs the server tests, the process tests, the HTTP scenario, the scenario of two runs in two processes and the two-thread gate.Weekly / dependenciesinstalls the direct dependencies at their lower bounds and with no upper cap, and runs the tiers that read stored files.Weekly / Installinstalls the wheel and the source tree on each Python and on each OS, and runshmp doctor. Only Linux blocks.Release / PyPI(publish.yml) runs on av*.*.*tag. It starts with a gate: the tagged commit is onmainordev, itsCI / Main Gaterun passed and the example catalog matches the tree. It tests the wheel on Python 3.11, 3.12 and 3.13 before it uploads. See Cut a release.
Reproduce a failure#
python tools/ci/local.py run --job <job> --out <dir> replays the Linux,
Python 3.13 steps of one job as the workflow writes them, with python set to
the interpreter that runs the script. Each step writes <dir>/<job>__<step>.log
and one line <job>/<step> <code> in <dir>/status.
python tools/ci/local.py list prints every step: the ones it plays, and the
others with the reason they are not played locally (an install, an action, Docker,
another system or Python version, a GitHub expression). The module docstring of
tools/ci/local.py gives the rules. Then use the first word of the job name.
Qualityruff check --fix <files>andruff format <files>.SecurityFor
gitleaks, never paste the secret in a log or an issue. Rotate the credential first, then remove it from the tree. Forpip-audit, read the advisory and the pinned range inpyproject.toml.Architecturepython -m pytest tests/unit/architecture -q. The failing test names the rule. Fix a failing architecture gate says what to do for each one.Characterizationpython -m pytest tests/characterization -qwith the MODFLOW-NWT binary installed (hmp install-binaries --subset mfnwt). The tier holds strictxfailcases: one that starts to pass fails the job, which means a claim of the code is now honored and the marker must go.TestsReproduce the tier and the Python version named in the check, not the whole suite. For a hang or a dead worker, see the Whitebox rule in Run the tests. A test marked
windowsskips outside Windows. SetHMP_REQUIRE_WINDOWS=1on Windows to make such a skip fail, as the weekly Windows job does.CoverageRun
unitandscenariosthroughlocal.py, then thecoveragejob:python tools/ci/local.py run --job unit --job scenarios --job coverage --out <dir>. Each failing line reads<key> <measure> < <floor>. Add tests for the sub-package it names. Lower a floor only when files entered or left the sub-package, and write the reason on its line.ProofDownload the
proofartifact and readreport.json: it names each lost line, branch or mutant by module. To replay it, runpython tools/ci/proof.py select --base <sha> --head <sha> --work <dir> --out <dir>/selection.json, thenpython tools/ci/proof.py prove <dir>/selection.json --work <dir> --out <dir>/report.json --mutmut <python>, where<python>hasmutmut==3.8.0. For a push, runpython tools/ci/proof.py range --base <sha> --head <sha> --work <dir> --out <dir>/report.json --mutmut <python>instead. Keep the test that stood alone for the lost line, or write one that covers it.RegressionandValidationCheck the solver binaries and the tolerances before touching an expected value. A regression failure says the workflow changed, not that it became wrong.
DockerThe play and replay step runs
hmp run project.tomlfrom/project, thenhmp replay runs/nwt --strict. Run the same two commands on thenwtisland oftests/scenarios/factory.pyoutside the image first. A replay that is notbitin the same image is a fault of the run, not of the runner.Docsmake -C docs html-strict, thenpython -m tools.docs.check_pageandpython -m tools.docs.check_site docs/build/html. A “generated file is stale” error means the build rewrote a tracked file: run the build locally and commit the result. See How the docs are built.PerformanceRead the uploaded benchmark report before deciding whether the drift is real or runner noise.
CIactionlint .github/workflows/<file>.ymlreports the line of a YAML error.