diff --git a/ci/run_pytests.sh b/ci/run_pytests.sh index 6bda50870..dc31a9645 100755 --- a/ci/run_pytests.sh +++ b/ci/run_pytests.sh @@ -1,9 +1,11 @@ #!/bin/bash -# Copyright (c) 2024, NVIDIA CORPORATION. +# Copyright (c) 2024-2025, NVIDIA CORPORATION. set -euo pipefail +# It is essential to cd into python/rmm/rmm as `pytest-xdist` + `coverage` seem to work only at this directory level. + # Support invoking run_pytests.sh outside the script directory -cd "$(dirname "$(realpath "${BASH_SOURCE[0]}")")"/../python/rmm/ +cd "$(dirname "$(realpath "${BASH_SOURCE[0]}")")"/../python/rmm/rmm/ -pytest --cache-clear -v "$@" . +pytest --cache-clear -v "$@" tests diff --git a/ci/test_python.sh b/ci/test_python.sh index a9e3add6e..8804d3d73 100755 --- a/ci/test_python.sh +++ b/ci/test_python.sh @@ -42,6 +42,8 @@ rapids-logger "pytest rmm" ./ci/run_pytests.sh \ --junitxml="${RAPIDS_TESTS_DIR}/junit-rmm.xml" \ + --numprocesses=8 \ + --dist=worksteal \ --cov-config=.coveragerc \ --cov=rmm \ --cov-report=xml:"${RAPIDS_COVERAGE_DIR}/rmm-coverage.xml" \ diff --git a/conda/environments/all_cuda-129_arch-aarch64.yaml b/conda/environments/all_cuda-129_arch-aarch64.yaml index 1e9958615..8ef7601a3 100644 --- a/conda/environments/all_cuda-129_arch-aarch64.yaml +++ b/conda/environments/all_cuda-129_arch-aarch64.yaml @@ -31,6 +31,7 @@ dependencies: - pre-commit - pytest - pytest-cov +- pytest-xdist - python>=3.10,<3.14 - rapids-build-backend>=0.4.0,<0.5.0.dev0 - rapids-logger==0.2.*,>=0.0.0a0 diff --git a/conda/environments/all_cuda-129_arch-x86_64.yaml b/conda/environments/all_cuda-129_arch-x86_64.yaml index 42b3b453b..e1b5f0bb0 100644 --- a/conda/environments/all_cuda-129_arch-x86_64.yaml +++ b/conda/environments/all_cuda-129_arch-x86_64.yaml @@ -31,6 +31,7 @@ dependencies: - pre-commit - pytest - pytest-cov +- pytest-xdist - python>=3.10,<3.14 - rapids-build-backend>=0.4.0,<0.5.0.dev0 - rapids-logger==0.2.*,>=0.0.0a0 diff --git a/conda/environments/all_cuda-130_arch-aarch64.yaml b/conda/environments/all_cuda-130_arch-aarch64.yaml index decf11d30..899ba82f0 100644 --- a/conda/environments/all_cuda-130_arch-aarch64.yaml +++ b/conda/environments/all_cuda-130_arch-aarch64.yaml @@ -31,6 +31,7 @@ dependencies: - pre-commit - pytest - pytest-cov +- pytest-xdist - python>=3.10,<3.14 - rapids-build-backend>=0.4.0,<0.5.0.dev0 - rapids-logger==0.2.*,>=0.0.0a0 diff --git a/conda/environments/all_cuda-130_arch-x86_64.yaml b/conda/environments/all_cuda-130_arch-x86_64.yaml index 9f87fbf49..aa3525be5 100644 --- a/conda/environments/all_cuda-130_arch-x86_64.yaml +++ b/conda/environments/all_cuda-130_arch-x86_64.yaml @@ -31,6 +31,7 @@ dependencies: - pre-commit - pytest - pytest-cov +- pytest-xdist - python>=3.10,<3.14 - rapids-build-backend>=0.4.0,<0.5.0.dev0 - rapids-logger==0.2.*,>=0.0.0a0 diff --git a/dependencies.yaml b/dependencies.yaml index dba47096d..1637f2070 100644 --- a/dependencies.yaml +++ b/dependencies.yaml @@ -312,6 +312,7 @@ dependencies: packages: - pytest - pytest-cov + - pytest-xdist specific: - output_types: [conda, requirements, pyproject] matrices: diff --git a/python/rmm/pyproject.toml b/python/rmm/pyproject.toml index 73b88cb3b..003fab061 100644 --- a/python/rmm/pyproject.toml +++ b/python/rmm/pyproject.toml @@ -52,6 +52,7 @@ test = [ "numba>=0.60.0,<0.62.0a0", "pytest", "pytest-cov", + "pytest-xdist", ] # This list was generated by `rapids-dependency-file-generator`. To make changes, edit ../../dependencies.yaml and run `rapids-dependency-file-generator`. [project.urls]