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 "llun/Longshot: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.c5e5b67618c277e8cargo 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: #2825 and #2826 fix eight 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
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.