tests: compare run_preset mount line with the resolved package path #3508

Merged
Leyukaka merged 1 commit from upstream-pr/3508 into main 2026-11-30 02:18:57 +00:00
Leyukaka commented 2026-11-29 19:01:43 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Leyukaka on 2026-11-29T19:01:43Z.


Refs #3507 (item b).

What

tools/startup/run_preset.py:264 resolves the package path before printing the mount command at :286. tests/startup_run_preset_check.py expected the unresolved spelling, so it reported FAIL: --print output when the temp directory contained an 8.3 component that the launcher expanded.

  • The expected mount line is now built from package.resolve().
  • The package is passed to --package through bin/.., so the input spelling differs from the resolved one even without an 8.3 temp directory.
  • The full line mount: subst G: <resolved package> is compared, so an unresolved bin/.. suffix is rejected.

Test file only (+7/-4), no launcher change.

Test

Base d3e306a7, head 364c3075.

  • python -B tests/startup_run_preset_check.py: OK: 12 preset choices, staging and controls, exit 0.
  • Mutation: with .resolve() dropped at run_preset.py:264, the check prints FAIL: --print output, exit 1. Restored: exit 0.

Not covered

  • The real 8.3 short-path case was not reproduced locally.
  • This test only runs on main pushes; it is not in the pr ctest filter.
