test_an_incremental_refresh_equals_a_full_rebuild

Tests › tests/integration/test_incremental_pipeline.py

passed Passed in the packaged run.

What this test is for

Why it exists

THE WIRING IS THE SUBJECT. Every call goes through `build_index`, so removing any step from `_incremental_plan` or `_incremental_doxygen` changes this test's answer.

Given

  1. root = tmp_path / "repo"
  2. _seed(root)
  3. incremental = tmp_path / "incremental.db"
→

When

  1. with captured_output(): build_index(output=incremental, repo_root=root, doxyfile=root / "Doxyfile")
  2. _edit(root)
  3. with captured_output(): build_index(output=incremental, repo_root=root, doxyfile=root / "Doxyfile")
6 more
  1. sidecar = sqlite3.connect(str(incremental) + ".idxcache")
  2. try: row = sidecar.execute( "SELECT value FROM cache_meta WHERE key = 'splice_generation'" ).fetchone() finally: sidecar.close()
  3. full = tmp_path / "full.db"
  4. with captured_output(): build_index(output=full, repo_root=root, doxyfile=root / "Doxyfile")
  5. got, want = _snapshot(incremental), _snapshot(full)
  6. for layer in ("members", "edges", "indexed", "reimplements", "params"): missing = want[layer] - got[layer] extra = got[layer] - want[layer] assert not missing and not extra, ( f"{layer}: the incrementally refreshed index disagrees with a full rebuild.\n" f" missing from incremental ({len(missing)}): {sorted(missing)[:8]}\n" f" only in incremental ({len(extra)}): {sorted(extra)[:8]}" )
→

Then

  1. ✓ row is not None
  2. ✓ int(row[0]) is greater than 0
  3. ✓ ("pipeline_probe", "sound_play_findme", "doxygen_sqlite") in want["edges"] or any( a == "pipeline_probe" and b == "sound_play_findme" for a, b, _ in want["edges"] ) holds
  4. ✓ any("vendor" in f for f in want["indexed"]) is false
  5. ✓ any("Extra" in a or "Extra" in b for a, b in want["reimplements"]) holds
  6. ✓ want["params"] holds

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) · 34 of 400 steps

… 10 earlier steps

command-line usercommand-line usercommand-line usercommand-line userclew/scope.pyclew/scope.pyclew/scope.pyclew/scope.pyother filesother filesother filesother filesalt (line 1171)altopt (line 529)optmain11. propose → build_context11build_context12. build_context → derive_scope12derive_scope13. derive_scope → _declared_index_scope13_declared_index_scope▶ test enters14. _declared_index_scope → load_declaration_located14load_declaration_located15–18. load_declaration_located → _read_mapping15_read_mapping +3 more19–20. _checked_section → _checked_list_section19_checked_list_section +1 more

… 2 steps between

command-line usercommand-line usercommand-line usercommand-line userother filesother filesother filesother filesopt (line 531)optloop (line 417)loopopt (line 420)optalt (line 421)altopt (line 533)optmain23–24. all → list23list +1 more25–31. _checked_section → _checked_requirements25_checked_requirements +6 more32. _validate_dict_node → _suggest_key32_suggest_key33. _validate_dict_node → _validate_node33_validate_node34–35. _checked_section → _checked_tests34_checked_tests +1 more

… 3 steps between

command-line usercommand-line usercommand-line usercommand-line userclew/scope.pyclew/scope.pyclew/scope.pyclew/scope.pyother filesother filesother filesother filesloop (line 598)loopopt (line 696)optmain39–40. _checked_document → _checked_entries39_checked_entries +1 more41. _checked_section → _check_section_keys41_check_section_keys42–44. _declared_index_scope → _existing_paths42_existing_paths +2 more45–46. derive_scope → whole_repo_scope45whole_repo_scope +1 more

… 5 steps between

