diff --git a/ci/run_pylibcudf_pytests.sh b/ci/run_pylibcudf_pytests.sh new file mode 100755 index 00000000000..2341801e4d0 --- /dev/null +++ b/ci/run_pylibcudf_pytests.sh @@ -0,0 +1,11 @@ +#!/bin/bash +# Copyright (c) 2025, NVIDIA CORPORATION. + +set -euo pipefail + +# It is essential to cd into python/pylibcudf/pylibcudf as `pytest-xdist` + `coverage` seem to work only at this directory level. + +# Support invoking run_cudf_pytests.sh outside the script directory +cd "$(dirname "$(realpath "${BASH_SOURCE[0]}")")"/../python/pylibcudf/pylibcudf/ + +pytest --cache-clear --ignore="benchmarks" "$@" tests diff --git a/ci/test_python_common.sh b/ci/test_python_common.sh index c6c6a3957b9..65d3125552a 100755 --- a/ci/test_python_common.sh +++ b/ci/test_python_common.sh @@ -41,4 +41,5 @@ rapids-mamba-retry install \ --channel "${CPP_CHANNEL}" \ --channel "${PYTHON_CHANNEL}" \ "cudf=${RAPIDS_VERSION}" \ + "pylibcudf=${RAPIDS_VERSION}" \ "libcudf=${RAPIDS_VERSION}" diff --git a/ci/test_python_cudf.sh b/ci/test_python_cudf.sh index 9528549a562..3312c2b82b7 100755 --- a/ci/test_python_cudf.sh +++ b/ci/test_python_cudf.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright (c) 2022-2024, NVIDIA CORPORATION. +# Copyright (c) 2022-2025, NVIDIA CORPORATION. # Support invoking test_python_cudf.sh outside the script directory cd "$(dirname "$(realpath "${BASH_SOURCE[0]}")")"/../; @@ -15,12 +15,14 @@ trap "EXITCODE=1" ERR set +e rapids-logger "pytest pylibcudf" -pushd python/pylibcudf/pylibcudf/tests -python -m pytest \ - --cache-clear \ +./ci/run_pylibcudf_pytests.sh \ + --junitxml="${RAPIDS_TESTS_DIR}/junit-pylibcudf.xml" \ + --numprocesses=8 \ --dist=worksteal \ - . -popd + --cov-config=../.coveragerc \ + --cov=pylibcudf \ + --cov-report=xml:"${RAPIDS_COVERAGE_DIR}/pylibcudf-coverage.xml" \ + --cov-report=term rapids-logger "pytest cudf" ./ci/run_cudf_pytests.sh \ diff --git a/python/pylibcudf/.coveragerc b/python/pylibcudf/.coveragerc new file mode 100644 index 00000000000..11af8781634 --- /dev/null +++ b/python/pylibcudf/.coveragerc @@ -0,0 +1,3 @@ +# Configuration file for Python coverage tests +[run] +source = pylibcudf