Skip to content

Commit

Permalink
add unit test setup for cudf_kafka (#15853)
Browse files Browse the repository at this point in the history
Fixes #15841

Proposes adding a basic unit test setup for `cudf_kafka`.

Authors:
  - James Lamb (https://github.com/jameslamb)

Approvers:
  - Bradley Dice (https://github.com/bdice)

URL: #15853
  • Loading branch information
jameslamb authored May 29, 2024
1 parent 3b98f81 commit afd5522
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 2 deletions.
9 changes: 9 additions & 0 deletions ci/run_cudf_kafka_pytests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash
# Copyright (c) 2024, NVIDIA CORPORATION.

set -euo pipefail

# Support invoking run_cudf_kafka_pytests.sh outside the script directory
cd "$(dirname "$(realpath "${BASH_SOURCE[0]}")")"/../python/cudf_kafka/cudf_kafka

pytest --cache-clear "$@" tests
2 changes: 1 addition & 1 deletion ci/run_custreamz_pytests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

set -euo pipefail

# It is essential to cd into python/cudf/cudf as `pytest-xdist` + `coverage` seem to work only at this directory level.
# It is essential to cd into python/custreamz/custreamz/ as `pytest-xdist` + `coverage` seem to work only at this directory level.

# Support invoking run_custreamz_pytests.sh outside the script directory
cd "$(dirname "$(realpath "${BASH_SOURCE[0]}")")"/../python/custreamz/custreamz/
Expand Down
2 changes: 1 addition & 1 deletion ci/run_dask_cudf_pytests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

set -euo pipefail

# It is essential to cd into python/cudf/cudf as `pytest-xdist` + `coverage` seem to work only at this directory level.
# It is essential to cd into python/dask_cudf/dask_cudf/ as `pytest-xdist` + `coverage` seem to work only at this directory level.

# Support invoking run_dask_cudf_pytests.sh outside the script directory
cd "$(dirname "$(realpath "${BASH_SOURCE[0]}")")"/../python/dask_cudf/dask_cudf/
Expand Down
4 changes: 4 additions & 0 deletions ci/test_python_other.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ DASK_DATAFRAME__QUERY_PLANNING=False ./ci/run_dask_cudf_pytests.sh \
--dist=loadscope \
.

rapids-logger "pytest cudf_kafka"
./ci/run_cudf_kafka_pytests.sh \
--junitxml="${RAPIDS_TESTS_DIR}/junit-cudf-kafka.xml"

rapids-logger "pytest custreamz"
./ci/run_custreamz_pytests.sh \
--junitxml="${RAPIDS_TESTS_DIR}/junit-custreamz.xml" \
Expand Down
Empty file.
12 changes: 12 additions & 0 deletions python/cudf_kafka/cudf_kafka/tests/test_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Copyright (c) 2024, NVIDIA CORPORATION.

import cudf_kafka


def test_version_constants_are_populated():
# __git_commit__ will only be non-empty in a built distribution
assert isinstance(cudf_kafka.__git_commit__, str)

# __version__ should always be non-empty
assert isinstance(cudf_kafka.__version__, str)
assert len(cudf_kafka.__version__) > 0
5 changes: 5 additions & 0 deletions python/cudf_kafka/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,11 @@ skip = [
"__init__.py",
]

[tool.pytest.ini_options]
filterwarnings = [
"error"
]

[tool.scikit-build]
build-dir = "build/{wheel_tag}"
cmake.build-type = "Release"
Expand Down

0 comments on commit afd5522

Please sign in to comment.