diff --git a/scripts/validate_pr.py b/scripts/validate_pr.py index e3050f83c..59bd1c45a 100644 --- a/scripts/validate_pr.py +++ b/scripts/validate_pr.py @@ -847,7 +847,8 @@ def main() -> None: { "file": r.filepath, "passed": r.passed, - "outcome": r.outcome or "new", + # A file that failed, unread or refused, is not a new one. + "outcome": r.outcome or ("new" if r.passed else "failed"), "destination": r.destination, "sha1": r.sha1, "md5": r.md5, diff --git a/tests/test_validate_pr.py b/tests/test_validate_pr.py index 642420795..5f631cd1b 100644 --- a/tests/test_validate_pr.py +++ b/tests/test_validate_pr.py @@ -522,6 +522,15 @@ class FlagsAreAppliedOrRefused(unittest.TestCase): self.assertEqual(result.returncode, 2) self.assertIn("not allowed with", result.stderr) + def test_a_failed_file_is_not_reported_new(self): + """A path that does not exist came out as "outcome": "new", and a + reader listing new contributions announced a BIOS nobody sent.""" + import json # noqa: PLC0415 + + result = self._run("--json", "bios/nope.bin") + report = json.loads(result.stdout) + self.assertEqual([(r["passed"], r["outcome"]) for r in report], [(False, "failed")]) + class AFileOutsideBiosIsToldWhereToGo(unittest.TestCase):