Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Make Python CI runners thin caller-relative pytest adapters
  • Loading branch information
csadorf committed Nov 18, 2026
commit 399bd3ac35d14950d3a85f44857bcbcb2a760244
8 changes: 4 additions & 4 deletions ci/run_cuml_dask_pytests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

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

python -m pytest --cache-clear --durations=100 --durations-min=1 "$@" .
set -euo pipefail
REPO=$(dirname "$(dirname "$(realpath "${BASH_SOURCE[0]}")")")
exec python -m pytest -c "${REPO}/pyproject.toml" --cuml-suite=dask \
--cache-clear --durations=100 --durations-min=1 "$@"
8 changes: 4 additions & 4 deletions ci/run_cuml_integration_pytests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

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

python -m pytest -p cudf.pandas --cache-clear --durations=100 --durations-min=1 --ignore=dask "$@" --quick_run .
set -euo pipefail
REPO=$(dirname "$(dirname "$(realpath "${BASH_SOURCE[0]}")")")
exec python -m pytest -c "${REPO}/pyproject.toml" --cuml-suite=cudf-pandas \
--cache-clear --durations=100 --durations-min=1 --quick_run "$@"
8 changes: 4 additions & 4 deletions ci/run_cuml_singlegpu_accel_pytests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

# Support invoking run_cuml_singlegpu_accel_pytests.sh outside the script directory
cd "$(dirname "$(realpath "${BASH_SOURCE[0]}")")"/../python/cuml/cuml_accel_tests || exit 1

python -m pytest --cache-clear --durations=100 --durations-min=1 "$@" .
set -euo pipefail
REPO=$(dirname "$(dirname "$(realpath "${BASH_SOURCE[0]}")")")
exec python -m pytest -c "${REPO}/pyproject.toml" --cuml-suite=accel \
--cache-clear --durations=100 --durations-min=1 "$@"
8 changes: 4 additions & 4 deletions ci/run_cuml_singlegpu_pytests.sh

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We rely on these ci/run_* files to have a way to invoke that tests that isn't tightly coupled to being on GitHub in cuML's open source CI.

That's useful in local development, hardware bringup, DLFW builds, etc.

That's why they were introduced in the first place: #5761

Can we please keep these?

cross-ref: rapidsai/build-planning#269

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

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

python -m pytest --cache-clear --durations=100 --durations-min=1 --ignore=dask "$@" .
set -euo pipefail
REPO=$(dirname "$(dirname "$(realpath "${BASH_SOURCE[0]}")")")
exec python -m pytest -c "${REPO}/pyproject.toml" --cuml-suite=standard \
--cache-clear --durations=100 --durations-min=1 "$@"
35 changes: 35 additions & 0 deletions ci/tests/test_pytest_entrypoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,3 +94,38 @@ def test_explicit_dask_not_ignored(repo):
result = run(repo, "python/cuml/tests/dask")
assert result.returncode == 0, result.stdout
assert "2 passed" in result.stdout


@pytest.mark.parametrize(
"runner",
[
"ci/run_cuml_singlegpu_pytests.sh",
"ci/run_cuml_dask_pytests.sh",
"ci/run_cuml_singlegpu_accel_pytests.sh",
"ci/run_cuml_integration_pytests.sh",
],
)
def test_runner_preserves_arguments_and_cwd(tmp_path, runner):
# Capture the exact interpreter invocation; no GPU or upstream checkout.
executable = tmp_path / "python"
executable.write_text('#!/bin/bash\nprintf "%s\\n" "$PWD" "$@"\n')
executable.chmod(0o755)
result = subprocess.run(
[
str(REPO / runner),
"some path/test_file.py::test_one",
"-k",
"a or b",
],
cwd=tmp_path,
env={**os.environ, "PATH": f"{tmp_path}:{os.environ['PATH']}"},
text=True,
capture_output=True,
)
assert result.returncode == 0, result.stderr
lines = result.stdout.splitlines()
assert lines[0] == str(tmp_path)
assert lines[1:5] == ["-m", "pytest", "-c", str(REPO / "pyproject.toml")]
assert lines[-3:] == ["some path/test_file.py::test_one", "-k", "a or b"]
assert "." not in lines