test_a_gated_on_symbol_is_a_dossier_subject¶
Tests › tests/test_kconfig.py
What this test is for
Why it exists
THE OTHER HALF OF gh#390, and storing the rows without this fixes nothing a caller can see. `_is_config` used to probe declared symbols only, reasoning that a gate on an undeclared symbol "is not a subject, because there is nothing to describe". Once the harvest widened past the `CONFIG_` prefix there is a great deal to describe — where the symbol decides code exists, in how many files, in which form — and that IS the answer the benchmark questions wanted. Without this, `dossier` returned a confident negative for the exact symbols Q1 and Q2 are about while the rows sat in the table.
Verifies REQ-DDB-CONFIG-005 REQ-DDB-PIPE-014
Given
root, db = _no_kconfig_repo(tmp_path)
When
import_kconfig_gates(db, root)resolve_subject(db, "PROJ_THREADING_PTHREAD")subject = dossier(db, "PROJ_THREADING_PTHREAD")
Then
- ✓ resolve_subject(db, "PROJ_THREADING_PTHREAD") contains "config"
- ✓ subject is not None
- ✓ subject.kind equals "config"
- ✓ subject.config is not None
- ✓ {g.symbol for g in subject.config.gates} equals {"PROJ_THREADING_PTHREAD"}
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
3 more
- `main` (scripts/export_parity.py) · 17 of 203 steps
- Look up one name: everything the index holds about it · 15 of 226 steps
- Build this wiki from the index · 1 of 400 steps
tests/test_kconfig.py:576 · its file's page
What it checks (5)
assert "config" in resolve_subject(db, "PROJ_THREADING_PTHREAD")observesresolve_subjectassert subject is not Nonenot attributedassert subject.kind == "config"not attributedassert subject.config is not Nonenot attributedassert {g.symbol for g in subject.config.gates} == {"PROJ_THREADING_PTHREAD"}not attributed
Where the product reaches it
dossier→resolve_subject(flow)
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.
Requirements it verifies (2)
| requirement | linked by | implementers exercised |
|---|---|---|
| REQ-DDB-CONFIG-005 | catalog | unknown |
| REQ-DDB-PIPE-014 | catalog | unknown |
Also reaches 14 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 measured
- REQ-DDB-QUERY-006 measured
- REQ-DDB-QUERY-010 measured
- REQ-DDB-QUERY-012 measured
- REQ-DDB-QUERY-013 measured
- REQ-DDB-SCHEMA-012 measured
- REQ-DDB-SCHEMA-013 measured