diff --git a/scripts/check-legacy-parity.py b/scripts/check-legacy-parity.py index 74b2ae0..6bf8d3e 100644 --- a/scripts/check-legacy-parity.py +++ b/scripts/check-legacy-parity.py @@ -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] diff --git a/scripts/tests/test_sources.py b/scripts/tests/test_sources.py index 1cf4fa4..ac220c3 100644 --- a/scripts/tests/test_sources.py +++ b/scripts/tests/test_sources.py @@ -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")