From f89cc07b50d3f89e7da8f98afb5fe8f9d9cf33c6 Mon Sep 17 00:00:00 2001 From: GALI PREM SAGAR Date: Fri, 14 Jun 2024 13:22:49 -0500 Subject: [PATCH] Add `codecov` coverage for `pandas_tests` (#14513) Fixes: #14496 This PR enables code-coverage for `pandas` tests that are run in cudf CI in pandas accelerator mode. Authors: - GALI PREM SAGAR (https://github.com/galipremsagar) - Lawrence Mitchell (https://github.com/wence-) - Vyas Ramasubramani (https://github.com/vyasr) Approvers: - Bradley Dice (https://github.com/bdice) - Lawrence Mitchell (https://github.com/wence-) URL: https://github.com/rapidsai/cudf/pull/14513 --- ci/cudf_pandas_scripts/run_tests.sh | 11 ++++++++++- python/cudf/cudf_pandas_tests/test_cudf_pandas.py | 3 +++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/ci/cudf_pandas_scripts/run_tests.sh b/ci/cudf_pandas_scripts/run_tests.sh index 78945d37f22..1c3b99953fb 100755 --- a/ci/cudf_pandas_scripts/run_tests.sh +++ b/ci/cudf_pandas_scripts/run_tests.sh @@ -5,6 +5,10 @@ set -eoxu pipefail +RAPIDS_TESTS_DIR=${RAPIDS_TESTS_DIR:-"${PWD}/test-results"} +RAPIDS_COVERAGE_DIR=${RAPIDS_COVERAGE_DIR:-"${PWD}/coverage-results"} +mkdir -p "${RAPIDS_TESTS_DIR}" "${RAPIDS_COVERAGE_DIR}" + # Function to display script usage function display_usage { echo "Usage: $0 [--no-cudf]" @@ -36,4 +40,9 @@ else python -m pip install $(ls ./local-cudf-dep/cudf*.whl)[test,cudf-pandas-tests] fi -python -m pytest -p cudf.pandas ./python/cudf/cudf_pandas_tests/ +python -m pytest -p cudf.pandas \ + --cov-config=./python/cudf/.coveragerc \ + --cov=cudf \ + --cov-report=xml:"${RAPIDS_COVERAGE_DIR}/cudf-pandas-coverage.xml" \ + --cov-report=term \ + ./python/cudf/cudf_pandas_tests/ diff --git a/python/cudf/cudf_pandas_tests/test_cudf_pandas.py b/python/cudf/cudf_pandas_tests/test_cudf_pandas.py index c251e4a197e..5be4d350c0b 100644 --- a/python/cudf/cudf_pandas_tests/test_cudf_pandas.py +++ b/python/cudf/cudf_pandas_tests/test_cudf_pandas.py @@ -464,6 +464,9 @@ def test_options_mode(): assert xpd.options.mode.copy_on_write == pd.options.mode.copy_on_write +# Codecov and Profiler interfere with each-other, +# hence we don't want to run code-cov on this test. +@pytest.mark.no_cover def test_profiler(): pytest.importorskip("cudf")