From a738de985a52ceb15bf97fe1b09bbaa2e256cb5f Mon Sep 17 00:00:00 2001 From: Carl Simon Adorf Date: Fri, 17 Feb 2023 15:20:23 +0100 Subject: [PATCH] Enable hypothesis for 23.04 (#5221) Authors: - Carl Simon Adorf (https://github.com/csadorf) Approvers: - William Hicks (https://github.com/wphicks) - Ray Douglass (https://github.com/raydouglass) URL: https://github.com/rapidsai/cuml/pull/5221 --- .github/workflows/test.yaml | 2 ++ python/cuml/tests/conftest.py | 19 +++++++++++++++++++ python/pytest.ini | 3 --- 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index b9920f9dcb..d6066141bf 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -25,6 +25,8 @@ jobs: conda-python-tests-singlegpu: secrets: inherit uses: rapidsai/shared-action-workflows/.github/workflows/conda-python-tests.yaml@branch-23.04 + env: + RAPIDS_CUML_RUN_HYPOTHESIS=1 with: build_type: nightly branch: ${{ inputs.branch }} diff --git a/python/cuml/tests/conftest.py b/python/cuml/tests/conftest.py index 4b26951664..253947fc95 100644 --- a/python/cuml/tests/conftest.py +++ b/python/cuml/tests/conftest.py @@ -41,6 +41,10 @@ pytest_plugins = "cuml.testing.plugins.quick_run_plugin" CI = os.environ.get("CI") in ("true", "1") +HYPOTHESIS_ENABLED = os.environ.get("RAPIDS_CUML_RUN_HYPOTHESIS") in ( + "true", + "1", +) # Configure hypothesis profiles @@ -54,10 +58,25 @@ ] ) + +HYPOTHESIS_DEFAULT_PHASES = ( + ( + hypothesis.Phase.explicit, + hypothesis.Phase.reuse, + hypothesis.Phase.generate, + hypothesis.Phase.target, + hypothesis.Phase.shrink, + ) + if HYPOTHESIS_ENABLED + else (hypothesis.Phase.explicit,) +) + + hypothesis.settings.register_profile( name="unit", deadline=None if CI else timedelta(milliseconds=2000), parent=hypothesis.settings.get_profile("default"), + phases=HYPOTHESIS_DEFAULT_PHASES, max_examples=20, suppress_health_check=HEALTH_CHECKS_SUPPRESSED_BY_DEFAULT, ) diff --git a/python/pytest.ini b/python/pytest.ini index e9529e5dff..6dec495c6b 100644 --- a/python/pytest.ini +++ b/python/pytest.ini @@ -17,6 +17,3 @@ filterwarnings = error::FutureWarning:cuml[.*] # Catch uses of deprecated positional args in testing ignore:[^.]*ABCs[^.]*:DeprecationWarning:patsy[.*] ignore:(.*)alias(.*):DeprecationWarning:hdbscan[.*] - -# Do not run any hypothesis tests -addopts = -m 'not hypothesis'