test_the_file_probe_degrades_on_a_minimal_path_table¶
Tests › tests/test_file_subject.py
What this test is for
Why it exists
RED WHEN WRITTEN, AGAINST CODE ALREADY IN THE TREE. The first draft of `is_indexed_file` named `path.type` unconditionally. This repository's minimal fixtures create `path (rowid, name)` and nothing else, so the probe raised `no such column: type` — and because `resolve_subject` runs EVERY probe against EVERY bare name, it took 14 unrelated tests down with it: every enum subject, both kconfig subjects, three recovery hints.
Given
db = tmp_path / "thin.db"conn = sqlite3.connect(db)
3 more
conn.execute("CREATE TABLE path (rowid INTEGER PRIMARY KEY, name TEXT)")conn.execute("INSERT INTO path (name) VALUES ('src/thin.c')")conn.commit()
When
is_indexed_file(conn, "src/thin.c")is_indexed_file(conn, "src/absent.c")built = file_subject(conn, "src/thin.c")conn.close()
Then
- ✓ is_indexed_file(conn, "src/thin.c") is True
- ✓ is_indexed_file(conn, "src/absent.c") is False
- ✓ built is not None
- ✓ built.members equals ()
- ✓ built.symbol_count equals 0
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.
Build this wiki from the index · 1 of 400 steps
… 256 earlier steps
… 139 later steps
3 more
- Look up one name: everything the index holds about it · 1 of 226 steps
- clew — `main` (clew/cli.py) · 1 of 400 steps
- `main` (scripts/export_parity.py) · 1 of 203 steps
tests/test_file_subject.py:149 · its file's page
What it checks (5)
assert is_indexed_file(conn, "src/thin.c") is Trueobservesis_indexed_fileassert is_indexed_file(conn, "src/absent.c") is Falseobservesis_indexed_fileassert built is not Noneobservesfile_subjectviabuiltassert built.members == ()observesfile_subjectviabuiltassert built.symbol_count == 0observesfile_subjectviabuilt
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
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 2 requirements
Its run touches their code; that is reach, not proof.
- REQ-DDB-QUERY-003 measured
- REQ-DDB-QUERY-004 measured