Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Turn on xfail_strict = true for all python packages #16977

Merged
merged 16 commits into from
Oct 8, 2024
Merged
Show file tree
Hide file tree
Changes from 8 commits
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
17 changes: 17 additions & 0 deletions docs/cudf/source/developer_guide/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,23 @@ specifically the [`pytest-cov`](https://github.com/pytest-dev/pytest-cov) plugin
Code coverage reports are uploaded to [Codecov](https://app.codecov.io/gh/rapidsai/cudf).
Each PR also indicates whether it increases or decreases test coverage.

### Configuring pytest

Pytest will accept configuration in [multiple different
files](https://docs.pytest.org/en/stable/reference/customize.html),
with a specified discovery and precedence order. Note in particular
that there is no automatic "include" mechanism, as soon as a matching
configuration file is found, discovery stops.

For preference, so that all tool configuration lives in the same
place, we use `pyproject.toml`-based configuration. Test configuration
for a given package should live in that package's `pyproject.toml`
file.

Where tests do not naturally belong to a project, for example the
`cudf.pandas` integration tests and the cuDF benchmarks, use a
`pytest.ini` file as close to the tests as possible.

## Test organization

How tests are organized depends on which of the following two groups they fall into:
Expand Down
19 changes: 0 additions & 19 deletions python/cudf/cudf/tests/pytest.ini

This file was deleted.

20 changes: 20 additions & 0 deletions python/cudf/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,26 @@ skip = [
"__init__.py",
]

[tool.pytest.ini_options]
addopts = "--tb=native"
filterwarnings = [
"error",
"ignore:::.*xdist.*",
"ignore:::.*pytest.*",
# some third-party dependencies (e.g. 'boto3') still using datetime.datetime.utcnow()
"ignore:.*datetime.*utcnow.*scheduled for removal.*:DeprecationWarning:botocore",
# Deprecation warning from Pyarrow Table.to_pandas() with pandas-2.2+
"ignore:Passing a BlockManager to DataFrame is deprecated:DeprecationWarning",
# PerformanceWarning from cupy warming up the JIT cache
"ignore:Jitify is performing a one-time only warm-up to populate the persistent cache:cupy._util.PerformanceWarning",
# Ignore numba PEP 456 warning specific to arm machines
"ignore:FNV hashing is not implemented in Numba.*:UserWarning"
Matt711 marked this conversation as resolved.
Show resolved Hide resolved
]
markers = [
"spilling: mark benchmark a good candidate to run with `CUDF_SPILL=ON`"
]
xfail_strict = true

[tool.rapids-build-backend]
build-backend = "scikit_build_core.build"
dependencies-file = "../../dependencies.yaml"
Expand Down
4 changes: 0 additions & 4 deletions python/cudf_kafka/cudf_kafka/tests/pytest.ini

This file was deleted.

2 changes: 2 additions & 0 deletions python/cudf_kafka/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,11 @@ skip = [
]

[tool.pytest.ini_options]
addopts = "--tb=native"
filterwarnings = [
"error"
]
xfail_strict = true

[tool.scikit-build]
build-dir = "build/{wheel_tag}"
Expand Down
4 changes: 4 additions & 0 deletions python/cudf_polars/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ license-files = ["LICENSE"]
version = {file = "cudf_polars/VERSION"}

[tool.pytest.ini_options]
addopts = "--tb=native"
filterwarnings = [
"error"
]
xfail_strict = true

[tool.coverage.report]
Expand Down
4 changes: 0 additions & 4 deletions python/cudf_polars/tests/pytest.ini

This file was deleted.

4 changes: 0 additions & 4 deletions python/custreamz/custreamz/tests/pytest.ini

This file was deleted.

18 changes: 5 additions & 13 deletions python/custreamz/custreamz/tests/test_dataframes.py
Original file line number Diff line number Diff line change
Expand Up @@ -377,24 +377,16 @@ def test_setitem_overwrites(stream):
[
({}, "sum"),
({}, "mean"),
pytest.param({}, "min"),
({}, "min"),
pytest.param(
{},
"median",
marks=pytest.mark.xfail(reason="Unavailable for rolling objects"),
),
pytest.param({}, "max"),
pytest.param(
{},
"var",
marks=pytest.mark.xfail(reason="Unavailable for rolling objects"),
),
pytest.param({}, "count"),
pytest.param(
{"ddof": 0},
"std",
marks=pytest.mark.xfail(reason="Unavailable for rolling objects"),
),
({}, "max"),
({}, "var"),
({}, "count"),
({"ddof": 0}, "std"),
pytest.param(
{"quantile": 0.5},
"quantile",
Expand Down
3 changes: 3 additions & 0 deletions python/custreamz/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,14 @@ skip = [
]

[tool.pytest.ini_options]
addopts = "--tb=native"
filterwarnings = [
"error",
"ignore:unclosed <socket.socket:ResourceWarning",
"ignore:Port .* is already in use.:UserWarning:distributed",
# Should be fixed in the next streamz release
# https://github.com/python-streamz/streamz/commit/2812f1f961dfcb3f17e948d8b12a12472975558e
"ignore:pkg_resources is deprecated as an API:DeprecationWarning:streamz",
"ignore:Deprecated call to `pkg_resources.declare_namespace:DeprecationWarning"
]
xfail_strict = true
4 changes: 0 additions & 4 deletions python/dask_cudf/dask_cudf/tests/pytest.ini

This file was deleted.

2 changes: 2 additions & 0 deletions python/dask_cudf/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ skip = [
]

[tool.pytest.ini_options]
addopts = "--tb=native"
filterwarnings = [
"error::FutureWarning",
"error::DeprecationWarning",
Expand All @@ -125,3 +126,4 @@ filterwarnings = [
"ignore:Passing a BlockManager to DataFrame is deprecated and will raise in a future version. Use public APIs instead.:DeprecationWarning",
"ignore:String support for `aggregate_files` is experimental. Behavior may change in the future.:FutureWarning:dask",
]
xfail_strict = true
9 changes: 0 additions & 9 deletions python/pylibcudf/pylibcudf/tests/pytest.ini

This file was deleted.

9 changes: 9 additions & 0 deletions python/pylibcudf/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,15 @@ skip = [
"__init__.py",
]

[tool.pytest.ini_options]
addopts = "--tb=native"
filterwarnings = [
"error",
"ignore:::.*xdist.*",
"ignore:::.*pytest.*"
]
xfail_strict = true

[tool.rapids-build-backend]
build-backend = "scikit_build_core.build"
dependencies-file = "../../dependencies.yaml"
Expand Down
Loading