diff --git a/scripts/pr_check.py b/scripts/pr_check.py index cb0ef3ef9e..913b32ab9f 100644 --- a/scripts/pr_check.py +++ b/scripts/pr_check.py @@ -155,7 +155,9 @@ def check(body, head, files, is_main_ancestor, *, test_only=False): problems.append("the main and PR regression runs are not of the same title for the same time") else: pf, mf = number(pr.get("frames shown")), number(m.get("frames shown")) - if mf and (pf is None or pf < FRAMES_KEPT * mf): + if mf == 0 and pf == 0: + problems.append("both regression runs show zero frames; rerun them with a title that presents frames") + elif mf and (pf is None or pf < FRAMES_KEPT * mf): problems.append(f"the PR's run shows fewer frames than main's ({pf} against {mf})") pc, mc = number(pr.get("peak commit")), number(m.get("peak commit")) if pc and mc and pc > COMMIT_GROWTH * mc: diff --git a/scripts/test_pr_check.py b/scripts/test_pr_check.py index 8cc45d5d06..644a72fbdd 100644 --- a/scripts/test_pr_check.py +++ b/scripts/test_pr_check.py @@ -102,6 +102,24 @@ def test_non_numeric_frames_shown_fails(self): self.assertIn("the PR's regression run (`xcl-smoke` block of commit 1234567890) " "has a non-numeric `frames shown`: many", problems) + def test_both_runs_with_zero_frames_fail(self): + baseline = "title: G\nseconds: 60\ndevice removals: 0\ncrashes: 0\n" + problems = self.smoke_problems( + baseline + "frames shown: 0 (PresentX 0)\n", + baseline + "frames shown: 0 (PresentX 0)\n", + ) + self.assertEqual( + ["both regression runs show zero frames; rerun them with a title that presents frames"], + problems, + ) + + def test_zero_baseline_allows_a_pr_that_presents_frames(self): + baseline = "title: G\nseconds: 60\ndevice removals: 0\ncrashes: 0\n" + self.assertEqual([], self.smoke_problems( + baseline + "frames shown: 0\n", + baseline + "frames shown: 100\n", + )) + class TemplatePlaceholderTests(unittest.TestCase): def test_untouched_pr_template_fails_all_required_sections(self):