test_a_repo_that_uses_no_kconfig_still_gets_a_gate_layer¶
Tests › tests/test_kconfig.py
What this test is for
Why it exists
THE MEASURED DEFECT (gh#390). The harvest matched one hardcoded prefix, `CONFIG_`, justified as reading Kconfig's own universal convention. True for a Kconfig repo, and it made the layer INERT on the dominant C convention: on mbedtls — 500 files whose entire question is "what is compiled in" — `kconfig_gates` existed with exactly the right columns and held ZERO rows, so `search("MBEDTLS_THREADING_PTHREAD")` returned a confident empty result nine times across one benchmark run.
Verifies REQ-DDB-CONFIG-005 REQ-DDB-PIPE-014
Given
root, db = _no_kconfig_repo(tmp_path)
When
import_kconfig_gates(db, root)gates = {(g.symbol, g.form) for g in kconfig_space(db).gates}
Then
- ✓ import_kconfig_gates(db, root) is greater than 0
- ✓ gates contains ("PROJ_THREADING_C", KCONFIG_GATE_IF_EXPR)
- ✓ gates contains ("PROJ_THREADING_PTHREAD", KCONFIG_GATE_IF_EXPR)
- ✓ gates contains ("PROJ_LEGACY", KCONFIG_GATE_IFDEF)
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.
clew — `main` (clew/cli.py) · 23 of 400 steps
… 70 earlier steps
… 128 steps between
… 158 steps between
… 1 later step
2 more
- `main` (scripts/export_parity.py) · 17 of 203 steps
- Look up one name: everything the index holds about it · 4 of 226 steps
tests/test_kconfig.py:513 · its file's page
What it checks (4)
assert import_kconfig_gates(db, root) > 0observesimport_kconfig_gatesassert ("PROJ_THREADING_C", KCONFIG_GATE_IF_EXPR) in gatesobserveskconfig_spaceviagatesassert ("PROJ_THREADING_PTHREAD", KCONFIG_GATE_IF_EXPR) in gatesobserveskconfig_spaceviagatesassert ("PROJ_LEGACY", KCONFIG_GATE_IFDEF) in gatesobserveskconfig_spaceviagates
Where the product reaches it
main→query_main→_payload→export_search→corpus_payload→kconfig_space(flow)
Call flow
test_a_repo_that_uses_no_kconfig_still_gets_a_gate_layer→_no_kconfig_repo→import_kconfig_gates→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-CONFIG-005 | catalog | unknown |
| REQ-DDB-PIPE-014 | catalog | unknown |
Also reaches 12 requirements
Its run touches their code; that is reach, not proof.
- REQ-DDB-CONFIG-004 measured
- REQ-DDB-PIPE-003 measured
- REQ-DDB-PIPE-007 measured
- REQ-DDB-PIPE-011 measured
- REQ-DDB-PIPE-012 inferred
- 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-012 measured
- REQ-DDB-SCHEMA-013 measured