From 8267cd9c9f77fed8c2e8c696d947939b766d12c1 Mon Sep 17 00:00:00 2001 From: Simon Adorf Date: Thu, 9 Feb 2023 06:19:56 -0800 Subject: [PATCH 1/3] Revert "Disable hypothesis tests for 23.02 burndown." This reverts commit 36454fbf6d653c474b93bdf5762bc1bffe397335. --- python/pytest.ini | 3 --- 1 file changed, 3 deletions(-) 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' From 78907d6cecea7d4e67c1d72991e14a86d22748bd Mon Sep 17 00:00:00 2001 From: Simon Adorf Date: Thu, 9 Feb 2023 07:57:40 -0800 Subject: [PATCH 2/3] Make running of all hypothesis phases opt in. Unless the RAPIDS_CUML_RUN_HYPOTHESIS environment variable is set, hypothesis phases are restricted to explicit examples only. --- .github/workflows/test.yaml | 2 ++ python/cuml/tests/conftest.py | 17 +++++++++++++++++ 2 files changed, 19 insertions(+) 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..99e57e6969 100644 --- a/python/cuml/tests/conftest.py +++ b/python/cuml/tests/conftest.py @@ -41,6 +41,8 @@ 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 +56,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, ) From 45d49aac42e5492a4c96bf571e10d968d631eab1 Mon Sep 17 00:00:00 2001 From: Simon Adorf Date: Fri, 17 Feb 2023 01:34:56 -0800 Subject: [PATCH 3/3] Apply black formatting. --- python/cuml/tests/conftest.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/python/cuml/tests/conftest.py b/python/cuml/tests/conftest.py index 99e57e6969..253947fc95 100644 --- a/python/cuml/tests/conftest.py +++ b/python/cuml/tests/conftest.py @@ -41,8 +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") +HYPOTHESIS_ENABLED = os.environ.get("RAPIDS_CUML_RUN_HYPOTHESIS") in ( + "true", + "1", +) # Configure hypothesis profiles