[PR #96] [CLOSED] tests: give the drive-root cases the version manifest they are judged against #148

Closed
opened 2026-11-26 20:16:57 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/96
Author: @wavehs
Created: 11/24/2026
Status: ❌ Closed

Base: main ← Head: tests-win-drive-root-manifest


📝 Commits (1)

  • 45edc68 tests: give the drive-root cases the version manifest they are judged against

📊 Changes

1 file changed (+20 additions, -17 deletions)

View changed files

📝 tests/test_make_game_paths.py (+20 -17)

📄 Description

Claimed in the coordination issue as: none — the original project's coordination issue was lost with its repository, and this repository's issue index (#18) has no entry for it. No open pull request touches this file.

Depends on: none.

What and why

The Windows check job reports four errors in tests/test_make_game_paths.py, all the same:

ERROR: test_drive_root_checks_entries_on_each_volume ... (protected='C:\\Content', option='out')
  File "make_game.py", line 2801, in main
    top_level = {rel.replace("\\", "/").split("/", 1)[0] for rel in [v["expected_exe"], *v["files"]]}
KeyError: 'expected_exe'

main() no longer lists the drive root to learn the dump's top-level entries; it takes them from the version manifest check() returns (expected_exe and files), so an unrelated folder on the drive cannot make the rerun look unsafe. The two drive-root tests still patched os.listdir, which nothing reads any more, and their check() mock returned {}.

run_build() now takes the manifest for the cases that need one, and the two tests pass one with the entries they mean (Content, and MountedContent for the junction case). The os.listdir patches are gone, and with them the two orderings in test_drive_root_checks_entries_on_each_volume, which existed to vary a listing the code no longer reads; the two protected targets (the folder on the dump's own volume, and the one a junction reaches on another) are still both checked.

Tested

main@9ec34cdff, macOS 15 arm64 (Apple M3 Pro), CPython 3.15.2, CPU only, no game files. Both cases skip on a non-Windows host, so the drive-root branch was exercised directly: / splits as a drive root under os.path.splitdrive here too, which reaches the same code with POSIX paths.

case check() mock result
out in an independent folder manifest with Content rc=0, preflight and runtime ran
out under the dump's own entry (/Content/out) manifest with Content rc=1, "must be outside the game folder"
out is the root itself manifest with Content rc=1
junction to another volume: out under MountedContent → /mnt/Package manifest with Content + MountedContent, realpath mocked rc=1 for both protected targets, rc=0 for an independent folder
the old mock {} KeyError: 'expected_exe', the CI traceback

python -I tests/test_make_game_paths.py: OK (skipped=2), before and after. compileall clean, check_no_game_data.py clean. Not run on Windows itself, and not run: any GPU test.

AI-assisted: yes.

Checklist

  • 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. (Not applicable: test-only.)

🔄 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/96 **Author:** [@wavehs](https://github.com/wavehs) **Created:** 11/24/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `tests-win-drive-root-manifest` --- ### 📝 Commits (1) - [`45edc68`](https://github.com/ubiquitarianism/leonida/commit/45edc689a02acf01c71c59867a0ad12922010f21) tests: give the drive-root cases the version manifest they are judged against ### 📊 Changes **1 file changed** (+20 additions, -17 deletions) <details> <summary>View changed files</summary> 📝 `tests/test_make_game_paths.py` (+20 -17) </details> ### 📄 Description Claimed in the coordination issue as: none — the original project's coordination issue was lost with its repository, and this repository's issue index (#18) has no entry for it. No open pull request touches this file. Depends on: none. ### What and why The Windows `check` job reports four errors in `tests/test_make_game_paths.py`, all the same: ``` ERROR: test_drive_root_checks_entries_on_each_volume ... (protected='C:\\Content', option='out') File "make_game.py", line 2801, in main top_level = {rel.replace("\\", "/").split("/", 1)[0] for rel in [v["expected_exe"], *v["files"]]} KeyError: 'expected_exe' ``` `main()` no longer lists the drive root to learn the dump's top-level entries; it takes them from the version manifest `check()` returns (`expected_exe` and `files`), so an unrelated folder on the drive cannot make the rerun look unsafe. The two drive-root tests still patched `os.listdir`, which nothing reads any more, and their `check()` mock returned `{}`. `run_build()` now takes the manifest for the cases that need one, and the two tests pass one with the entries they mean (`Content`, and `MountedContent` for the junction case). The `os.listdir` patches are gone, and with them the two orderings in `test_drive_root_checks_entries_on_each_volume`, which existed to vary a listing the code no longer reads; the two protected targets (the folder on the dump's own volume, and the one a junction reaches on another) are still both checked. ### Tested `main@9ec34cdff`, macOS 15 arm64 (Apple M3 Pro), CPython 3.15.2, CPU only, no game files. Both cases skip on a non-Windows host, so the drive-root branch was exercised directly: `/` splits as a drive root under `os.path.splitdrive` here too, which reaches the same code with POSIX paths. | case | `check()` mock | result | |---|---|---| | out in an independent folder | manifest with `Content` | `rc=0`, preflight and runtime ran | | out under the dump's own entry (`/Content/out`) | manifest with `Content` | `rc=1`, "must be outside the game folder" | | out is the root itself | manifest with `Content` | `rc=1` | | junction to another volume: out under `MountedContent` → `/mnt/Package` | manifest with `Content` + `MountedContent`, `realpath` mocked | `rc=1` for both protected targets, `rc=0` for an independent folder | | the old mock | `{}` | `KeyError: 'expected_exe'`, the CI traceback | `python -I tests/test_make_game_paths.py`: `OK (skipped=2)`, before and after. `compileall` clean, `check_no_game_data.py` clean. Not run on Windows itself, and not run: any GPU test. AI-assisted: yes. ### Checklist - [x] 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. (Not applicable: test-only.) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
4ld0 2026-11-26 20:16:57 +01:00
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#148
No description provided.