Skip to content

COMP: Split OOC test discovery only in out-of-core builds - #1977

Open
imikejackson wants to merge 1 commit into
BlueQuartzSoftware:developfrom
imikejackson:topic/ooc_test_discovery_gate
Open

imikejackson wants to merge 1 commit into
BlueQuartzSoftware:developfrom
imikejackson:topic/ooc_test_discovery_gate

Conversation

@imikejackson

Copy link
Copy Markdown
Contributor

Summary

Builds without out-of-core storage print a Catch2 warning for each test executable that has no [OOC] test cases:

CMake Warning at .../share/catch2/CatchAddTests.cmake:46 (message):
  Test executable '.../Bin/TestOneUnitTest' contains no tests!

The warning appears for TestOneUnitTest, SimplnxReviewUnitTest, SyntheticUnitTest and simplnx_test. It comes from the second Catch2 discovery (TEST_SPEC "[OOC]~[.]") that #1889 added to every test executable. When an executable has no [OOC] cases, that discovery finds nothing.

Catch2 2.13.6 (from vcpkg) does not have ADD_TAGS_AS_LABELS, so the change uses the DREAM3DNX_ENABLE_OOC option instead:

  • cmake/DiscoverTests.cmake (new) defines simplnx_discover_tests(<target>).
    • When DREAM3DNX_ENABLE_OOC is OFF or not defined (all simplnx-only builds), there is one discovery, TEST_SPEC "~[.]". Test cases tagged [OOC] are still registered, without the ooc label.
    • When DREAM3DNX_ENABLE_OOC is ON, the two discoveries stay as before, and [OOC] cases get the ooc label. This label matches the <Plugin>OocStoreContracts entries and ctest -L "^ooc$".
  • cmake/Plugin.cmake (and so the out-of-tree plugins) and test/CMakeLists.txt call the new function.
  • AGENTS.md now says that the ooc label exists only in builds with DREAM3DNX_ENABLE_OOC=ON.

Each visible test case is still registered exactly once.

In an out-of-core build, executables with no [OOC] cases (TestOneUnitTest, simplnx_test) still print the warning. The warning does no harm.

Test plan

macOS arm64, DREAM3D-NX Release builds of this branch:

  • In-core (DREAM3DNX_ENABLE_OOC=OFF):
    • The build prints no "contains no tests" warnings.
    • ctest -N lists 4,044 tests. A build of the old discovery code from the same tree lists the same 4,044 test names.
    • No Catch2 test has the ooc label.
    • These tests ran serially and passed: two [OOC]-tagged TupleTransfer cases, TestOne_test_profile_isolation, and a SimplnxReview test.
  • Out-of-core (DREAM3DNX_ENABLE_OOC=ON, with SimplnxOoc develop):
    • The build passes.
    • ctest -N -L "^ooc$" lists 1,029 tests, including the 3 *OocStoreContracts entries.
    • ctest -L "^ooc$" -LE "benchmark" -j 1: 1,028 of 1,028 tests passed.

🤖 Generated with Claude Code

Every test executable ran a second Catch2 discovery for [OOC] cases. In
builds without DREAM3DNX_ENABLE_OOC, executables with no [OOC] cases
(TestOne, SimplnxReview, Synthetic, simplnx_test) printed
"contains no tests!" during the build.

simplnx_discover_tests() in cmake/DiscoverTests.cmake now registers each
executable with one discovery ("~[.]") when DREAM3DNX_ENABLE_OOC is OFF
or undefined, and keeps the split discovery with the "ooc" label when it
is ON. Every visible test is still registered exactly once.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant