test_the_file_probe_degrades_on_a_minimal_path_table

Tests › tests/test_file_subject.py

passed Passed in the packaged run.

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

  1. db = tmp_path / "thin.db"
  2. conn = sqlite3.connect(db)
3 more
  1. conn.execute("CREATE TABLE path (rowid INTEGER PRIMARY KEY, name TEXT)")
  2. conn.execute("INSERT INTO path (name) VALUES ('src/thin.c')")
  3. conn.commit()
→

When

  1. is_indexed_file(conn, "src/thin.c")
  2. is_indexed_file(conn, "src/absent.c")
  3. built = file_subject(conn, "src/thin.c")
  4. conn.close()
→

Then

  1. ✓ is_indexed_file(conn, "src/thin.c") is True
  2. ✓ is_indexed_file(conn, "src/absent.c") is False
  3. ✓ built is not None
  4. ✓ built.members equals ()
  5. ✓ 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

callercallercallercallerclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyclew/wiki/symbols.pyclew/wiki/symbols.pyclew/wiki/symbols.pyclew/wiki/symbols.pyother filesother filesother filesother filesloop (line 173)loopbuild_wiki257. symbol_pages → _owners_by_file257_owners_by_file258. _owners_by_file → file_owners258file_owners259. file_owners → table_exists259table_exists▶ test enters260. _owners_by_file → list260list261. symbol_pages → table_exists261table_exists

… 139 later steps

3 more

tests/test_file_subject.py:149 · its file's page

What it checks (5)

  1. assert is_indexed_file(conn, "src/thin.c") is True observes is_indexed_file
  2. assert is_indexed_file(conn, "src/absent.c") is False observes is_indexed_file
  3. assert built is not None observes file_subject via built
  4. assert built.members == () observes file_subject via built
  5. assert built.symbol_count == 0 observes file_subject via built

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_the_file_probe_degrades_on_a_minimal_path_table→is_indexed_file→file_subject

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.

test_the_file_probe_degrades_on_a_minimal_path_table · 5 checksfile_subjecthas_columnsREQ-DDB-QUERY-003 · measuredfile_subjectREQ-DDB-QUERY-004 · measured
Also reaches 2 requirements

Its run touches their code; that is reach, not proof.