From a598519ce3b1d5f3c5e26d72829aa763f3a80352 Mon Sep 17 00:00:00 2001 From: Ben Deane Date: Thu, 10 Oct 2024 11:10:06 -0600 Subject: [PATCH 1/2] :art: Add dependencies for hypothesis test Problem: - The tuple PB test does not properly depend on `tuple.hpp` and `tuple_algorithms.hpp`, so it does not get rebuilt when either of those files changes. Solution: - Add `EXTRA_DEPS` to the test. --- test/pbt/CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/pbt/CMakeLists.txt b/test/pbt/CMakeLists.txt index b6f8ad2..f0d60fd 100644 --- a/test/pbt/CMakeLists.txt +++ b/test/pbt/CMakeLists.txt @@ -8,6 +8,9 @@ if(${CMAKE_CXX_STANDARD} GREATER_EQUAL 20) PYTEST FILES tuple.py + EXTRA_DEPS + ${CMAKE_SOURCE_DIR}/include/stdx/tuple.hpp + ${CMAKE_SOURCE_DIR}/include/stdx/tuple_algorithms.hpp EXTRA_ARGS -vv -n2 From 89525a2ff2f5f4abff1569e0fb1d9713eb0b31aa Mon Sep 17 00:00:00 2001 From: Ben Deane Date: Thu, 10 Oct 2024 11:11:29 -0600 Subject: [PATCH 2/2] :art: Hook up hypothesis profiles Problem: - Building hypothesis tests on the command line takes too long. - Building hypothesis tests in CI does not test enough cases. Solution: - Use different profiles: 10 iterations on the command line and 500 in CI. Note: - The default (with no profile) is 100 iterations. --- .github/workflows/unit_tests.yml | 1 + test/pbt/conftest.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index 7b5d3b4..4de893e 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -16,6 +16,7 @@ env: DEFAULT_LLVM_VERSION: 18 DEFAULT_GCC_VERSION: 13 MULL_LLVM_VERSION: 17 + HYPOTHESIS_PROFILE: ci concurrency: group: ${{ github.head_ref || github.run_id }} diff --git a/test/pbt/conftest.py b/test/pbt/conftest.py index e02d40a..fb43c19 100644 --- a/test/pbt/conftest.py +++ b/test/pbt/conftest.py @@ -9,7 +9,8 @@ hypothesis.settings.register_profile("ci", max_examples=500) hypothesis.settings.register_profile("fast", max_examples=10) - +profile = os.environ.get("HYPOTHESIS_PROFILE", "fast") +hypothesis.settings.load_profile(profile) def pytest_addoption(parser): parser.addoption("--compiler", action="store", help="C++ compiler", default=None, required=False)