Allow new reports while preserving legacy source and PDF checks
Beffroi Reporting CI All checks passed and encrypted report archives were built.
Beffroi/beffroi-reporting/pipeline/head This commit looks good Details

This commit is contained in:
Dandaedre 2026-09-24 16:46:24 +02:00
parent 328a85261c
commit c268124157
Signed by: Dandaedre
GPG Key ID: 440C6592E8A26D99
2 changed files with 10 additions and 4 deletions

View File

@ -92,8 +92,9 @@ def main():
for category, documents in EXPECTED.items():
folder = build / category / "pdfs" if category == "reports" else build / category
actual = {path.stem: path for path in folder.glob("*.pdf")}
if set(actual) != set(documents):
print(f"{category}: PDF set differs from the original", file=sys.stderr)
missing = set(documents) - set(actual)
if missing:
print(f"{category}: missing original PDFs: {', '.join(sorted(missing))}", file=sys.stderr)
return 1
for name, (wanted_pages, wanted_text) in documents.items():
pdf = actual[name]

View File

@ -10,8 +10,13 @@ ROOT = Path(__file__).resolve().parents[2]
class SourceTests(unittest.TestCase):
def test_stored_sources_have_expected_sets(self):
self.assertEqual(len(list((ROOT / "reports/reports").glob("*.yaml"))), 7)
self.assertEqual(len(list((ROOT / "reports/diagnostics").glob("*.json"))), 10)
manifest = json.loads((ROOT / "reports/docs/legacy-source-manifest.json").read_text())
for entry in manifest["files"]:
if not (entry["destination"] or "").startswith(("reports/", "diagnostics/")):
continue
path = ROOT / "reports" / entry["destination"]
with self.subTest(source=entry["destination"]):
self.assertTrue(path.is_file(), f"Missing preserved source: {path}")
for path in (ROOT / "reports/diagnostics").glob("*.json"):
document = json.loads(path.read_text())
self.assertEqual(document["report_type"], "windows_system_maintenance")