Repository navigation
tests: the mod-pack alias test compares resolved names, as same_report_path does (TEST-MOD-PACK-ALIAS-MACOS) - #1412
Conversation
…t_path does (TEST-MOD-PACK-ALIAS-MACOS) tests/test_mod_pack_output_alias.py, added by ProjectLeonida#1057, fails on macOS and on Windows: test_alias_preflight_precedes_output_truncation ends in "AssertionError: ModsError not raised" for both of its cases. It passes on Linux. The macos-python job stops at the first failing file, so on macOS every test file after this one went unrun. The test replaces os.path.samefile with a function that compares the two paths as tempfile spelled them. report_paths.same_report_path hands samefile the names os.path.realpath gave it, and those are spelled differently where the temporary folder is reached through a link or a short name: /var/folders/... is /private/var/folders/... on macOS, and C:\Users\RUNNER~1\... is C:\Users\runneradmin\... on a Windows runner. The stand-in then never recognises the pair, and pack_mod writes the package. The stand-in now compares resolved names. tools/leonida_mods.py and tools/report_paths.py are right and unchanged. Measured with Python 3.12 on GitHub's runners (a scratch branch on a fork): the file as on main fails on macos-26 and windows-latest with those two failures and passes on ubuntu-24.04; with this change it passes on all three. Control on Linux: with TMPDIR pointing through a symbolic link, main's file fails the same way and this one passes. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
Reviewed 09970b7: test-only fix; ran the file with Recommendation: Merge |
|
Verified on native Windows at head Native Windows 10 Pro 19045, CPython 3.12, AI-assisted (Claude Code). |
|
Independent run on macOS. Apple M5 Pro, macOS 27.2.1 (26B131), Python 3.14.2. I merged With this change the standalone suite is fully green on this Mac for the first time: 513 run, 513 pass.
The cause on this machine is the one the description gives: Not tested: Windows and Linux. No game files used. AI-assisted. |
|
Verified independently on Note: #2175 (opened later) is the same fix for the same file. This one is earlier and also covers the Windows short-name spelling ( AI-assisted (verification only). |
|
Confirmed on an Apple M3 (macOS 26.5.1, Python 3.15.2): AI-assisted (Claude Code). No game data. |
|
I reproduced this on native Windows by putting AI-assisted testing. |
Claimed in the coordination issue as: TEST-MOD-PACK-ALIAS-MACOS (#14 (comment))
What and why
tests/test_mod_pack_output_alias.py, added by #1057 (onmainsincebe195981e), fails on macOS and on Windows.test_alias_preflight_precedes_output_truncationends inAssertionError: ModsError not raisedfor both of its cases. It passes on Linux.On macOS this is worse than one red file: the
macos-pythonjob stops at the first failing file, so every test file after this one goes unrun there. On Windows thecheckjob is cancelled at its time limit before it lists failed files (#1404), so nobody saw it there either.The fault is in the test, not in the tool. The test replaces
os.path.samefilewith a function that compares the two paths astempfilespelled them.report_paths.same_report_pathhandssamefilethe namesos.path.realpathgave it, and those are spelled differently where the temporary folder is reached through a link or a short name:tempfile.gettempdir()os.path.realpathof it/var/folders/…/T/private/var/folders/…/TC:\Users\RUNNER~1\AppData\Local\TempC:\Users\runneradmin\AppData\Local\Temp/tmp/tmpSo the stand-in never recognises the pair, and
pack_modgoes on to write the package. The stand-in now compares resolved names.tools/leonida_mods.pyandtools/report_paths.pyare right and unchanged; the claim's title says macOS because that is where I first saw it.Tested
Measured with Python 3.12 on GitHub's runners, from a scratch branch on my fork whose workflow ran only this (run 45511999132):
python -I tests/test_mod_pack_output_alias.pymacos-26windows-latestubuntu-24.04mainThe two failures are
ModsError not raisedforrelative='mod.json'andrelative='nested/notes.txt', the same as in themacos-pythonjob of a run ofmain3a0af1f15(run 45510568820).Locally, on Linux with Python 3.14.10:
python -I tests/test_mod_pack_output_alias.py: 3 tests pass, before and after.TMPDIRpointing through a symbolic link,main's file fails with the same two failures and this one passes.python -I scripts/check_no_game_data.py tests/test_mod_pack_output_alias.pyandgit diff --check.GPUs tested: n/a (one Python test file)
AI-assisted: yes (Claude Code)
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (No translator change.)🤖 Generated with Claude Code