clew
  • Requirements
  • Flows
  • Tests
  • Change impact
  • Map
  • Architecture
  • Docs
  • SBOM

test_check_reports_dangling_links_and_pin_conflicts¶

Tests › tests/test_wiki_composite.py

passed Passed in the packaged run.

What this test is for

Why it exists

`clew wiki check`'s composite problems: the dangling id and the double pin, by name.

Given

  1. product, pins = _fixture(tmp_path)
  2. pins["lib"] = _repo( tmp_path / "lib", "requirements:\n REQ-LIB-003:\n name: Broken\n satisfies: product:REQ-PRD-999\n", _catalogs(("hal", "../hal", pins["hal"])), )
2 more
  1. newer = _repo(tmp_path / "hal", "requirements:\n REQ-HAL-001:\n name: Timer v2\n")
  2. specs = [ CatalogSpec("hal2", "../hal", newer, "requirements.yaml"), *_specs(product, pins), ]
→

When

  1. problems = composite_problems(product, specs, probe=_no_index)
→

Then

  1. ✓ any("REQ-PRD-999" in p and "lib:REQ-LIB-003" in p for p in problems) holds
  2. ✓ any("pinned at" in p for p in problems) 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.

`main` (clew/guard/main.py) · 7 of 357 steps

… 62 earlier steps

program launcherprogram launcherprogram launcherprogram launcherclew/guard/main.pyclew/guard/main.pyclew/guard/main.pyclew/guard/main.pyclew/guard/config.pyclew/guard/config.pyclew/guard/config.pyclew/guard/config.pyclew/guard/impact.pyclew/guard/impact.pyclew/guard/impact.pyclew/guard/impact.pyclew/guard/checks.pyclew/guard/checks.pyclew/guard/checks.pyclew/guard/checks.pyother filesother filesother filesother filesloop (line 267)looptry (line 269)tryopt (line 1336)optalt (line 1344)alttry (line 1352)tryloop (line 973)looploop (line 974)looploop (line 287)looploop (line 288)loopmain63. load_external_requirements → get_requirements63get_requirements64. load_external_requirements → read_catalog_at64read_catalog_at65. read_catalog_at → _refuse_url65_refuse_url▶ test enters66–69. read_catalog_at → git_text66git_text +3 more70. read_catalog_at → _refuse_url70_refuse_url71. read_catalog_at → _catalog_rows71_catalog_rows72. _validate_files → get_requirements72get_requirements73. _validate_files → check_satisfies73check_satisfies74. check_satisfies → link_ids74link_ids75. link_ids → satisfies_ids75satisfies_ids▶ test enters76. _validate_files → load_failure_mode_ids76load_failure_mode_ids77. load_failure_mode_ids → _get_requirements_config77_get_requirements_config

… 280 later steps

4 more
  • thread `clew-first-build-` — `_first_build_worker` (clew/mcp_server/server.py) · 2 of 142 steps
  • Build this wiki from the index · 2 of 400 steps
  • Build, refresh and check the index · 2 of 153 steps
  • clew — `main` (clew/cli.py) · 2 of 400 steps

tests/test_wiki_composite.py:263 · its file's page

What it checks (2)

  1. assert any("REQ-PRD-999" in p and "lib:REQ-LIB-003" in p for p in problems), problems observes composite_problems via problems
  2. assert any("pinned at" in p for p in problems), problems observes composite_problems via problems

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_check_reports_dangling_links_and_pin_conflicts→_fixture→_repo→_catalogs→_specs→composite_problems

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_check_reports_dangling_links_and_pin_conflicts · 2 checkscomposite_problems… 3 calls …load_guard_configREQ-DDB-CONFIG-001 · measuredcomposite_problems… 3 calls …_is_flat_req_listREQ-DDB-CONFIG-003 · measuredcomposite_problems… 5 calls …read_requirements_sectionREQ-DDB-GUARD-012 · inferredcomposite_problems… 6 calls …apply_opt_in_languagesREQ-DDB-GUARD-024 · inferredcomposite_problems… 3 calls …git_textREQ-DDB-GUARD-027 · measuredcomposite_problems… 3 calls …resolve_catalog_pathREQ-DDB-SCHEMA-006 · measuredcomposite_problemscompose_nodeslink_idsREQ-DDB-SCHEMA-015 · measuredcomposite_problemscompose_root_sourcedeclared_catalogREQ-DDB-WIKI-015 · measuredcomposite_problemsREQ-DDB-WIKI-040 · measuredcomposite_problems… 4 calls …allREQ-DDB-WIKI-054 · inferred
Also reaches 10 requirements

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

  • REQ-DDB-CONFIG-001 measured
  • REQ-DDB-CONFIG-003 measured
  • REQ-DDB-GUARD-012 inferred
  • REQ-DDB-GUARD-024 inferred
  • REQ-DDB-GUARD-027 measured
  • REQ-DDB-SCHEMA-006 measured
  • REQ-DDB-SCHEMA-015 measured
  • REQ-DDB-WIKI-015 measured
  • REQ-DDB-WIKI-040 measured
  • REQ-DDB-WIKI-054 inferred
clew Generated by clew wiki from the repository's index