test_a_gated_on_symbol_is_a_dossier_subject

Tests › tests/test_kconfig.py

passed Passed in the packaged run.

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

  1. root, db = _no_kconfig_repo(tmp_path)
→

When

  1. import_kconfig_gates(db, root)
  2. resolve_subject(db, "PROJ_THREADING_PTHREAD")
  3. subject = dossier(db, "PROJ_THREADING_PTHREAD")
→

Then

  1. ✓ resolve_subject(db, "PROJ_THREADING_PTHREAD") contains "config"
  2. ✓ subject is not None
  3. ✓ subject.kind equals "config"
  4. ✓ subject.config is not None
  5. ✓ {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

command-line usercommand-line usercommand-line usercommand-line userother filesother filesother filesother filesloop (line 134)looploop (line 135)loopopt (line 385)optmain71–72. repo_source_files → _scandir71_scandir +1 more73. _ts_language_for → _grammar_available73_grammar_available74–75. _grammar_available → has_language74has_language +1 more76. _ts_language_for → _try_import_ts_module76_try_import_ts_module77–80. build_context → scope_membership77scope_membership +3 more81. _ast_parse_one_file → _ts_language_for81_ts_language_for▶ test enters82–85. _ast_parse_one_file → _cached_parser82_cached_parser +3 more86–87. _ast_parse_one_file → _disambiguate_header86_disambiguate_header +1 more

… 128 steps between

command-line usercommand-line usercommand-line usercommand-line userclew/query/symbols.pyclew/query/symbols.pyclew/query/symbols.pyclew/query/symbols.pyclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyloop (line 1576)loopmain216. _memberdef_corpora → _expansion_sql216_expansion_sql217. _expansion_sql → has_columns217has_columns218. has_columns → table_exists218table_exists219. _memberdef_corpora → _memberdef_candidates219_memberdef_candidates220. _memberdef_candidates → table_exists220table_exists

… 158 steps between

command-line usercommand-line usercommand-line usercommand-line usercommand-line userclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyother filesother filesother filesother filesother filesloop (line 660)looploop ×2 (line 288)loop ×2main379. _config_found_on_the_wire → _compact_gate_panel379_compact_gate_panel380. corpus_payload → kconfig_space380kconfig_space381. kconfig_space → connect381connect▶ test enters382. kconfig_space → _meta382_meta383. _meta → table_exists383table_exists384. kconfig_space → _symbols384_symbols385. _symbols → table_exists385table_exists386. kconfig_space → table_exists386table_exists387. kconfig_space → _gate_layer_state387_gate_layer_state388. _gate_layer_state → table_exists388table_exists389. kconfig_space → _gate_symbol_names389_gate_symbol_names390. _gate_symbol_names → table_exists390table_exists391. kconfig_space → _gates391_gates392. _gates → table_exists392table_exists393. _gates → _gate_columns393_gate_columns394–395. _gate_columns → has_columns394has_columns ×2396. _gates → _with_defaults396_with_defaults397. _with_defaults → table_exists397table_exists398. _with_defaults → _defaults_for_macros398_defaults_for_macros399. _with_defaults → decided_default399decided_default

… 1 later step

3 more

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

What it checks (5)

  1. assert "config" in resolve_subject(db, "PROJ_THREADING_PTHREAD") observes resolve_subject
  2. assert subject is not None not attributed
  3. assert subject.kind == "config" not attributed
  4. assert subject.config is not None not attributed
  5. assert {g.symbol for g in subject.config.gates} == {"PROJ_THREADING_PTHREAD"} not attributed

Where the product reaches it

  • dossier → resolve_subject (flow)

Call flow

test_a_gated_on_symbol_is_a_dossier_subject→_no_kconfig_repo→import_kconfig_gates→resolve_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_a_gated_on_symbol_is_a_dossier_subject · 5 checksimport_kconfig_gatesdeclared_macro_namesbare_macro_namesREQ-DDB-CONFIG-004 · measuredimport_kconfig_gatesrun_harvestREQ-DDB-PIPE-003 · measuredimport_kconfig_gatesREQ-DDB-PIPE-007 · measuredimport_kconfig_gatesrun_harvest_harvest_one_file_parseable_fileREQ-DDB-PIPE-011 · measuredimport_kconfig_gates… 4 calls …has_languageREQ-DDB-PIPE-012 · inferredresolve_subjectconnectREQ-DDB-QUERY-001 · measuredimport_kconfig_gatesensure_kconfig_gates_tableREQ-DDB-SCHEMA-013 · measured

Requirements it verifies (2)

requirementlinked byimplementers exercised
REQ-DDB-CONFIG-005catalogunknown
REQ-DDB-PIPE-014catalogunknown
Also reaches 14 requirements

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