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

Open
github-bot wants to merge 1 commit from github-bot/gh-1292 into main AGit
Owner

@⁠ambroseautomation on GitHub · 2026-11-24 21:20 UTC · original
ambroseautomation:carry/old-10055-guest-scene-loader-path → main · +49 −4 · 1 files · 1 commits · open

Claimed in the coordination issue as: OLD-10055 (#14)

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)
**@⁠ambroseautomation** on GitHub · 2026-11-24 21:20 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1292) `ambroseautomation:carry/old-10055-guest-scene-loader-path` → `main` · +49 −4 · 1 files · 1 commits · open Claimed in the coordination issue as: OLD-10055 (https://git.gtahub.st/github/ubiquitarianism--leonida/issues/14) ### 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)
main: the run record keeps the loader as Session.run got it, and main.py
resolves args.loader, guest and shaders before launching. The test asserts
record["cmd"][0] against the unresolved spelling, so macOS fails through
its /var -> /private/var temporary directory.

Assert the resolved path at the loader's own index: with --wine the
command starts [wine, *wine_args, loader, ...], so the test now names a
wine stub separate from the loader and computes the index from the wine
args, instead of comparing cmd[0] (the wine path) by accident.

Also assert the redirected-CLI report path resolves (a junctioned or
symlinked --out prints the target), and add a symlinked-root regression
test that pins the same contract without depending on the host volume.

Negative control: leaving args.loader unresolved fails both tests; with
the code intact 7 tests pass, also with a symlinked TMPDIR.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:46:18 +00:00
Author
Owner

@⁠PierreEbele on GitHub · 2026-11-25 14:52 UTC · original

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

**@⁠PierreEbele** on GitHub · 2026-11-25 14:52 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1292#issuecomment-7165941088) 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
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/1292/head:github-bot/gh-1292'
git switch 'github-bot/gh-1292'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1292'
git switch 'github-bot/gh-1292'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1292'
git switch 'github-bot/gh-1292'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1292'
git switch 'main'
git merge --squash 'github-bot/gh-1292'
git switch 'main'
git merge --ff-only 'github-bot/gh-1292'
git switch 'main'
git merge 'github-bot/gh-1292'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.