tests: skip the preflight symlink case when Windows refuses symlinks #1126

Manually merged
github merged 1 commit from gh-pr/1126/head into gh-pr/1126/base 2026-11-26 22:43:42 +00:00
Owner

@⁠Toons29 on GitHub · 2026-11-24 01:27 UTC · original
Toons29:tests/preflight-symlink-skip → main · +14 −1 · 1 files · 1 commits · merged 2026-11-24 02:06 UTC

Change

pe_package_import_closure fails on a Windows account that can't create symlinks (no Developer Mode, not elevated). test_inspect_never_executes_and_ignores_non_pe_files creates linked.dll as a symlink at the very end, and on such an account that raises OSError: [WinError 1314] A required privilege is not held by the client. The test errors, so everything before it goes unreported too. CI doesn't hit this because the runner can create symlinks.

This moves the symlink check into its own test, test_inspect_refuses_a_symlinked_pe_candidate, which calls skipTest only when the error is ERROR_PRIVILEGE_NOT_HELD (1314). Any other OSError still fails. The assertion itself is unchanged, and the rest of the original test now runs on every account.

Verification

At c579c564 (on main a7710b73), Windows 11 build 26300, MSVC 19.44, Python 3.14, standard user account without Developer Mode, dev preset:

  • Before: ctest --preset dev --no-tests=error -R '^pe_package_import_closure$' failed with the WinError 1314 traceback above (FAILED (errors=1), 12 tests).
  • After: the same command passes. out\pe-env\Scripts\python.exe -B tests\pe_package_preflight_check.py -v gives Ran 13 tests ... OK (skipped=1), and the skip reads this Windows account cannot create symlinks (WinError 1314).

I couldn't run the symlink branch itself on this account; CI, which can create symlinks, still runs it.

Checklist

  • This pull request covers one reviewable behavior.
  • I included the exact command and result for every check I ran.
  • I considered a negative control or failure case for a new fixture. (No new fixture; non-1314 errors still raise.)
  • I updated README/docs when a capability or build requirement changed. (No change needed.)
  • I did not include game files, dumps, distribution links or secrets.

AI-assisted.

**@⁠Toons29** on GitHub · 2026-11-24 01:27 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/1126) `Toons29:tests/preflight-symlink-skip` → `main` · +14 −1 · 1 files · 1 commits · merged 2026-11-24 02:06 UTC ## Change `pe_package_import_closure` fails on a Windows account that can't create symlinks (no Developer Mode, not elevated). `test_inspect_never_executes_and_ignores_non_pe_files` creates `linked.dll` as a symlink at the very end, and on such an account that raises `OSError: [WinError 1314] A required privilege is not held by the client`. The test errors, so everything before it goes unreported too. CI doesn't hit this because the runner can create symlinks. This moves the symlink check into its own test, `test_inspect_refuses_a_symlinked_pe_candidate`, which calls `skipTest` only when the error is `ERROR_PRIVILEGE_NOT_HELD` (1314). Any other `OSError` still fails. The assertion itself is unchanged, and the rest of the original test now runs on every account. ## Verification At c579c564 (on main a7710b73), Windows 11 build 26300, MSVC 19.44, Python 3.14, standard user account without Developer Mode, `dev` preset: - Before: `ctest --preset dev --no-tests=error -R '^pe_package_import_closure$'` failed with the WinError 1314 traceback above (`FAILED (errors=1)`, 12 tests). - After: the same command passes. `out\pe-env\Scripts\python.exe -B tests\pe_package_preflight_check.py -v` gives `Ran 13 tests ... OK (skipped=1)`, and the skip reads `this Windows account cannot create symlinks (WinError 1314)`. I couldn't run the symlink branch itself on this account; CI, which can create symlinks, still runs it. ## Checklist - [x] This pull request covers one reviewable behavior. - [x] I included the exact command and result for every check I ran. - [x] I considered a negative control or failure case for a new fixture. (No new fixture; non-1314 errors still raise.) - [x] I updated README/docs when a capability or build requirement changed. (No change needed.) - [x] I did not include game files, dumps, distribution links or secrets. AI-assisted.
test_inspect_never_executes_and_ignores_non_pe_files created a symlink at
the end, so on a Windows account without Developer Mode or
SeCreateSymbolicLinkPrivilege the whole test errored with WinError 1314
and pe_package_import_closure failed.

Move the symlink check into its own test and skip it only for
ERROR_PRIVILEGE_NOT_HELD. The other checks in the original test now run
everywhere; any other OSError still fails.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 22:43:40 +00:00
github manually merged commit c579c564a4 into gh-pr/1126/base 2026-11-26 22:43:42 +00:00
Author
Owner

@⁠tedin7 on GitHub · 2026-11-24 02:02 UTC · original · reviewed

Reviewed at c579c564a47c1bce135a9856291c0baaeec6460d (tests/pe_package_preflight_check.py).

  • Splitting the symlink check into test_inspect_refuses_a_symlinked_pe_candidate and skipping only when getattr(error, "winerror", None) == 1314 (ERROR_PRIVILEGE_NOT_HELD) cleanly unblocks non-elevated Windows accounts without masking other OSErrors or non-Windows failures, while keeping all non-symlink assertions in test_inspect_never_executes_and_ignores_non_pe_files.
  • Linux checks run in a detached worktree: python3 -m py_compile tests/pe_package_preflight_check.py, python3 -B tests/docs_links_check.py, python3 -B tests/bidi_controls_check.py, python3 -B tests/gpu_report_format_check.py, python3 -B tests/xgameruntime_table_check.py — all passed. (pe_package_preflight_check.py itself was not executed here because pefile is not installed in this container.)
  • Windows symlink-enabled CI already passed all 4 jobs on this commit.
**@⁠tedin7** on GitHub · 2026-11-24 02:02 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/1126#pullrequestreview-6032526456) · **reviewed** Reviewed at `c579c564a47c1bce135a9856291c0baaeec6460d` (`tests/pe_package_preflight_check.py`). - Splitting the symlink check into `test_inspect_refuses_a_symlinked_pe_candidate` and skipping only when `getattr(error, "winerror", None) == 1314` (`ERROR_PRIVILEGE_NOT_HELD`) cleanly unblocks non-elevated Windows accounts without masking other `OSError`s or non-Windows failures, while keeping all non-symlink assertions in `test_inspect_never_executes_and_ignores_non_pe_files`. - Linux checks run in a detached worktree: `python3 -m py_compile tests/pe_package_preflight_check.py`, `python3 -B tests/docs_links_check.py`, `python3 -B tests/bidi_controls_check.py`, `python3 -B tests/gpu_report_format_check.py`, `python3 -B tests/xgameruntime_table_check.py` — all passed. (`pe_package_preflight_check.py` itself was not executed here because `pefile` is not installed in this container.) - Windows symlink-enabled CI already passed all 4 jobs on this commit.
This discussion has been locked. Commenting is limited to contributors.
No description provided.