Skip to content

Commit 6e73095

Browse files
authored
Reorganize tests and modify pytest invocation to support pytest 8 (#6876)
Contributes to rapidsai/build-planning#105 To make this work, I had to run all tests with pytest's `--import-mode=append` argument to get around issues with the new default `importlib` mode. That also necessitated moving the tests out of the cuml package source directory to avoid conflicts, then adding `__init__.py` files to each of the test directories to avoid import conflicts with the various `conftest.py` files. Authors: - Vyas Ramasubramani (https://github.com/vyasr) - Tim Head (https://github.com/betatim) - Paul Taylor (https://github.com/trxcllnt) Approvers: - Bradley Dice (https://github.com/bdice) - Simon Adorf (https://github.com/csadorf) URL: #6876
1 parent bd30181 commit 6e73095

File tree

162 files changed

+15
-15
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

162 files changed

+15
-15
lines changed

ci/run_cuml_dask_pytests.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
# Copyright (c) 2024-2025, NVIDIA CORPORATION.
33

44
# Support invoking run_cuml_dask_pytests.sh outside the script directory
5-
cd "$(dirname "$(realpath "${BASH_SOURCE[0]}")")"/../python/cuml/cuml/tests/dask || exit 1
5+
cd "$(dirname "$(realpath "${BASH_SOURCE[0]}")")"/../python/cuml/tests/dask || exit 1
66

7-
python -m pytest --cache-clear "$@" .
7+
python -m pytest --cache-clear --import-mode=append "$@" .

ci/run_cuml_integration_pytests.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
# Copyright (c) 2024-2025, NVIDIA CORPORATION.
33

44
# Support invoking run_cuml_singlegpu_pytests.sh outside the script directory
5-
cd "$(dirname "$(realpath "${BASH_SOURCE[0]}")")"/../python/cuml/cuml/tests || exit 1
5+
cd "$(dirname "$(realpath "${BASH_SOURCE[0]}")")"/../python/cuml/tests || exit 1
66

7-
python -m pytest -p cudf.pandas --cache-clear --ignore=dask "$@" --quick_run .
7+
python -m pytest -p cudf.pandas --cache-clear --ignore=dask --import-mode=append "$@" --quick_run .

ci/run_cuml_singlegpu_pytests.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
# Copyright (c) 2024-2025, NVIDIA CORPORATION.
33

44
# Support invoking run_cuml_singlegpu_pytests.sh outside the script directory
5-
cd "$(dirname "$(realpath "${BASH_SOURCE[0]}")")"/../python/cuml/cuml/tests || exit 1
5+
cd "$(dirname "$(realpath "${BASH_SOURCE[0]}")")"/../python/cuml/tests || exit 1
66

7-
python -m pytest --cache-clear --ignore=dask "$@" .
7+
python -m pytest --cache-clear --ignore=dask --import-mode=append "$@" .

ci/test_python_dask.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Copyright (c) 2022-2025, NVIDIA CORPORATION.
33

44
# Support invoking test_python_dask.sh outside the script directory
5-
cd "$(dirname "$(realpath "${BASH_SOURCE[0]}")")"/../
5+
cd "$(dirname "$(realpath "${BASH_SOURCE[0]}")")"/../ || exit
66

77
# Common setup steps shared by Python test jobs
88
source ./ci/test_python_common.sh
@@ -13,7 +13,7 @@ set +e
1313

1414
test_args=(
1515
--junitxml="${RAPIDS_TESTS_DIR}/junit-cuml-dask.xml"
16-
--cov-config=../../../.coveragerc
16+
--cov-config=../../.coveragerc
1717
--cov=cuml_dask
1818
--cov-report=xml:"${RAPIDS_COVERAGE_DIR}/cuml-dask-coverage.xml"
1919
)

ci/test_python_integration.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Copyright (c) 2024-2025, NVIDIA CORPORATION.
33

44
# Support invoking test_python_singlegpu.sh outside the script directory
5-
cd "$(dirname "$(realpath "${BASH_SOURCE[0]}")")"/../
5+
cd "$(dirname "$(realpath "${BASH_SOURCE[0]}")")"/../ || exit
66

77
# Common setup steps shared by Python test jobs
88
source ./ci/test_python_common.sh
@@ -16,7 +16,7 @@ rapids-logger "pytest cuml integration"
1616
--numprocesses=8 \
1717
--dist=worksteal \
1818
--junitxml="${RAPIDS_TESTS_DIR}/junit-cuml.xml" \
19-
--cov-config=../../.coveragerc \
19+
--cov-config=../.coveragerc \
2020
--cov=cuml \
2121
--cov-report=xml:"${RAPIDS_COVERAGE_DIR}/cuml-coverage.xml"
2222

ci/test_python_singlegpu.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ rapids-logger "pytest cuml single GPU"
1616
--numprocesses=8 \
1717
--dist=worksteal \
1818
--junitxml="${RAPIDS_TESTS_DIR}/junit-cuml.xml" \
19-
--cov-config=../../.coveragerc \
19+
--cov-config=../.coveragerc \
2020
--cov=cuml \
2121
--cov-report=xml:"${RAPIDS_COVERAGE_DIR}/cuml-coverage.xml"
2222

conda/environments/all_cuda-129_arch-aarch64.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,11 @@ dependencies:
5050
- pydata-sphinx-theme!=0.14.2
5151
- pylibraft==25.10.*,>=0.0.0a0
5252
- pynndescent
53+
- pytest
5354
- pytest-benchmark
5455
- pytest-cases
5556
- pytest-cov
5657
- pytest-xdist
57-
- pytest==7.*
5858
- python>=3.10,<3.14
5959
- pyyaml
6060
- raft-dask==25.10.*,>=0.0.0a0

conda/environments/all_cuda-129_arch-x86_64.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,11 @@ dependencies:
5050
- pydata-sphinx-theme!=0.14.2
5151
- pylibraft==25.10.*,>=0.0.0a0
5252
- pynndescent
53+
- pytest
5354
- pytest-benchmark
5455
- pytest-cases
5556
- pytest-cov
5657
- pytest-xdist
57-
- pytest==7.*
5858
- python>=3.10,<3.14
5959
- pyyaml
6060
- raft-dask==25.10.*,>=0.0.0a0

dependencies.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ dependencies:
441441
# upstream sklearn docstring tests require numpydoc<1.9
442442
- numpydoc<1.9
443443
- pyyaml
444-
- pytest==7.*
444+
- pytest
445445
- pytest-benchmark
446446
- pytest-cases
447447
- pytest-cov

python/cuml/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,11 +135,11 @@ test = [
135135
"nltk",
136136
"numpydoc<1.9",
137137
"pynndescent",
138+
"pytest",
138139
"pytest-benchmark",
139140
"pytest-cases",
140141
"pytest-cov",
141142
"pytest-xdist",
142-
"pytest==7.*",
143143
"pyyaml",
144144
"scikit-learn>=1.4",
145145
"seaborn",

0 commit comments

Comments
 (0)