Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion scripts/pr_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
18 changes: 18 additions & 0 deletions scripts/test_pr_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
Loading