test_build_excludes_are_honoured¶
Tests › tests/test_datamodel.py
What this test is for
Why it exists
A CORRECTNESS REQUIREMENT, not a speed one. A generated data model's OUTPUT lands in a build directory, and this layer's whole premise is that it reads the generator's SOURCES — an index that is a function of whether somebody ran a build would make two indexes of one commit disagree about which keys exist. The build already excludes its own output, so honouring that list is what makes the guarantee structural rather than a naming convention.
Given
_repo(tmp_path, {"widgetbus.toml": MANIFEST}, DEFINES)generated = tmp_path / "build" / "gen"
5 more
generated.mkdir(parents=True)(generated / "dm_full.toml").write_text(EXAMPLE_MANIFEST, encoding="utf-8")(generated / "gen_list.yaml").write_text("---\n- DEMO_SAMPLE_WIDGET\n", encoding="utf-8")unbounded = discover(tmp_path)bounded = discover(tmp_path, (tmp_path / "build",))
When
- —
Then
- ✓ {k.define_name for k in unbounded.keys} contains "DEMO_SAMPLE_WIDGET"
- ✓ {k.define_name for k in bounded.keys} equals set(DEFINES)
- ✓ bounded.listed does not contain "DEMO_SAMPLE_WIDGET"
What it exercises
The parts of the system's flows this test ran, measured by per-test coverage: lit steps ran in this test, dimmed ones did not, and ▶ marks where the test called in. Each title opens the whole flow with these steps lit.
thread `clew-first-build-` — `_first_build_worker` (clew/mcp_server/server.py) · 4 of 142 steps
… 8 earlier steps
… 126 later steps
2 more
- Build, refresh and check the index · 4 of 153 steps
- clew — `main` (clew/cli.py) · 4 of 400 steps
tests/test_datamodel.py:888 · its file's page
What it checks (3)
assert "DEMO_SAMPLE_WIDGET" in {k.define_name for k in unbounded.keys}not attributedassert {k.define_name for k in bounded.keys} == set(DEFINES)not attributedassert "DEMO_SAMPLE_WIDGET" not in bounded.listednot attributed
Where the product reaches it
No product flow reaches this code: no product entry point's flow calls any of the functions this test calls.
Call flow
test_build_excludes_are_honoured→_repoWhat it reaches
Each row runs from this test, through the calls it makes, to the code a requirement names. If that code breaks, the test's checks are what should catch it. Reaching is not proving: a check only proves what it observes. No mutation records were given, so these rows say what the test REACHES.
Also reaches 4 requirements
Its run touches their code; that is reach, not proof.
- REQ-DDB-CONFIG-001 measured
- REQ-DDB-INDEX-005 measured
- REQ-DDB-PIPE-003 measured
- REQ-DDB-SCHEMA-013 measured