Tests: unit tests for scripts/pr_check.py, run when it changes #592
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/597"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from ivall/xcl. Originally posted by Kaairim on 2026-11-24T02:19:27Z.
scripts/pr_check.pyis the merge gate, has no tests, and several open PRs change it (#536, #527, #513, #507, #497). These unit tests pin its current rules so a change to it shows what it changes. They callcheck()directly with a fakeis_main_ancestor: no GitHub, no git. A small workflow runs them when the checker or its tests change.What is in it
scripts/test_pr_check.py: 23 tests – sections, refused models (only inside AI use), game data and binaries (tests/data limit), what counts as runtime, and the regression-run rules: head and main blocks, uncommitted runs, device removals / crashes, killed runs, same title and time, the 80 % frames and 125 % peak-commit limits on both sides.github/workflows/scripts.yml:python3 -m unittest discover -s scripts -p "test_*.py"on pushes to main and PRs touching those filesTested
python -m unittest discover -s scripts -p "test_*.py" -v: 23 passed, 0 failedNot tested
AI use
Improvements by William "kaairim" Deivid (wdcore).
🤖 Generated with Claude Code
Imported from ivall/xcl. Originally posted by anes66 on 2026-11-24T03:59:05Z.
Verified
c28f5cff119bf9f6938fc2631b19d0a7bafd8e22on Windows 10 Pro (build 19045), Ryzen 7 9800X3D, Python 3.11.4.Tested
python -m unittest discover -s scripts -p "test_*.py" -v: 23 passed, 0 failed, 0 errors, 0 skipped.f4ce27ceb6d1b0576d0c659b713b674778bf1968.test_only=Truewaives smoke while preserving the section, game-data and model checks.The newer
test_onlyparameter is not covered by this PR's suite. When rebasing, it would be useful to add permanent tests showing that the waiver applies only to smoke checks. The probes above were external checks, not additions to the PR.Not tested
GitHub Actions on Ubuntu, the Rust workspace, GPU tests or retail titles.
AI use
Codex (GPT-6; exact variant unavailable) inspected the changes, wrote and ran the external verification harness, and drafted this report.
Integration follow-up
Main
f4ce27calready contains threeTestOnlyApprovalTestsinscripts/test_pr_check.py; this PR currently has an add/add conflict on that path. My earlier coverage suggestion concerns the PR snapshot, not missing coverage on main.I tested a main-based layout that keeps main's file unchanged and puts this PR's 23 tests in
scripts/test_pr_check_rules.py. Updating both path filters inscripts.ymltoscripts/test_pr_check*.pylets discovery run all 26 tests: 26 passed, 0 failed. This preserves the existing approval checks without rewriting either test set. No checker/runtime changes are needed. This is a local integration proposal, not a merge or a second PR.Current-main integration available
511572f integrates this head onto
main b7aa9f3while retaining main's existingscripts/test_pr_check.py. Your 23 rule tests are inscripts/test_pr_check_rules.py; only the filename and the discovery command in its docstring change. Checker code and test assertions are unchanged.python -B -m unittest discover -s scripts -p 'test_pr_check*.py' -v: 36 passed / 0 failed (main's 13 plus these 23), Windows 10, CPython 3.11.4.The workflow uses that same discovery pattern and its path filters cover both test modules. Local YAML parsing checked both event filters and the read-only contents permission. The GitHub Actions job itself was not run.
An external in-memory mutation harness ran both suites against seven controlled changes: lower frame threshold, higher memory threshold, acceptance of dirty head runs/non-main baselines, checking removed assets, oversized fixtures, and unfilled templates. All seven produced assertion failures, with no test errors. The on-disk checker stayed unchanged. No Rust/GPU/title run for this test/workflow-only integration.
AI use: Codex (GPT-6; exact variant unavailable) resolved the integration, checked discovery and the workflow, ran the mutation probes, and prepared this update. Your original commit remains in the merge history.
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T13:06:59Z.
Verification on RTX 3060 Ti (Windows 11): merge conflict with current
main— needs a rebase before it can be tested.upstream-sync referenced this pull request2026-11-25 16:10:51 +00:00
Imported from ivall/xcl. Originally posted by github-actions[bot] on 2026-11-29T07:43:18Z.
Nothing has happened on this PR for 3 days, so it is marked
staleand will be closed in 4 days. A push or a comment takes the mark off: rebase it ontomainif it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T03:47:17Z.
Triage (#1607) – head
c28f5cfMain has had its own
scripts/test_pr_check.pysinceb74867b(test-only approval tests), so this PR's new file of the same name conflicts. Its cases need to be merged into main's file. #1019 also runsscripts/test_*.pyin CI, as a step in ci.yml, while this PR adds a separate path-filtered workflow. Only one of the two CI hooks is needed.The asserted message fragments (
fewer frames,more memory,same title,commit of main) still exist in main's pr_check.py. The tests were not run here.Recommendation: keep open.
AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.