[PR #320] test_guest_scene_reference: compare the resolved loader path #371

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

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/320
Author: @Andretuta
Created: 11/24/2026
Status: 🔄 Open

Base: main ← Head: old-pr/10055


📝 Commits (1)

  • 43b7df1 test_guest_scene_reference: compare the resolved loader path

📊 Changes

1 file changed (+52 additions, -3 deletions)

View changed files

📝 tests/test_guest_scene_reference.py (+52 -3)

📄 Description

Carried over from old PR 10055 by wavehs in the original Leonida repository, which went private on 23 Nov 2026. The code is the branch old-pr/10055, exactly that PR's last commit. All carried-over PRs are listed in #17.
Opened as a draft, and the CI runs the opening started were cancelled so 250 PRs don't fill the queue. Re-run CI here when you review it.
wavehs: this is your work. Feel free to take it over, by pushing to the branch or opening your own PR and closing this one.


Original description (mentions and #N references are disabled; the numbers refer to the old repository):

Re-lands the fix from the closed #8514 (6fa2c8cac) on current main, where tests/test_guest_scene_reference.py::test_launch_failure_preserves_run_record_and_logs still fails:

AssertionError: '/private/var/...invalid.exe' != '/var/...invalid.exe'
Ran 7 tests ... FAILED (failures=1)

Session.run gets resolved paths (scripts/run_guest_scene.py:341), and macOS reaches the temp directory through /var, a symlink to /private/var. The test compared the record to the unresolved spelling.

Coordination claim: https://github.com/ProjectLeonida/Leonida/issues/9677#issuecomment-7117112264

What changed

  • The launcher assertion compares record["cmd"][loader_index] to str(bad_loader.resolve()).
  • POSIX uses a wine stub separate from the loader: Session.run builds [wine, *wine_args, loader, …], so cmd[0] is the wine path — comparing it would leave the loader's resolve unfalsifiable (YordiLorenzo's finding on #8514). loader_index is computed from the wine args that main now supports, and their cmd[1:3] assertion is kept.
  • The redirected-CLI assertion uses str(report.resolve()), for a junctioned or symlinked --out.
  • A new test_launch_failure_records_the_resolved_launcher uses a symlinked root, so the contract is pinned on hosts where the temp directory is not already a symlink (skipped where symlinks cannot be created).

Tested

macOS 27.2.1, Apple M3 Pro, CPython 3.15.2, synthetic inputs, no game files:

  • python -I tests/test_guest_scene_reference.py → 7 tests OK, and 7 OK again with a symlinked TMPDIR.
  • Negative control, args.loader left unresolved at run_guest_scene.py:341: 2 tests fail (test_launch_failure_preserves_run_record_and_logs, test_launch_failure_records_the_resolved_launcher).
  • python -m compileall -q make_game.py tools tests, python -I scripts/check_no_game_data.py tests/test_guest_scene_reference.py, git diff --check: clean.

🔄 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/320 **Author:** [@Andretuta](https://github.com/Andretuta) **Created:** 11/24/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `old-pr/10055` --- ### 📝 Commits (1) - [`43b7df1`](https://github.com/ubiquitarianism/leonida/commit/43b7df189c173c4f8a438c1dd29d0991e2e909c7) test_guest_scene_reference: compare the resolved loader path ### 📊 Changes **1 file changed** (+52 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `tests/test_guest_scene_reference.py` (+52 -3) </details> ### 📄 Description > Carried over from **old PR 10055** by `wavehs` in the original Leonida repository, which went private on 23 Nov 2026. The code is the branch `old-pr/10055`, exactly that PR's last commit. All carried-over PRs are listed in #17. > Opened as a draft, and the CI runs the opening started were cancelled so 250 PRs don't fill the queue. Re-run CI here when you review it. > `wavehs`: this is your work. Feel free to take it over, by pushing to the branch or opening your own PR and closing this one. --- Original description (mentions and `#N` references are disabled; the numbers refer to the old repository): Re-lands the fix from the closed `#8514` (`6fa2c8cac`) on current `main`, where `tests/test_guest_scene_reference.py::test_launch_failure_preserves_run_record_and_logs` still fails: ``` AssertionError: '/private/var/...invalid.exe' != '/var/...invalid.exe' Ran 7 tests ... FAILED (failures=1) ``` `Session.run` gets resolved paths (`scripts/run_guest_scene.py:341`), and macOS reaches the temp directory through `/var`, a symlink to `/private/var`. The test compared the record to the unresolved spelling. Coordination claim: https://github.com/ProjectLeonida/Leonida/issues/9677#issuecomment-7117112264 ### What changed - The launcher assertion compares `record["cmd"][loader_index]` to `str(bad_loader.resolve())`. - POSIX uses a wine stub **separate** from the loader: `Session.run` builds `[wine, *wine_args, loader, …]`, so `cmd[0]` is the wine path — comparing it would leave the loader's resolve unfalsifiable (YordiLorenzo's finding on `#8514`). `loader_index` is computed from the wine args that main now supports, and their `cmd[1:3]` assertion is kept. - The redirected-CLI assertion uses `str(report.resolve())`, for a junctioned or symlinked `--out`. - A new `test_launch_failure_records_the_resolved_launcher` uses a symlinked root, so the contract is pinned on hosts where the temp directory is *not* already a symlink (skipped where symlinks cannot be created). ### Tested macOS 27.2.1, Apple M3 Pro, CPython 3.15.2, synthetic inputs, no game files: - `python -I tests/test_guest_scene_reference.py` → **7 tests OK**, and **7 OK** again with a symlinked `TMPDIR`. - Negative control, `args.loader` left unresolved at `run_guest_scene.py:341`: **2 tests fail** (`test_launch_failure_preserves_run_record_and_logs`, `test_launch_failure_records_the_resolved_launcher`). - `python -m compileall -q make_game.py tools tests`, `python -I scripts/check_no_game_data.py tests/test_guest_scene_reference.py`, `git diff --check`: clean. --- <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#371
No description provided.