Repository navigation
Contract test suite (5/5): CMake presets, test docs, shared fixtures - #99
Open
olivhoenen wants to merge 5 commits into
Open
olivhoenen wants to merge 5 commits into
olivhoenen wants to merge 5 commits into
Conversation
A stray CLion cmake-build-debug/ tree (with a full vendored googletest checkout) was sitting untracked inside tests/contract/, polluting greps and the graphify knowledge graph. Only /build*/ at the repo root was ignored; IDE-style per-directory build trees were not. (cherry picked from commit 624d7e3)
CMakePresets.json defines the configure/build/test presets for every test leg: tests / tests-debug (the blocking functional matrix, issue #32), sanitize (the D7 ASan/UBSan leg, env and Death|CurrentlyCorrupts exclusions moved into the test preset), and mdsplus (backend + baked model tree, MDSPLUS_MODELS_PATH pointed at the bake). Test presets for the unit/integration tiers give the fast hermetic loop a name, and every label-filtered preset sets noTestsAction=error so an empty selection fails instead of passing silently (same concern as issue #31). contract-tests.yml, sanitizers.yml and mdsplus-contract.yml now call the presets instead of hand-assembled flags, so a local 'ctest --preset ...' reproduces a CI leg exactly. Only the DD version pin stays in mdsplus-contract.yml, next to the cache key it feeds. The UDA leg is untouched on purpose: its configure lives in docker/uda/run.sh, part of the pinned reference stack whose image cache is keyed on that file. Verified locally: unit (96), integration (163) and tests (263) presets all pass. (cherry picked from commit aade3e7)
tests/README.md is the operational front door: what lives where (smoke / contract / Python suites), the CTest tier table with per-tier requirements, the preset commands that reproduce each CI leg, how to read DISABLED_+tripwire (xfail) and GTEST_SKIP (divergence / unconfigured backend) output, and the fixture tools. It routes to TEST_STRATEGY.md for rationale and TRACEABILITY.md for the coverage ledger rather than repeating them. README.md and CONTRIBUTING.md gain three-line 'running the tests' stubs that link to it. (cherry picked from commit 10bda17)
The root ./test dispatcher (the one-verb wrapper for the Docker-backed MDSplus/UDA tiers) predates CMakePresets.json and hand-assembled its own configure lines, which had already drifted from CI: 'common' built Release without AL_PYTHON_BINDINGS=OFF while the blocking leg runs RelWithDebInfo. Its host and in-container recipes now call the same tests/mdsplus presets CI uses, so the script only adds orchestration (image builds, bind mounts, the summary table) and there is exactly one place flags live. Only the DD pin stays inline, matching mdsplus-contract.yml. The UDA verb is untouched (uda-run.sh owns its configure by design). tests/README.md now documents ./test in the quick start; .gitignore gains .pytest_cache/. Verified: ./test common passes end-to-end (263 tests). (cherry picked from commit b105206)
Extract equilibrium_seed.h and the GTest-free subset of al_contract.h's generic typed round-trip helpers it needs (DType, write_data, read_data, element_count) into a new top-level fixtures/ directory, wired as an INTERFACE library (al_contract_fixtures) added unconditionally in the root CMakeLists.txt, independent of AL_BUILD_TESTS. This lets a future benchmarks/ target (PRD #50) link the exact same workload the contract suite pins, with no fixture drift and no duplication. tests/contract/al_contract.h now includes the shared header instead of redefining those symbols; contract_tests links the new target so unqualified #include "equilibrium_seed.h" in the existing test files keeps resolving. An opt-in throwaway executable (AL_BUILD_FIXTURE_SMOKE, off by default) proves the fixture builds and round-trips against the Memory backend from a target outside tests/, with no GoogleTest link. (cherry picked from commit 690f539)
olivhoenen
requested review from
SimonPinches and
prasad-sawantdesai
as code owners
October 14, 2026 06:39
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of the split of #85 (Tests and Benchmarks for regression) into smaller, single-purpose PRs that are easier to review.
Adds
CMakePresets.jsonas the canonical test entry point (also used by CI), documents how to run the suites (tests/README.mdplus pointers in README/CONTRIBUTING), makes./testdelegate to the presets, and moves the contract fixtures tofixtures/so they can be linked outsidetests/(used by the benchmarks). Tests, tooling and docs only.Fork history: issue yohannmarguier#51.
Stack position: 5/9; depends on #98. The fix PRs and the benchmark PR build on this one.
Authorship: these commits are @yohannmarguier's, cherry-picked unchanged from his fork with
git cherry-pick -x, so each one keeps its original author, date and message plus a(cherry picked from commit …)link back to the fork. Only conflicts with currentdevelopand with the new commit order were resolved.🤖 Generated with Claude Code