fix(tests): the game-free checks pass on Windows #255
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/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
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!255
Loading…
Reference in a new issue
No description provided.
Delete branch "Yeetbot90/Longshot:fix/windows-game-free-checks"
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
The game-free checks (
python -I -B tests/run_all.py) fail four tests on Windows, so a contributor there can't get a clean run before opening a pull request. The causes are text-mode newlines, POSIX-only fixtures and a stale menu translation. One of them is a real bug inscripts/check_third_party.py.What changed
scripts/check_third_party.py: paths go togit check-ignore --stdinNUL-separated (-z). In text mode on Windows each line ended\r\n, so git looked up<path>\r, which no rule ignores. An ignored build file (a.dllin a part) was then hashed into the part, and the part "differed from its note". The repository's ownthird_party/passes today only because no ignored file sits in a part.tests/test_release.py:SHA256SUMSis the served bytes.write_textwrote\r\non Windows, so the signature never matched..cmdthat hands its arguments to Python (Windows runs no#!/bin/shscript: WinError 193). Following monsterlag's review, the.cmdis ASCII. It reads Python's and the script's paths from the environment, whichcmd.exekeeps as Unicode, and the stub prints UTF-8, as git-cliff does.cliff_stub()builds it for both tests.test_the_git_cliff_stand_in_runs_from_a_unicode_path, runs it from a folder with an accented letter.nx2/test_nup_paths.py: onefile_linkhelper. Where Windows refuses a file symbolic link (WinError 1314, no Developer Mode), those 5 tests skip: without the privilege nobody can plant such a link. Anywhere else, the error still fails the test.gpu/vk/menu_i18n.h: the 13 translations of the Debug tab's "Testing tools..." row follow main's English text, which gained "and damage" (tests/test_menu_i18n.py).Flags and settings
None.
Measurements
main:
d9648863(2026-11-13)this PR: fix/windows-game-free-checks @
01943afaHardware: Windows 11 Pro (26200), Python 3.14, llvm-mingw 20261104, Git for Windows (
core.autocrlf=true)Scene: no game: the game-free suite,
python -I -B tests/run_all.py, 24 at onceMethod: one run of the whole suite on each side, back to back (main
d9648863, then this PR). The results are pass/fail and the same on every run. Also one earlier run of this PR ate62e488a, before the stand-in's Unicode fix, with the same counts.How to reproduce: on Windows with
LONGSHOT_MINGWset (docs/development.md), check out each commit and runpython -I -B tests/run_all.pyd964886301943afaTesting
Tested:
01943afa.tests/test_release.pyalone, with TEMP and TMP set to a folder with accented letters: 29 OK.Bump.test_the_first_notes_give_git_cliff_no_rangefailed there, as the review found.Not tested:
-z, whichgit check-ignorehas had since 1.8, and the stand-in, which is still the#!/bin/shone there.Needs other testers: None. CI's Linux Python source checks run the suite once a maintainer approves the run.
Screenshots
Nothing on screen.
Risk and rollback
Small: the only change outside the tests is how
check_third_party.pypasses paths to git. With Developer Mode on, the 5 symbolic-link tests run as before. Reverting the commits is enough.Reviewer notes
Start with
scripts/check_third_party.py(one line), thencliff_stub()intests/test_release.py.Issues
See #252, whose game-free run on Windows had these four failures.
Checklist
For everyone
type(scope): description).main. (maind9648863merged in.)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.tests/that reads changed source updated in this PR, not weakened.mainand passing here.check_third_party.py gave git check-ignore its paths one per line in text mode; on Windows each line ends "\r\n", git looks up "<path>\r", and an ignored build file was hashed into the part. The paths go NUL-separated (-z). test_release.py signed a SHA256SUMS written in text mode ("\r\n" on Windows) but served the "\n" bytes, and ran a #!/bin/sh git-cliff stub; it writes the bytes it serves, and on Windows the stub is a .cmd that hands its arguments to Python. test_nup_paths.py's file-link fixtures skip, as the directory ones fall back to junctions, where Windows refuses a file symbolic link (WinError 1314: no Developer Mode).Tested head
50f22d96edon native Windows 11, Python 3.14.7, llvm-mingw 20261104, with the SDK and OpenSSL available. The three affected check groups pass; the complete suite reports 496 passed, 0 failed, 33 skipped in 142 seconds. The checkout also contained the ignored SDL DLLs from the documented development setup.Two changes are needed before this is ready:
[P2] The Windows git-cliff stand-in still fails from a Unicode temporary path (tests/test_release.py:225). Setting TEMP and TMP to a directory containing an accented character, then running
python -I -B tests/test_release.py Bump.test_the_first_notes_give_git_cliff_no_range, fails because cmd.exe reads the UTF-8 bytes embedded in the batch file using its current code page. The Python interpreter starts, but receives a corrupted path to git-cliff-stub.py and cannot open it. Keep the batch source ASCII and pass its Python/script paths through Unicode environment values, or use another argv probe that preserves these paths. Please retain a focused test of this case as well as both existing range assertions.[P2] The ready description does not pass the project's required PR-description check.
python -I scripts/forge.py pr status 255reports five missing sections: Why, Measurements, Testing, Risk and rollback, and the complete Checklist. Please migrate the existing useful explanation into the current template, name the main and PR commits in Measurements, include Tested / Not tested / Needs other testers, and settle the checklist against this diff. Flags and settings can be None. This is a contribution-workflow blocker, separate from the code results above.No game build or gameplay test was needed for these three tooling/fixture changes. I did not exercise the WinError 1314 skip path because this Windows account can create the file-link fixtures; the NUP path tests ran without that privilege skip here.
@ -223,0 +222,4 @@if os.name == "nt": # (Windows runs no #! script: a .cmd hands its arguments to Python, which prints them)(self.dir / "git-cliff-stub.py").write_text("import sys\nfor a in sys.argv[1:]: print(a)\n", encoding="utf-8")stub = self.dir / "git-cliff-stub.cmd"stub.write_text('@"%s" -I "%s" %%*\n' % (sys.executable, self.dir / "git-cliff-stub.py"), encoding="utf-8")This UTF-8 batch source embeds absolute paths, but cmd.exe decodes them with its current code page. The focused Bump.test_the_first_notes_give_git_cliff_no_range fails when TEMP/TMP contains an accented character: Python receives a corrupted path to git-cliff-stub.py. Please preserve Unicode paths in the stand-in and add that focused case; the normal-path full suite passed here.
Thanks for testing it. At
01943afa, with maind9648863merged in:elease.notes could not decode it. cliff_stub() builds it for both tests. A new focused test, est_the_git_cliff_stand_in_runs_from_a_unicode_path, runs it from a folder with an accented letter, and both range assertions are kept. With TEMP and TMP under an accented folder, Bump.test_the_first_notes_give_git_cliff_no_range failed before the fix and passes now, and so does the whole of ests/test_release.py (29 OK).
d9648863: 462 passed, 4 failed; this PR @01943afa: 466 passed, 0 failed), Tested / Not tested / Needs other testers, Risk and rollback, and the checklist settled against the diff. Flags and settings: None. scripts/check_pr_description.py --file passes it here.I also merged main in, because it had moved on.
Approved follow-up head
01943afaafter independently reproducing and verifying the Unicode-path repair on native Windows Python 3.14.7.The original head
50f22d96still fails Bump.test_the_first_notes_give_git_cliff_no_range under TEMP/TMP containing Zoë. The follow-up passes. Two sequential interleaved old/fixed pairs gave exit 1/0, then 1/0 (median failing cases 1 -> 0). The complete release file also gave 28 cases with 1 error on the old head versus all 29 passing on the follow-up, in two runs each; those longer runs overlapped, so their durations are not a timing comparison. The new Unicode regression passes in both complete-file runs.The three other affected groups (third-party provenance, NUP paths and menu translations) all pass at this head. The description now has the required sections; the 13 expanded help translations include the damage-reset meaning. My previous blocking Unicode-path and missing-template findings are resolved. The ASCII .cmd plus Unicode environment variables and explicit UTF-8 Python output address the demonstrated input and output encoding failures.
Please incorporate these two focused interleaved pairs in Measurements: its checked two-pair box currently describes only one whole-suite pair. No performance improvement is claimed. I did not repeat the full Longshot suite at this head; my earlier 496-pass full run was on
50f22d96, and your current-head full run is separately recorded. My account can create symbolic links, so the privilege-denied NUP skip branch still has only your reported coverage.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.