Skip to content
Closed
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: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ checked before anything else; a PR that does not meet them waits (or is closed a
3. **A PR that changes the runtime** (`crates/xcl/src` outside tests) **has a regression run on a real
title**: `scripts/smoke.ps1 -Game <your game folder>` built from `main` and built from the PR's head
commit, both `xcl-smoke` blocks pasted under **Regression run**, of the same title for the same
time. The PR's block must name its head commit with no uncommitted changes (rerun it after every
push); the other must be made on a commit of `main`. The PR's run must show no device removal and
time. Both runs need clean checkouts. The PR's block must name its head commit (rerun it after every
push), and the other must name a commit of `main`. The PR's run must show no device removal and
no crash (the `main` run may: a PR that fixes a crash shows it there), at least 80 % of `main`'s
frames and at most 125 % of its peak commit. A run on a title that does not reach the code the PR
changes still counts as a regression check; say what it does not cover under **Not tested**.
Expand Down
6 changes: 3 additions & 3 deletions scripts/pr_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,10 @@ def check(body, head, files, is_main_ancestor, *, test_only=False):
if not clean:
problems.append(f"the PR changes the runtime: **Regression run** needs an `xcl-smoke` block made on this PR's "
f"head commit {head[:12]} with no uncommitted changes (rerun scripts/smoke.ps1 after every push)")
main = [b for b in base if is_main_ancestor(b["commit"].split()[0])]
main = [b for b in base if "uncommitted" not in b["commit"] and is_main_ancestor(b["commit"].split()[0])]
if not main:
problems.append("**Regression run** needs an `xcl-smoke` block made on a commit of main (not the PR's), "
"with the same title and time as the PR's")
problems.append("**Regression run** needs an `xcl-smoke` block from a clean checkout of main, "
"using the same title and time as the PR's")
if clean:
pr = clean[-1]
for key in ("device removals", "crashes"):
Expand Down
14 changes: 14 additions & 0 deletions scripts/test_pr_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,20 @@ def test_test_paths_do_not_need_approval(self):


class SmokeBlockTests(unittest.TestCase):
def test_main_baseline_must_have_no_uncommitted_changes(self):
baseline = "xcl-smoke v1\ncommit: 1111111aaaa{}\ntitle: G\nseconds: 60\n"
head = "xcl-smoke v1\ncommit: 1234567890\ntitle: G\nseconds: 60\n"
files = [changed("crates/xcl/src/hle/d3d12x/vram.rs")]
is_main_ancestor = lambda sha: sha == "1111111aaaa"

dirty = baseline.format(" (uncommitted changes)")
problems = check(BODY + dirty + head, HEAD, files, is_main_ancestor)
self.assertEqual(1, len(problems), problems)
self.assertIn("clean checkout of main", problems[0])

clean = baseline.format("")
self.assertEqual([], check(BODY + dirty + clean + head, HEAD, files, is_main_ancestor))

def test_two_blocks_in_one_fence_are_two_blocks(self):
body = ("```\nxcl-smoke v1\ncommit: 1111111aaaa\ntitle: G\nseconds: 60\n\n"
"xcl-smoke v1\ncommit: 1234567890\ntitle: G\nseconds: 60\n```\n")
Expand Down
Loading