[PR #1412] tests: the mod-pack alias test compares resolved names, as same_report_path does (TEST-MOD-PACK-ALIAS-MACOS) #1441

Open
opened 2026-11-26 20:21:15 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/1412
Author: @milk4sale
Created: 11/25/2026
Status: 🔄 Open

Base: main ← Head: test/mod-pack-alias-resolved-names


📝 Commits (1)

  • 09970b7 tests: the mod-pack alias test compares resolved names, as same_report_path does (TEST-MOD-PACK-ALIAS-MACOS)

📊 Changes

1 file changed (+6 additions, -2 deletions)

View changed files

📝 tests/test_mod_pack_output_alias.py (+6 -2)

📄 Description

Claimed in the coordination issue as: TEST-MOD-PACK-ALIAS-MACOS (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7147669112)

What and why

tests/test_mod_pack_output_alias.py, added by #1057 (on main since be195981e), 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.

On macOS this is worse than one red file: the macos-python job stops at the first failing file, so every test file after this one goes unrun there. On Windows the check job 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.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:

tempfile.gettempdir() os.path.realpath of it
macOS runner /var/folders/…/T /private/var/folders/…/T
Windows runner C:\Users\RUNNER~1\AppData\Local\Temp C:\Users\runneradmin\AppData\Local\Temp
Linux runner /tmp /tmp

So the stand-in never recognises the pair, and pack_mod goes on to write the package. The stand-in now compares resolved names. tools/leonida_mods.py and tools/report_paths.py are 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.py macos-26 windows-latest ubuntu-24.04
the file as on main FAILED (failures=2) FAILED (failures=2) OK
with this change OK OK OK

The two failures are ModsError not raised for relative='mod.json' and relative='nested/notes.txt', the same as in the macos-python job of a run of main 3a0af1f15 (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.
  • Control: with TMPDIR pointing 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.py and git diff --check.

GPUs tested: n/a (one Python test file)

AI-assisted: yes (Claude Code)

Checklist

  • Based on current main and merges cleanly (a conflicting pull request is labeled needs rebase).
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (No translator change.)

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/1412 **Author:** [@milk4sale](https://github.com/milk4sale) **Created:** 11/25/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `test/mod-pack-alias-resolved-names` --- ### 📝 Commits (1) - [`09970b7`](https://github.com/ubiquitarianism/leonida/commit/09970b7531519f7244e4daaf6c5718f2b8e40dc7) tests: the mod-pack alias test compares resolved names, as same_report_path does (TEST-MOD-PACK-ALIAS-MACOS) ### 📊 Changes **1 file changed** (+6 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `tests/test_mod_pack_output_alias.py` (+6 -2) </details> ### 📄 Description Claimed in the coordination issue as: TEST-MOD-PACK-ALIAS-MACOS (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7147669112) ### What and why `tests/test_mod_pack_output_alias.py`, added by #1057 (on `main` since `be195981e`), 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. On macOS this is worse than one red file: the `macos-python` job stops at the first failing file, so every test file after this one goes unrun there. On Windows the `check` job 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.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: | | `tempfile.gettempdir()` | `os.path.realpath` of it | |---|---|---| | macOS runner | `/var/folders/…/T` | `/private/var/folders/…/T` | | Windows runner | `C:\Users\RUNNER~1\AppData\Local\Temp` | `C:\Users\runneradmin\AppData\Local\Temp` | | Linux runner | `/tmp` | `/tmp` | So the stand-in never recognises the pair, and `pack_mod` goes on to write the package. The stand-in now compares resolved names. `tools/leonida_mods.py` and `tools/report_paths.py` are 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](https://github.com/milk4sale/leonida/actions/runs/45511999132)): | `python -I tests/test_mod_pack_output_alias.py` | `macos-26` | `windows-latest` | `ubuntu-24.04` | |---|---|---|---| | the file as on `main` | FAILED (failures=2) | FAILED (failures=2) | OK | | with this change | OK | OK | OK | The two failures are `ModsError not raised` for `relative='mod.json'` and `relative='nested/notes.txt'`, the same as in the `macos-python` job of a run of `main` `3a0af1f15` ([run 45510568820](https://github.com/milk4sale/leonida/actions/runs/45510568820)). Locally, on Linux with Python 3.14.10: - `python -I tests/test_mod_pack_output_alias.py`: 3 tests pass, before and after. - Control: with `TMPDIR` pointing 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.py` and `git diff --check`. GPUs tested: n/a (one Python test file) AI-assisted: yes (Claude Code) ### Checklist - [x] Based on current `main` and merges cleanly (a conflicting pull request is labeled `needs rebase`). - [x] One topic; follow-up work goes in a new pull request. - [x] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here. - [x] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed. (No translator change.) 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
starred/leonida#1441
No description provided.