test_a_named_target_is_distinct¶
Tests › tests/test_named_targets.py
What this test is for
Why it exists
Two sub-indexes of ONE root must not share a database — that is the whole feature. The assertion is on both the slug and the db path, because the slug is what a caller addresses and the path is what the build writes; a change that made them disagree would route reads and writes to different files.
Given
repo = tmp_path / "myproj"repo.mkdir()state = tmp_path / "state"
When
plain = target_for(repo, state)first = target_for(repo, state, name="first-party")vendor = target_for(repo, state, name="llama-cpp")
Then
- ✓ len({plain.slug, first.slug, vendor.slug}) equals 3
- ✓ len({plain.db_path, first.db_path, vendor.db_path}) equals 3
- ✓ first.repo_path == vendor.repo_path == plain.repo_path holds
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) · 2 of 142 steps
… 31 earlier steps
… 105 later steps
4 more
- Build, refresh and check the index · 2 of 153 steps
- clew — `main` (clew/cli.py) · 2 of 400 steps
- clew-mcp — `main` (clew/mcp_server/server.py) · 2 of 17 steps
- `main` (scripts/incremental_probe.py) · 2 of 3 steps
tests/test_named_targets.py:73 · its file's page
What it checks (3)
assert len({plain.slug, first.slug, vendor.slug}) == 3, ( f"slugs collided: {plain.slug}, {first.slug}, {vendor.slug}" )observestarget_forviafirstassert len({plain.db_path, first.db_path, vendor.db_path}) == 3, "db paths collided"observestarget_forviafirstassert first.repo_path == vendor.repo_path == plain.repo_pathobservestarget_forviafirst
Where the product reaches it
main→query_main→_locate→target_for(flow)
Call flow
What 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 1 requirement
Its run touches their code; that is reach, not proof.
- REQ-DDB-MCP-001 measured