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
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:
parent
328a85261c
commit
c268124157
|
|
@ -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]
|
||||
|
|
|
|||
|
|
@ -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")
|
||||
|
|
|
|||
Loading…
Reference in New Issue