command-line usercommand-line usercommand-line usercommand-line userclew/scope.pyclew/scope.pyclew/scope.pyclew/scope.pyloop (line 1239)loopopt (line 847)optloop (line 746)loopmain52–53. whole_repo_scope → nested_repo_roots52nested_repo_roots +1 more54–56. _nested_repos_under → _warn_unwalkable54_warn_unwalkable +2 more57. nested_repo_roots → _nested_repos_under57_nested_repos_under▶ test enters58–59. whole_repo_scope → _gitignored_paths58_gitignored_paths +1 more

… 7 steps between

command-line usercommand-line usercommand-line usercommand-line userclew/scope.pyclew/scope.pyclew/scope.pyclew/scope.pyother filesother filesother filesother filesopt (line 385)optmain67–68. whole_repo_scope → _vendored_clause67_vendored_clause +1 more69. derive_scope → whole_repo_scope69whole_repo_scope▶ test enters70–72. build_context → repo_source_files70repo_source_files +2 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

… 23 steps between

command-line usercommand-line usercommand-line usercommand-line userclew/propose/astdefs.pyclew/propose/astdefs.pyclew/propose/astdefs.pyclew/propose/astdefs.pyother filesother filesother filesother filesmain111. _accessor_site → callee_name111callee_name112. build_context → load_declaration112load_declaration113. load_declaration → load_declaration_located113load_declaration_located▶ test enters114–115. propose → _sections114_sections +1 more

… 57 steps between

command-line usercommand-line usercommand-line usercommand-line userclew/init_command.pyclew/init_command.pyclew/init_command.pyclew/init_command.pyother filesother filesother filesother filesloop (line 312)looploop (line 314)loopmain173. diagnose → _check_doxygen173_check_doxygen174. _check_doxygen → uses_rustdoc174uses_rustdoc175. uses_rustdoc → discover_doxyfile175discover_doxyfile▶ test enters176. uses_rustdoc → has_cargo_manifest176has_cargo_manifest177. _check_doxygen → _needs_doxygen177_needs_doxygen178. _needs_doxygen → claims178claims

… 27 steps between

command-line usercommand-line usercommand-line usercommand-line userother filesother filesother filesother filestry (line 155)trymain206–207. _locate → target_for206target_for +1 more208. target_for → state_home208state_home▶ test enters209–210. query_main → _payload209_payload +1 more

… 190 later steps

6 more

tests/integration/test_incremental_pipeline.py:181 · its file's page

What it checks (6)

  1. assert row is not None and int(row[0]) > 0, ( f"the second build did NOT take the incremental branch (splice_generation={row}), so " f"this test compares two full rebuilds and proves nothing about the splice" ) not attributed
  2. assert ("pipeline_probe", "sound_play_findme", "doxygen_sqlite") in want["edges"] or any( a == "pipeline_probe" and b == "sound_play_findme" for a, b, _ in want["edges"] ), "the rebuild has no pipeline_probe -> sound_play_findme edge; the second pass is untested" not attributed
  3. assert not any("vendor" in f for f in want["indexed"]), ( "the rebuild indexed the excluded vendor/ tree, so EXCLUDE_PATTERNS is not in force " "and the scope filter is untested here" ) not attributed
  4. assert any("Extra" in a or "Extra" in b for a, b in want["reimplements"]), ( "the rebuild has no Extra override, so the inheritance tables are untested here" ) not attributed
  5. assert want["params"], ( "the rebuild produced no memberdef_param rows, so comparing that table is vacuous" ) not attributed
  6. assert not missing and not extra, ( f"{layer}: the incrementally refreshed index disagrees with a full rebuild.\n" f" missing from incremental ({len(missing)}): {sorted(missing)[:8]}\n" f" only in incremental ({len(extra)}): {sorted(extra)[:8]}" ) not attributed

Where the product reaches it

No product flow reaches this code: no product entry point's flow calls any of the functions this test calls.

Call flow

test_an_incremental_refresh_equals_a_full_rebuild→_seed→captured_output→_edit→_snapshot

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.

Also reaches 52 requirements

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