WIP: test(game): four game-side checks that fail only on Windows pass there: whole paths, and a file system that folds case #2845
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/mods
area/renderer
area/saves
area/tooling
area/upscaling
beanstalk: approved
beanstalk: failed
beanstalk: needs approval
beanstalk: running
beanstalk: tested
ci: approved
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
regression
risk
high
risk
low
risk
medium
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
ci: approved
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!2845
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/mod-api-win-game-test-fixtures"
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?
Summary
For #2822 (into
mod-api). Four checks on the game side fail only on Windows. In each case the code is right and the test's fixture assumes Unix:longshot-gamemod_tests::tests::a_folder_of_mods_tests_each_of_its_folders: the plan joins a suite's folder withPath::join(/t/suite\hudon Windows), and the test wrote the expected folders out (/t/suite/hud). The expected value is now joined the same way.longshot-gameruntime::tests::a_separate_mod_moves_the_saves_into_its_profile_and_records_itanda_mods_profile_sits_inside_the_launchers_save_folder: they rooted the user and launcher folders at/uand/profiles/two. Windows takes those as rooted but not whole, so the profile's folder, made whole bysaves_inwithstd::path::absolute, took the current drive (C:\u\…) and the comparisons failed. They start from a whole path on each system now (whole(): as it is on Unix, underC:\on Windows).modtoolemulators::tests::eden_and_ryujinx_mods_are_found_with_their_switches: it writes Eden's title-id folder in lower case and in capitals. That is two folders on Linux, but one on Windows and macOS, whose file systems fold case, and there that folder's mods come by name. The test now reads which one the file system gave, expects that order, and finds Speed and Grass by name, not by place.No code the game runs changes. Every assertion stays, among them
a_mods_profile_sits_inside_the_launchers_save_folder's check that a mod's profile sits inside the launcher'ssave/subtree, the one the sandbox grants.To see it on
mod-api: on Windows,cargo test -p longshot-game --libandcargo test -p modtool --lib emulators(--target x86_64-pc-windows-gnullvmwith llvm-mingw).Testing
Tested: the four checks, on Windows 11 (
--target x86_64-pc-windows-gnullvmwith llvm-mingw) and on Linux (WSL Ubuntu 24.04). The change is test code only, so there is nothing new for the game to run. Every game run in this PR's series used builds that included this code unchanged.Checks:
mod-api@c5e5b676, Windows:longshot-game --lib165 pass, these three fail.modtoolfailseden_and_ryujinx_mods_are_found_with_their_switches(left: [Grass, Speed, Hud],right: [Speed, Grass, Hud]).longshot-game --lib168 pass, 0 fail.modtool'seden_and_ryujinx_mods_are_found_with_their_switchespasses.cargo test):mod_tests::…a_folder_of_mods_tests_each_of_its_foldersand theruntimetests (5) pass, and so doesmodtool'seden_and_ryujinx_mods_are_found_with_their_switches(two folders there: the capitals-first order).saves_inchanged to put the mod's profile outsidesave/(b.join(folder), undone after),a_mods_profile_sits_inside_the_launchers_save_folderfails on Windows (left: C:\profiles\two\a~rando,right: …\save\.profiles\a~rando).cargo fmt --check,cargo clippy -p longshot-game -p modtool --all-targets --no-deps -- -D warnings(Windows target) andmise run lintpass.Still to test:
cargo test -p modtool --lib emulators(its file system folds case, as Windows' does)Measurements
Verdict: fixed. The four checks pass on Windows and still pass on Linux.
Baseline:
mod-api(#2822's head), the branch this PR goes into. Nothing to time: test code only.c5e5b6767332362d9cargo test -p longshot-game --lib, Windowsmodtooleden_and_ryujinx_mods_are_found_with_their_switches, WindowsRisks
The sandbox: not touched; no code the game runs changes. The test that checks a mod's profile sits inside the launcher's granted
save/subtree keeps that assertion, and still fails when the profile is put outside it (above).On a file system that folds case, the emulators test no longer checks that a title id in capitals sorts first: there it is the same folder. Linux, where it is two folders, still checks it. A revert is enough.
Checklist
Ready for review
mod-api(#2822's head); the title is a Conventional Commit.mise run testpasses (any failure that also fails onmainis named). (The checks this change reaches pass, as above.mod-api's whole suite has failures on Windows that this PR doesn't change: #2826 fixes six of them.)main, or Measurements says why there is nothing to measure.third_party/untouched; nothing GPL-incompatible.When it applies
mainand passes here. (Not a fix of the game: the four tests themselves fail onmod-apion Windows and pass here.)Assisted-by:/Co-Authored-By:trailers.Ready to merge
main, measured again or a comment says why the numbers still hold.🤖 Generated with Claude Code
18c277e8ba266fea0a6bRebased onto
mod-api@537c2816(#2848, game-free checks' fixtures only), now266fea0a: the same diff (samegit patch-id), no conflict. #2848 touches none of this PR's files, so its checks still hold.266fea0a6b7221182d7cRebased onto mod-api
aea64d3a(#2745 nav.closest, one new commit):266fea0a->7221182d, the same diff (git patch-id unchanged), so the checks and runs above still hold; none of this PR's files changed on mod-api. The description's head hash is updated.7221182d7cd037060296Rebased onto the new
mod-apicb37f5ab(#2851 native mouse camera, #2852 modding docs), which touch none of this PR's files: the same patch (same patch-id), headd0370602.d037060296be13c3919cRebased onto mod-api @
12f42db5(#2855 rustfmt of nav.closest, #2861 menu rows by place): headd03706029->be13c3919, the same diff (patch-id unchanged); neither commit touches this PR's files.be13c3919c9ac51e8ce2Rebased onto mod-api @
75bcd270(#2881 a mod adds a game language): headbe13c3919->9ac51e8ce, the same diff (patch-id unchanged); #2881 touches none of this PR's files.9ac51e8ce2fd71fa754bRebased onto mod-api
af3e4d40(5 new commits on75bcd270): headfd71fa754, the same diff (patch-id unchanged). The new mod-api commits touch none of this PR's files.fd71fa754b24b65c94f1Rebased onto mod-api
716735d8(6 new commits on top ofaf3e4d40): headfd71fa754->24b65c94f, the same diff (git patch-id unchanged). The new mod-api touches files near this PR; its checks are to be rerun on this head.24b65c94f1d177ed3481Rebased onto mod-api
5780eeda(one new commit on716735d8, the reverse-engineering tools for hook sites): head24b65c94f->d177ed348, the same diff (git patch-id unchanged). The new mod-api commit touches files near this PR (the builder crates, Cargo, CI); its checks are to be rerun on this head before it leaves WIP.d177ed3481ee0ac29cefRebased onto mod-api
65148a78(one new commit, photo-mode and effects APIs), now atee0ac29ce: the same diff (git patch-id unchanged). Checks not rerun on this PC.ee0ac29cefbe82c33fd3Rebased onto the re-squashed
mod-api041890bb(it now carries main up to #2926 and #2884): only this PR's own commits moved withgit rebase --onto, the diff unchanged (samegit patch-id). Headbe82c33fd(wasee0ac29ce). Checks not rerun here: CI on the new head.be82c33fd37332362d91Rebased onto mod-api
5740a5df(two new commits on041890bb: actors.pose/freeze, and #2902's pool-flag sites in the owners table): headbe82c33fd->7332362d9, the same diff (git patch-id unchanged). Checks not rerun on this PC: CI on the new head.Closing in favour of #2938: one pull request into
mod-apiwith every fix a Windows test of it found, as asked. This PR's commits are there, rebased ontomod-api@5740a5dfand checked again there on Windows (in the game, confined, and every game-free check) and Linux; its description lists this one.Pull request closed