test_a_repo_with_no_kconfig_is_completely_unaffected¶
Tests › tests/test_kconfig.py
What this test is for
Why it exists
The whole change must be inert for every existing target: no table created, no prose chunk, no `kconfig.*` row, and an honest `found: false` from the query layer.
Verifies REQ-DDB-PIPE-007 REQ-DDB-PIPE-014
Given
root = tmp_path / "plain"(root / "src").mkdir(parents=True)
3 more
(root / "src" / "main.c").write_text("int main(void) { return 0; }\n", encoding="utf-8")db = tmp_path / "clew.db"_db_with_paths(db, ("src/main.c",))
When
model = import_kconfig(db, root, None)write_build_signature(db, kconfig=model.as_meta())conn = sqlite3.connect(str(db))
4 more
tables = {row[0] for row in conn.execute("SELECT name FROM sqlite_master WHERE type='table'")}metas = {row[0] for row in conn.execute("SELECT key FROM build_meta")}conn.close()space = kconfig_space(db)
Then
- ✓ model.as_meta() equals {}
- ✓ tables does not contain "kconfig_symbols"
- ✓ tables does not contain "kconfig_choices"
- ✓ any(key.startswith("kconfig.") for key in metas) is false
- ✓ space.found is False
- ✓ space.symbols equals ()
- ✓ space.error equals ""
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.
`main` (scripts/export_parity.py) · 11 of 203 steps
… 177 earlier steps
… 5 steps between
1 more
- clew — `main` (clew/cli.py) · 10 of 400 steps
tests/test_kconfig.py:722 · its file's page
What it checks (7)
assert model.as_meta() == {}, "a repo with no Kconfig must stamp no kconfig.* row"observesimport_kconfigviamodelassert "kconfig_symbols" not in tablesnot attributedassert "kconfig_choices" not in tablesnot attributedassert not any(key.startswith("kconfig.") for key in metas)not attributedassert space.found is Falseobserveskconfig_spaceviaspaceassert space.symbols == ()observeskconfig_spaceviaspaceassert space.error == ""observeskconfig_spaceviaspace
Where the product reaches it
main→query_main→_payload→export_search→corpus_payload→kconfig_space(flow)
Call flow
test_a_repo_with_no_kconfig_is_completely_unaffected→_db_with_paths→import_kconfig→write_build_signature→kconfig_spaceWhat 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.
Requirements it verifies (2)
| requirement | linked by | implementers exercised |
|---|---|---|
| REQ-DDB-PIPE-007 | catalog | unknown |
| REQ-DDB-PIPE-014 | catalog | 4 of 5: _served_parse_error, _sourced_outside, parse_environment, within_repo |
Also reaches 10 requirements
Its run touches their code; that is reach, not proof.
- REQ-DDB-CONFIG-005 measured
- REQ-DDB-CONFIG-006 measured
- REQ-DDB-CONFIG-007 measured
- REQ-DDB-PIPE-005 measured
- REQ-DDB-QUERY-001 measured
- REQ-DDB-QUERY-003 measured
- REQ-DDB-QUERY-004 inferred
- REQ-DDB-QUERY-006 measured
- REQ-DDB-QUERY-013 inferred
- REQ-DDB-SCHEMA-013 inferred