test: representative expected_na scenario (functional covered, backup declared-N/A)
Some checks failed
continuous-integration/drone/push Build is failing

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
autonomic-bot
2026-06-09 02:00:16 +00:00
parent 3b0a3d14ea
commit f3a1ad5388

View File

@ -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):