diff --git a/pyproject.toml b/pyproject.toml index 0089a5e949..02c4377bbe 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 @@ -132,7 +132,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", 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"