test(scanner): parameterize heal evidence oracles (#7346)

Allow the scanner/heal release evidence e2e helper to bind the active case identity and oracle file through an explicit descriptor instead of hard-coding the background target restart artifact. Extend the checker self-test so a single run can finish multiple registry-declared oracles while release gates remain pending until every required lane is complete.

Co-authored-by: zhi22915 <qiuzgang@gmail.com>
This commit is contained in:
houseme
2026-09-07 12:53:54 +08:00
committed by GitHub
parent bffdf0809f
commit c04cd089e9
2 changed files with 67 additions and 10 deletions
+23
View File
@@ -1309,6 +1309,29 @@ class SelfTests(unittest.TestCase):
self.assertIn("alternate-target-restart.json", read_json(run_dir / "execution.json")["artifacts"])
self.assertEqual(check_scanner_heal_evidence(root, run_dir, "alternate-target-restart"), [])
def test_scanner_heal_release_consumes_multiple_registry_oracles(self) -> None:
with tempfile.TemporaryDirectory() as tmp:
root, run_dir = self.scanner_heal_fixture(Path(tmp))
registry = read_json(root / ".config/scanner-heal-required-tests.json")
alternate = dict(registry["cases"]["background-target-restart"])
alternate["oracle"] = "alternate-target-restart.json"
registry["cases"]["alternate-target-restart"] = alternate
write_json(root / ".config/scanner-heal-required-tests.json", registry)
oracle = read_json(run_dir / "background-target-restart.json")
oracle["case"] = "alternate-target-restart"
write_json(run_dir / "alternate-target-restart.json", oracle)
(run_dir / "execution.json").unlink()
finish_scanner_heal_receipt(run_dir, 0, root)
artifacts = read_json(run_dir / "execution.json")["artifacts"]
self.assertIn("background-target-restart.json", artifacts)
self.assertIn("alternate-target-restart.json", artifacts)
self.assertEqual(check_scanner_heal_evidence(root, run_dir, "alternate-target-restart"), [])
errors = check_scanner_heal_evidence(root, run_dir, "release")
self.assertEqual(len(errors), 21)
self.assertTrue(all(error.startswith("pending ") for error in errors))
def test_scanner_heal_rejects_broken_execution_and_artifacts(self) -> None:
for fault in ("exit", "missing", "zero", "skipped", "failed", "retry", "filtered", "ignored", "stale",
"hash", "binary", "synthetic", "wrong-run", "same-pid", "body", "parts", "listing", "topology"):