test_a_repo_with_no_kconfig_is_completely_unaffected

Tests › tests/test_kconfig.py

passed Passed in the packaged run.

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

  1. root = tmp_path / "plain"
  2. (root / "src").mkdir(parents=True)
3 more
  1. (root / "src" / "main.c").write_text("int main(void) { return 0; }\n", encoding="utf-8")
  2. db = tmp_path / "clew.db"
  3. _db_with_paths(db, ("src/main.c",))
→

When

  1. model = import_kconfig(db, root, None)
  2. write_build_signature(db, kconfig=model.as_meta())
  3. conn = sqlite3.connect(str(db))
4 more
  1. tables = {row[0] for row in conn.execute("SELECT name FROM sqlite_master WHERE type='table'")}
  2. metas = {row[0] for row in conn.execute("SELECT key FROM build_meta")}
  3. conn.close()
  4. space = kconfig_space(db)
→

Then

  1. ✓ model.as_meta() equals {}
  2. ✓ tables does not contain "kconfig_symbols"
  3. ✓ tables does not contain "kconfig_choices"
  4. ✓ any(key.startswith("kconfig.") for key in metas) is false
  5. ✓ space.found is False
  6. ✓ space.symbols equals ()
  7. ✓ 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

program launcherprogram launcherprogram launcherprogram launcherprogram launcherclew/query/export.pyclew/query/export.pyclew/query/export.pyclew/query/export.pyclew/query/export.pyclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyclew/query/kconfig.pyclew/query/kconfig.pyclew/query/kconfig.pyclew/query/kconfig.pyclew/query/kconfig.pyother filesother filesother filesother filesother filesmain178. _config_found_on_the_wire → _compact_gate_panel178_compact_gate_panel179. corpus_payload → kconfig_space179kconfig_space180. kconfig_space → connect180connect▶ test enters181. kconfig_space → _meta181_meta182. _meta → table_exists182table_exists183. kconfig_space → _symbols183_symbols184. _symbols → table_exists184table_exists185. kconfig_space → table_exists185table_exists186. kconfig_space → _gate_layer_state186_gate_layer_state187. _gate_layer_state → table_exists187table_exists188. kconfig_space → _gate_symbol_names188_gate_symbol_names189. _gate_symbol_names → table_exists189table_exists190. kconfig_space → _gates190_gates191. _gates → table_exists191table_exists192. _gates → _gate_columns192_gate_columns193. _gate_columns → has_columns193has_columns

… 5 steps between

program launcherprogram launcherprogram launcherprogram launcherclew/query/export.pyclew/query/export.pyclew/query/export.pyclew/query/export.pyclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyclew/query/kconfig.pyclew/query/kconfig.pyclew/query/kconfig.pyclew/query/kconfig.pyother filesother filesother filesother filesmain199. decided_default → is_shipped_config199is_shipped_config200. _with_defaults → _in_default_build200_in_default_build201. kconfig_space → macros_meaning201macros_meaning▶ test enters202. kconfig_space → gates_meaning202gates_meaning203. corpus_payload → one203one
1 more

tests/test_kconfig.py:722 · its file's page

What it checks (7)

  1. assert model.as_meta() == {}, "a repo with no Kconfig must stamp no kconfig.* row" observes import_kconfig via model
  2. assert "kconfig_symbols" not in tables not attributed
  3. assert "kconfig_choices" not in tables not attributed
  4. assert not any(key.startswith("kconfig.") for key in metas) not attributed
  5. assert space.found is False observes kconfig_space via space
  6. assert space.symbols == () observes kconfig_space via space
  7. assert space.error == "" observes kconfig_space via space

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_space

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_a_repo_with_no_kconfig_is_completely_unaffected · 7 checksimport_kconfigREQ-DDB-CONFIG-005 · measuredwrite_build_signatureREQ-DDB-CONFIG-006 · measuredwrite_build_signatureREQ-DDB-CONFIG-007 · measuredwrite_build_signatureREQ-DDB-PIPE-005 · measuredimport_kconfigload_kconfig_served_parse_errorREQ-DDB-PIPE-014 · catalogkconfig_spaceconnectREQ-DDB-QUERY-001 · measuredkconfig_spacetable_existsREQ-DDB-QUERY-003 · measuredkconfig_space_gates_with_defaults_in_default_buildREQ-DDB-QUERY-004 · inferredkconfig_spaceREQ-DDB-QUERY-006 · measuredkconfig_space_gates_with_defaultsdecided_defaultREQ-DDB-QUERY-013 · inferredimport_kconfigstore_kconfigensure_kconfig_tablesREQ-DDB-SCHEMA-013 · inferred

Requirements it verifies (2)

requirementlinked byimplementers exercised
REQ-DDB-PIPE-007catalogunknown
REQ-DDB-PIPE-014catalog4 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.