From 58692ac8fbf0f3e80669124bcc0aa05a7f0e0de6 Mon Sep 17 00:00:00 2001 From: JHopeCollins Date: Tue, 9 Dec 2025 14:05:01 +0000 Subject: [PATCH 1/2] firedrake-run-split-tests prints error message with -h argument --- scripts/firedrake-run-split-tests | 64 +++++++++++++++++-------------- 1 file changed, 36 insertions(+), 28 deletions(-) diff --git a/scripts/firedrake-run-split-tests b/scripts/firedrake-run-split-tests index 8876490cf2..36982e4f0f 100755 --- a/scripts/firedrake-run-split-tests +++ b/scripts/firedrake-run-split-tests @@ -1,31 +1,40 @@ #!/usr/bin/env bash -# Script for running a pytest test suite in parallel across multiple jobs. -# -# Only the tests that use the given number of processors are selected from the suite. This list of tests is distributed between multiple jobs and each job outputs its own log file. -# -# Usage: -# -# firedrake-run-split-tests -# -# where: -# * is the number of ranks used in each test -# * is the number of different jobs -# * are additional arguments that are passed to pytest -# -# Example: -# -# firedrake-run-split-tests 3 4 tests/unit --verbose -# -# will run all of the parallel[3] tests inside tests/unit verbosely -# and split between 4 different jobs. -# -# Requires: -# -# * pytest -# * pytest-split -# * mpi-pytest -# * GNU parallel +HELP_MSG="\ +Script for running a pytest test suite in parallel across multiple jobs. + +Only the tests that use the given number of processors are selected from the suite. This list of tests is distributed between multiple jobs and each job outputs its own log file. + +Usage: + + firedrake-run-split-tests + + where: + * is the number of ranks used in each test + * is the number of different jobs + * are additional arguments that are passed to pytest + +Example: + + firedrake-run-split-tests 3 4 tests/unit --verbose + + will run all of the parallel[3] tests inside tests/unit verbosely + and split between 4 different jobs. + +Run with [no arguments | -h | --help] to print this help message. + +Requires: + + * pytest + * pytest-split + * mpi-pytest + * GNU parallel" + +# Print out help message with no arguments or "-h" or "--help" +if [[ "$#" -eq "0" ]] || [[ "$1" == "-h" ]] || [[ "$1" == "--help" ]]; then + echo -e "${HELP_MSG}" + exit +fi num_procs=$1 num_jobs=$2 @@ -38,10 +47,9 @@ if [ $num_procs = 1 ]; then else pytest_exec="mpiexec -n ${num_procs} python3 -m pytest" fi -marker_spec="parallel[${num_procs}]" pytest_cmd="${pytest_exec} -v \ --splits ${num_jobs} --group {#} \ - -m ${marker_spec} ${extra_args}" + -m parallel[match] ${extra_args}" log_file_prefix="pytest_nprocs${num_procs}_job" From bc07f3c4925e1c554b10a7598549b53e863f0734 Mon Sep 17 00:00:00 2001 From: JHopeCollins Date: Tue, 9 Dec 2025 14:40:44 +0000 Subject: [PATCH 2/2] use mpi-pytest main on firedrake main --- pyproject.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index f91756ecd3..793d9f698c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -70,7 +70,7 @@ pyop2-clean = "pyop2.compilation:clear_compiler_disk_cache" [project.optional-dependencies] check = [ - "mpi-pytest>=2025.7", + "mpi-pytest @ git+https://github.com/firedrakeproject/mpi-pytest.git@main", "pytest", ] docs = [ @@ -111,7 +111,7 @@ ci = [ "ipympl", # needed for notebook testing "jax", "matplotlib", - "mpi-pytest>=2025.7", + "mpi-pytest @ git+https://github.com/firedrakeproject/mpi-pytest.git@main", "nbval", "networkx", # TODO RELEASE @@ -131,7 +131,7 @@ ci = [ docker = [ # Used in firedrake-vanilla container "ipympl", # needed for notebook testing "matplotlib", - "mpi-pytest>=2025.7", + "mpi-pytest @ git+https://github.com/firedrakeproject/mpi-pytest.git@main", "nbval", "networkx", "pdf2image",