tests/test_guest_scene_reference: compare resolved loader path at loader index (OLD-10055) #1292

Closed
ambroseautomation wants to merge 1 commit from upstream-pr/1292 into main
ambroseautomation commented 2026-11-24 21:20:50 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by ambroseautomation on 2026-11-24T21:20:50Z.


Claimed in the coordination issue as: OLD-10055 (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7144775375)

What and why

Carries forward old-pr/10055 (draft #320, original commit author wavehs preserved; indexed in #17), rebased cleanly onto current main (6261ca916) while preserving main's errors="replace" decode for localized Windows launch errors.

Fixes tests/test_guest_scene_reference.py:

  • Uses a separate --wine stub on non-Windows hosts and asserts record["cmd"][loader_index] against str(bad_loader.resolve()) at the loader's actual command index rather than comparing cmd[0] (which is the wine path when --wine is used).
  • Adds test_launch_failure_records_the_resolved_launcher, pinning resolved launcher path recording through a symlinked root (cleanly skipped on Windows without symlink privileges).

Tested

  • python -I tests/test_guest_scene_reference.py -v: 7 tests, OK (1 skipped: Windows symlink privilege).
  • python -I scripts/check_no_game_data.py tests/test_guest_scene_reference.py: exit 0 (no game data).

GPUs tested: n/a (Python stdlib unit tests on Windows 11 Pro 64-bit, Python 3.12.10)

AI-assisted: yes

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. (n/a — unit test fix)
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5480535829 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1292). Originally posted by [ambroseautomation](https://github.com/ambroseautomation) on 2026-11-24T21:20:50Z. --- Claimed in the coordination issue as: OLD-10055 (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7144775375) ### What and why Carries forward `old-pr/10055` (draft #320, original commit author `wavehs` preserved; indexed in #17), rebased cleanly onto current `main` (`6261ca916`) while preserving `main`'s `errors="replace"` decode for localized Windows launch errors. Fixes `tests/test_guest_scene_reference.py`: - Uses a separate `--wine` stub on non-Windows hosts and asserts `record["cmd"][loader_index]` against `str(bad_loader.resolve())` at the loader's actual command index rather than comparing `cmd[0]` (which is the wine path when `--wine` is used). - Adds `test_launch_failure_records_the_resolved_launcher`, pinning resolved launcher path recording through a symlinked root (cleanly skipped on Windows without symlink privileges). ### Tested - `python -I tests/test_guest_scene_reference.py -v`: 7 tests, OK (1 skipped: Windows symlink privilege). - `python -I scripts/check_no_game_data.py tests/test_guest_scene_reference.py`: exit 0 (no game data). GPUs tested: n/a (Python stdlib unit tests on Windows 11 Pro 64-bit, Python 3.12.10) AI-assisted: yes ### 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. - [ ] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed. (n/a — unit test fix)
PierreEbele commented 2026-11-25 14:52:09 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by PierreEbele on 2026-11-25T14:52:09Z.


Reviewed 46ae994b1: ran python -I tests/test_guest_scene_reference.py (Linux arm64, Python 3.12) on this branch, on main, and with this test file over main's runner - 7 tests pass in every case. Probe: with the runner patched to stop resolving --loader/--guest/--shaders, the record holds the link spelling (.../link/invalid.exe instead of .../real/invalid.exe); this branch then fails exactly on the new test_launch_failure_records_the_resolved_launcher (both launch-failure tests under a symlinked TMPDIR), while main's suite passes against the same patched runner - the old cmd[0] assertion compared the Wine entry, not the loader. Minor: the new test reads the child's output with strict UTF-8 (no errors="replace" like its sibling), which on Windows with a non-UTF-8 ANSI code page could make the test itself raise. AI-assisted review.

Recommendation: Merge

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7165941088 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1292#issuecomment-7165941088). Originally posted by [PierreEbele](https://github.com/PierreEbele) on 2026-11-25T14:52:09Z. --- Reviewed 46ae994b1: ran `python -I tests/test_guest_scene_reference.py` (Linux arm64, Python 3.12) on this branch, on main, and with this test file over main's runner - 7 tests pass in every case. Probe: with the runner patched to stop resolving `--loader/--guest/--shaders`, the record holds the link spelling (`.../link/invalid.exe` instead of `.../real/invalid.exe`); this branch then fails exactly on the new `test_launch_failure_records_the_resolved_launcher` (both launch-failure tests under a symlinked TMPDIR), while main's suite passes against the same patched runner - the old `cmd[0]` assertion compared the Wine entry, not the loader. Minor: the new test reads the child's output with strict UTF-8 (no `errors="replace"` like its sibling), which on Windows with a non-UTF-8 ANSI code page could make the test itself raise. AI-assisted review. **Recommendation:** Merge

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
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.

Reference
ProjectLeonida/mandy!1292
No description provided.