feat(tests): run_all.py --changed runs the checks that read what changed #32
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/renderer
area/saves
area/upscaling
good first issue
gpu/amd
gpu/igpu
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
needs measurements
platform/linux
platform/macos
platform/steam-deck
platform/windows
preview
priority
critical
priority
high
priority
low
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
testing wanted
ci: approved
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!32
Loading…
Reference in a new issue
No description provided.
Delete branch "dyst/Longshot:feat/run-all-changed"
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?
Why
A full
tests/run_all.pyis about 490 checks and several minutes, and the ones an edit touches had to be picked by hand, which is how a check that cuts a function far from the edit gets missed (AGENTS.md: "Tests read the source").What changed
tests/run_all.py --changed [BASE]:changed_filestakes the files changed since BASE's merge base with HEAD (origin/mainby default), committed or not, plus the untracked ones, from git.reads_changedpicks:import chunks,from chunks import);.pyundertests/that is not a test changed.--changed, the C++ unit tests run only when something undergpu/changed or every check runs. It prints how many files changed and how many checks read them, and that a pull request still needs the whole run.--changedcan't be combined with names or--write-times. Nothing else in the runner changes.--changedtakes main on the remote that points at Longshot (forge/mainwherescripts/forge.pyadded it, as CONTRIBUTING.md has it), elseorigin/main(default_base): in a clone carried over from Hookshot,originis GitHub (the second commit).tests/test_run_all_changed.py(new): which checks a changed file picks (by path, by name and not inside a longer name, by import), that a changed check runs itself, that the runner or a shared test file runs everything, that an unnamed file runs none, and the files from git (committed, uncommitted and untracked), with git's answers stood in; and the default base in three remote layouts (it fails with the old default).Example, on the GitHub branch (the runner changed):
--changed: 2 files changed since origin/main, every check (the runner or a shared test file changed). For a change tonx2/chunks.pyalone it picks the chunk, emit and lift-cache checks (under a quarter of all), not the renderer's.Flags and settings
None: no environment switch, menu row or ini key. The new
tests/run_all.py --changed [BASE]option is the test runner's, described above.Measurements
main:
000f19fb(2026-11-13)this PR: feat/run-all-changed @ f0982a1e
Hardware: Ryzen 9 3900X, 64 GB, Windows 11 (RTX 3080; no game run: these are game-free checks)
Scene: none: game-free. A one-line change to
nx2/chunks.py(a comment, uncommitted), checkedMethod: two interleaved rounds (main, PR, main, PR), each run with the PC otherwise quiet and the bench lock held. main: the whole suite, the only run it has (
run_all.py --jobs 12). This PR:run_all.py --jobs 12 --changed HEAD(the branch's own commits as the base, so only the edit counts; with this branch against main the runner itself changed, and--changedruns every check, as it should). Times by the script's clockHow to reproduce: append a comment line to
nx2/chunks.py, thenpython -I -B tests/run_all.py --changed HEAD; againstpython -I -B tests/run_all.py000f19fbThe 9:
test_chunk_split,test_chunks_save_folder,test_lift_cache,test_mark_groups,test_parallel_emit,test_spawn_emit,test_stale_hot_pieces,test_camera_speedandtest_run_all_changed(which namesnx2/chunks.py), with the byte-compile check. The failure both times istest_spawn_emit, which fails the same way on main (it is one of main's five).Rebased since onto main
0c74253d: its four commits since000f19fbare #177 (a log line's level, in the renderer's logging), #192, #193 and #194 (the README, the website, the Discord status), none in the runner or the checks measured here, so the numbers hold.Testing
Tested: the runs above;
tests/run_all.py, the whole suite, on this branch and on main0c74253d, Windows (483 passed and 6 failed on main, 484 passed and 6 failed here, no failure main doesn't have: test_check_third_party, test_display_pointer, test_fpx_sticky, test_release, test_spawn_emit and test_texture_staging_publication fail on main too (the last since #177; #202 fixes it));tests/test_run_all_changed.py(8 cases, the default base's with the old default put back: it fails).Not tested: on Linux (the runner's
--changedis git and Python only); a check that reads a changed file without naming it (by path, name or import) is left out of a--changedrun by design, which is why it says a pull request still needs the whole run.Needs other testers: None
Screenshots
Nothing on screen.
Risk and rollback
Only
--changedpicks checks; a run without it is unchanged. A check that reads a file without naming it (by path, name or import) would be left out of a--changedrun, which is why it says a pull request still needs the whole run. Reverting the two commits is enough.Reviewer notes
Carried over from https://github.com/NotRexed/Hookshot/pull/2887 with the move to Longshot; the second commit makes the default base Longshot's main. The dev-loop proposal's D1 (https://github.com/NotRexed/Hookshot/pull/2636).
Issues
None on Longshot. See https://github.com/NotRexed/Hookshot/pull/2636 (D1).
Checklist
For everyone
type(scope): description).main.python -I -B tests/run_all.pyrun and passing (any failure that also fails onmainis named above).third_party/untouched (a new folder with aPROVENANCE.mdinstead).If applicable
Assisted-by:/Co-Authored-By:trailers.mainand passing here.🤖 Generated with Claude Code
feat(tests): run_all.py --changed runs the checks that read what changedto WIP: feat(tests): run_all.py --changed runs the checks that read what changedBack to WIP under #48's process: this was carried over before the new template. Its description will be brought to the template and measured on Longshot (main against this PR, at named commits) when it's wanted for review; ask here if you'd like it sooner.
Description brought to Longshot's PR template (#48). Still WIP: its numbers are from the GitHub version, and it isn't rebased on current main; it gets measured on Longshot (main against this PR, at named commits) before it is marked ready.
Description moved to the template's Testing section and whole checklist (#72): what was tested, what wasn't, and what needs other testers (their test requests to open while this is WIP).
The description follows the template after #76 and #106: If applicable keeps only the boxes that apply (one that applies and isn't done yet stays unticked while this is WIP), the Flags table has the template's seven columns (Goal is now Recommendation), and GitHub references are full URLs. Nothing else changed.
b1936abba751dca071a9Rebased onto main
0c74253d, and a second commit: with no BASE, --changed takes main on the remote that points at Longshot (forge/main as forge.py adds it), not origin/main, which is GitHub in a clone carried over from Hookshot. Measured on Longshot: a one-line change to nx2/chunks.py runs 9 checks in 17.8 s against the whole suite's 521 in 201.1 s (medians of 2). Whole suite on this head and on main: no failure main doesn't have. Ready for review.WIP: feat(tests): run_all.py --changed runs the checks that read what changedto feat(tests): run_all.py --changed runs the checks that read what changedView command line instructions
Checkout
From your project repository, check out a new branch and test the changes.