<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:5554039204 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3508). Originally posted by [Leyukaka](https://github.com/Leyukaka) on 2026-11-29T19:01:43Z. --- Refs #3507 (item b). ## What `tools/startup/run_preset.py:264` resolves the package path before printing the mount command at `:286`. `tests/startup_run_preset_check.py` expected the unresolved spelling, so it reported `FAIL: --print output` when the temp directory contained an 8.3 component that the launcher expanded. - The expected mount line is now built from `package.resolve()`. - The package is passed to `--package` through `bin/..`, so the input spelling differs from the resolved one even without an 8.3 temp directory. - The full line ` mount: subst G: <resolved package>` is compared, so an unresolved `bin/..` suffix is rejected. Test file only (+7/-4), no launcher change. ## Test Base d3e306a7, head 364c3075. - `python -B tests/startup_run_preset_check.py`: `OK: 12 preset choices, staging and controls`, exit 0. - Mutation: with `.resolve()` dropped at `run_preset.py:264`, the check prints `FAIL: --print output`, exit 1. Restored: exit 0. ## Not covered - The real 8.3 short-path case was not reproduced locally. - This test only runs on main pushes; it is not in the pr ctest filter.
Not-Saii commented 2026-11-29 21:50:48 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Not-Saii on 2026-11-29T21:50:48Z.

Review: APPROVED


Reviewed at head 364c30750d9005fdb6b220b7bdbfba9e240b3555 (parent d3e306a7). It merges cleanly into current main (ff9dcef0).

Summary

run_preset.py:264 resolves --package, and --print writes that resolved path in the mount: subst line at :286. Before this PR the check expected the unresolved temporary-directory spelling, so it failed with FAIL: --print output whenever the temp path resolves to something else (8.3 short names on the runner, issue #3507 (b)). This PR:

  • passes package/bin/.. to --package, so the input differs from its resolved form on every host;
  • expects package.resolve();
  • matches the whole line, so an unresolved bin/.. suffix can't pass as a substring.

check() collects failures (tests/startup_run_preset_check.py:25-30), and the mount line is the only launcher-path comparison in the file. The later run4 and missing-Executable calls compare no paths. So this covers all of item (b).

No downloads, network calls, build-command, CI or agent-config changes. One test file only.

Findings

  • MUST: none.
  • SHOULD: none.
  • NIT: none.

Note for the maintainer: #3512 fixes the same failure in the same file by resolving the temp directory up front. The two merge cleanly and are compatible, but only one is needed. This PR keeps a check that fails on any host if the launcher stops resolving the path (see the mutation below); with #3512 alone it would pass. Which to land is your call.

What the test proves

startup_run_preset: --print names the resolved package root in the subst mount line, for an input path that differs from its resolved form.

Sandbox run

Windows Sandbox with networking disabled (confirmed unreachable inside). The PR tree was exported at the head SHA and mapped read-only, then copied to a scratch folder inside the sandbox. This is a pure-Python test, so I configured but didn't build any targets; nothing it runs is a build output.

cmake --preset dev -DX2W_WITH_OPUS=OFF -DINTAKE_PYTHON=<venv python>
ctest --preset dev --no-tests=error -R '^startup_run_preset$' -V

8.3 short names are disabled in the sandbox, so I used a directory junction as TEMP/TMP. Path.resolve() rewrites it to the target, which gives the same mismatch the runner has.

Leg TEMP Result
PR head default pass (OK: 12 preset choices, staging and controls)
PR head junction pass
base test (d3e306a7) default pass
base test junction fail: FAIL: --print output, 1 failure(s) (reproduces the bug)
mutation, PR head default fail: FAIL: --print output, 1 failure(s), exit 1
mutation, PR head junction fail: same single failure
mutation, base test default pass (the old check didn't catch it)
restored, PR head default and junction pass

Mutation, applied to a scratch copy only: tools/startup/run_preset.py:264 Path(a.package).resolve() -> Path(a.package). The PR's check fails with exactly one failure (--print output) and no traceback. The base check passes under the same mutation on a long temp path. So the PR adds a catch that wasn't there, and it fixes the junction/short-path case.

Evidence fields

  • Commit: 364c30750d9005fdb6b220b7bdbfba9e240b3555
  • Command: as above
  • Passed: startup_run_preset (default and junction TEMP). Failed: none at head. Skipped (77): none.
  • Adapter: NVIDIA GeForce RTX 4090 via sandbox vGPU, driver reported in the sandbox 10.0.26100.1150. Not used: the test has no GPU work.
  • Windows: sandbox Windows 11 Enterprise build 26100 (host build 26300)
  • Debug layer: n/a (no D3D12)
  • Toolchain: MSVC 14.44.35207, CMake 3.31.6, Python 3.14.8

CI

Run 46298533805 at head: the Linux Python job ran tests/startup_run_preset_check.py and it passed. The Windows PR job (ctest --preset pr, 82 tests) does not include startup_run_preset, so Windows CI did not run this test. The /O2 job was skipped for the PR run.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6104974952 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3508#pullrequestreview-6104974952). Originally posted by [Not-Saii](https://github.com/Not-Saii) on 2026-11-29T21:50:48Z. **Review:** APPROVED --- Reviewed at head `364c30750d9005fdb6b220b7bdbfba9e240b3555` (parent `d3e306a7`). It merges cleanly into current `main` (`ff9dcef0`). ## Summary `run_preset.py:264` resolves `--package`, and `--print` writes that resolved path in the `mount: subst` line at `:286`. Before this PR the check expected the unresolved temporary-directory spelling, so it failed with `FAIL: --print output` whenever the temp path resolves to something else (8.3 short names on the runner, issue #3507 (b)). This PR: - passes `package/bin/..` to `--package`, so the input differs from its resolved form on every host; - expects `package.resolve()`; - matches the whole line, so an unresolved `bin/..` suffix can't pass as a substring. `check()` collects failures (`tests/startup_run_preset_check.py:25-30`), and the mount line is the only launcher-path comparison in the file. The later `run4` and missing-Executable calls compare no paths. So this covers all of item (b). No downloads, network calls, build-command, CI or agent-config changes. One test file only. ## Findings - MUST: none. - SHOULD: none. - NIT: none. Note for the maintainer: #3512 fixes the same failure in the same file by resolving the temp directory up front. The two merge cleanly and are compatible, but only one is needed. This PR keeps a check that fails on any host if the launcher stops resolving the path (see the mutation below); with #3512 alone it would pass. Which to land is your call. ## What the test proves `startup_run_preset`: `--print` names the resolved package root in the `subst` mount line, for an input path that differs from its resolved form. ## Sandbox run Windows Sandbox with networking disabled (confirmed unreachable inside). The PR tree was exported at the head SHA and mapped read-only, then copied to a scratch folder inside the sandbox. This is a pure-Python test, so I configured but didn't build any targets; nothing it runs is a build output. ``` cmake --preset dev -DX2W_WITH_OPUS=OFF -DINTAKE_PYTHON=<venv python> ctest --preset dev --no-tests=error -R '^startup_run_preset$' -V ``` 8.3 short names are disabled in the sandbox, so I used a directory junction as `TEMP`/`TMP`. `Path.resolve()` rewrites it to the target, which gives the same mismatch the runner has. | Leg | TEMP | Result | |---|---|---| | PR head | default | pass (`OK: 12 preset choices, staging and controls`) | | PR head | junction | pass | | base test (`d3e306a7`) | default | pass | | base test | junction | fail: `FAIL: --print output`, `1 failure(s)` (reproduces the bug) | | mutation, PR head | default | fail: `FAIL: --print output`, `1 failure(s)`, exit 1 | | mutation, PR head | junction | fail: same single failure | | mutation, base test | default | pass (the old check didn't catch it) | | restored, PR head | default and junction | pass | Mutation, applied to a scratch copy only: `tools/startup/run_preset.py:264` `Path(a.package).resolve()` -> `Path(a.package)`. The PR's check fails with exactly one failure (`--print output`) and no traceback. The base check passes under the same mutation on a long temp path. So the PR adds a catch that wasn't there, and it fixes the junction/short-path case. ## Evidence fields - Commit: `364c30750d9005fdb6b220b7bdbfba9e240b3555` - Command: as above - Passed: `startup_run_preset` (default and junction TEMP). Failed: none at head. Skipped (77): none. - Adapter: NVIDIA GeForce RTX 4090 via sandbox vGPU, driver reported in the sandbox 10.0.26100.1150. Not used: the test has no GPU work. - Windows: sandbox Windows 11 Enterprise build 26100 (host build 26300) - Debug layer: n/a (no D3D12) - Toolchain: MSVC 14.44.35207, CMake 3.31.6, Python 3.14.8 ## CI Run 46298533805 at head: the Linux Python job ran `tests/startup_run_preset_check.py` and it passed. The Windows PR job (`ctest --preset pr`, 82 tests) does not include `startup_run_preset`, so Windows CI did not run this test. The `/O2` job was skipped for the PR run.
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
R0Y00/Xbox2Windows!3508
No description provided.