Skip to content

Commit

Permalink
Add codecov coverage for pandas_tests (#14513)
Browse files Browse the repository at this point in the history
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: #14513
  • Loading branch information
galipremsagar authored Jun 14, 2024
1 parent 9dc5e8c commit f89cc07
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
11 changes: 10 additions & 1 deletion ci/cudf_pandas_scripts/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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]"
Expand Down Expand Up @@ -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/
3 changes: 3 additions & 0 deletions python/cudf/cudf_pandas_tests/test_cudf_pandas.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down

0 comments on commit f89cc07

Please sign in to comment.