Skip to content

Contract test suite (5/5): CMake presets, test docs, shared fixtures - #99

Open
olivhoenen wants to merge 5 commits into
split85/4-contract-hardeningfrom
split85/5-presets-docs-fixtures
Open

olivhoenen wants to merge 5 commits into
split85/4-contract-hardeningfrom
split85/5-presets-docs-fixtures

Conversation

@olivhoenen

Copy link
Copy Markdown
Collaborator

Part of the split of #85 (Tests and Benchmarks for regression) into smaller, single-purpose PRs that are easier to review.

Adds CMakePresets.json as the canonical test entry point (also used by CI), documents how to run the suites (tests/README.md plus pointers in README/CONTRIBUTING), makes ./test delegate to the presets, and moves the contract fixtures to fixtures/ so they can be linked outside tests/ (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 current develop and with the new commit order were resolved.

⚠️ Please merge with "Create a merge commit" or "Rebase and merge", not "Squash and merge": squashing would attribute Yohann's commits to the person who merges.

🤖 Generated with Claude Code

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)

This branch has not been deployed

No deployments
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.

2 participants