diff --git a/tests/unit/test_results.py b/tests/unit/test_results.py index b52cd82..9da1aff 100644 --- a/tests/unit/test_results.py +++ b/tests/unit/test_results.py @@ -322,6 +322,8 @@ def test_cap_intent_blank_when_not_capped_on_na(): def test_build_results_threads_expected_na(tmp_path): + # Mirrors custom-html-tiny post-change: install + a passing functional (custom) test, but no + # backup surface (backup_restore declared intentionally N/A). recs = [ { "tier": "install", @@ -329,7 +331,14 @@ def test_build_results_threads_expected_na(tmp_path): "file": "g/test_install.py", "rc": 0, "junit": _write(tmp_path, "i.xml", JUNIT_PASS), - } + }, + { + "tier": "custom", + "source": "cc-ci", + "file": "c/test_serves_content.py", + "rc": 0, + "junit": _write(tmp_path, "c.xml", JUNIT_PASS), + }, ] data = R.build_results( recipe="custom-html-tiny", @@ -337,7 +346,7 @@ def test_build_results_threads_expected_na(tmp_path): pr="0", ref=None, records=recs, - results=_results(backup="skip", restore="skip", custom="skip"), + results=_results(backup="skip", restore="skip"), # custom=pass (default) → functional pass backup_capable=False, # no backupbot label → backup_restore N/A declared=[], deps_ready=True, @@ -347,12 +356,14 @@ def test_build_results_threads_expected_na(tmp_path): finished_ts=0.0, expected_na={"backup_restore": "stateless static file server"}, ) - # N/A still caps at L2 (never inflates), but now annotated intentional rather than flagged. + # backup_restore N/A still caps at L2 (never inflates) — even though functional passes above it, + # the gap caps the climb — but the cap is now annotated intentional rather than flagged. assert data["level"] == 2 assert "L3" in data["level_cap_reason"] assert data["level_cap_intent"] == "intentional · stateless static file server" assert data["na"]["rungs"]["backup_restore"]["intent"] == "declared" - assert data["na"]["gaps"] == [] + assert data["rungs"]["functional"] == "pass" + assert data["na"]["gaps"] == [] # functional now covered; backup_restore declared → no gaps def test_write_results_roundtrip(tmp_path):