tests: skip the preflight symlink case when Windows refuses symlinks #1119
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1126"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from R0Y00/Xbox2Windows. Originally posted by Toons29 on 2026-11-24T01:27:42Z.
Change
pe_package_import_closurefails on a Windows account that can't create symlinks (no Developer Mode, not elevated).test_inspect_never_executes_and_ignores_non_pe_filescreateslinked.dllas a symlink at the very end, and on such an account that raisesOSError: [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 callsskipTestonly when the error isERROR_PRIVILEGE_NOT_HELD(1314). Any otherOSErrorstill fails. The assertion itself is unchanged, and the rest of the original test now runs on every account.Verification
At
c579c564(on maina7710b73), Windows 11 build 26300, MSVC 19.44, Python 3.14, standard user account without Developer Mode,devpreset:ctest --preset dev --no-tests=error -R '^pe_package_import_closure$'failed with the WinError 1314 traceback above (FAILED (errors=1), 12 tests).out\pe-env\Scripts\python.exe -B tests\pe_package_preflight_check.py -vgivesRan 13 tests ... OK (skipped=1), and the skip readsthis 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
AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T02:02:58Z.
Review: COMMENTED
Reviewed at
c579c564a47c1bce135a9856291c0baaeec6460d(tests/pe_package_preflight_check.py).test_inspect_refuses_a_symlinked_pe_candidateand skipping only whengetattr(error, "winerror", None) == 1314(ERROR_PRIVILEGE_NOT_HELD) cleanly unblocks non-elevated Windows accounts without masking otherOSErrors or non-Windows failures, while keeping all non-symlink assertions intest_inspect_never_executes_and_ignores_non_pe_files.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.pyitself was not executed here becausepefileis not installed in this container.)devpreset (Debug) with MSVC 19.42: five CRT-free TLS fixture targets fail to link (unresolved__dyn_tls_on_demand_init) #1087cpu_native_tls_valuefails with MSVC 19.42: expected 8 KiB pattern missing fromcpu_tls_value.dllTLS template #1458cpu_native_tls_valuefails with MSVC 19.42: expected 8 KiB pattern missing fromcpu_tls_value.dllTLS template #1458cpu_native_tls_valuefails with MSVC 19.42: expected 8 KiB pattern missing fromcpu_tls_value.dllTLS template #1458devpreset (Debug) with MSVC 19.42: five CRT-free TLS fixture targets fail to link (unresolved__dyn_tls_on_demand_init) #1087devpreset (Debug) with MSVC 19.42: five CRT-free TLS fixture targets fail to link (unresolved__dyn_tls_on_demand_init) #1087