Skip to content

tests: start Windows PowerShell by its full path (TEST-869) - #3965

Open
Maraco91 wants to merge 2 commits into
ItsNotRexed:mainfrom
Maraco91:test/powershell-full-path
Open

Maraco91 wants to merge 2 commits into
ItsNotRexed:mainfrom
Maraco91:test/powershell-full-path

Conversation

@Maraco91

Copy link
Copy Markdown

Claimed in the coordination issue as: TEST-869 (claim in #3918).

Depends on: #3930 (BUILD-1118). This branch is stacked on it, so until that merges the diff here shows its commit too; the change of this PR is the second commit, e034f95: 10 test files, +52/−14.

What and why

Ten Windows-only test files start a bare "powershell.exe", 14 launches in all. CreateProcess searches System32 but not System32\WindowsPowerShell\v1.0, so on a PC whose PATH no longer lists that folder every one of them ends in FileNotFoundError at subprocess.run and tests nothing.

Each launch now starts the file make_game.windows_powershell() returns (added by #3930), the same one the runtime stage starts. Per file that is sys.path.insert(0, <repository root>), from make_game import windows_powershell, and the one token; import sys where the file didn't have it. Nothing else in the tests changes.

Files: tests/test_build_llvm_mc_batch.py, test_build_runtime_batch.py, test_carve_all_brackets.py, test_carve_all_paths.py (4 launches), test_first_look_exit.py, test_first_look_shim_report.py, test_llvm_install_destination.py, test_llvm_install_path.py (2), test_llvm_source_version.py, test_meta_to_xml_paths.py.

Overlap: #3380, #3344, #3333, #3515, #2515 and #2497 edit some of these files. Where one of them lands first I'll rebase; the change here is one token per launch.

Tested

Windows 11 26200, Python 3.12.6. No game files; no GPU is involved.

PATH without System32\WindowsPowerShell\v1.0 PATH with it
main (aa2988c) all 10 files fail with FileNotFoundError 9 pass, test_build_llvm_mc_batch.py fails
this branch 9 pass, test_build_llvm_mc_batch.py fails 9 pass, test_build_llvm_mc_batch.py fails

test_build_llvm_mc_batch.py gets past the launch now and fails on main and here for another reason, "check-console.cmd" not being recognised as a command. That is TEST-668, which #3380 fixes; I left it alone.

  • Linux (WSL Ubuntu, Python 3.12.3): the ten files import and skip as before (OK (skipped=N) for each), so the new import works where the tests don't run.
  • python -I tests/test_ci_registration.py (8), tests/test_text_write_line_endings.py (3): OK. python -m compileall -q make_game.py tools tests: OK. git diff --check: clean.

Checklist

  • 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. (Not applicable.)

AI-assisted (Claude Code).

🤖 Generated with Claude Code

Maraco91 and others added 2 commits November 22, 2026 23:32
…stage

The runtime stage ran scripts/build_runtime.ps1 through the bare name
"powershell". CreateProcess searches System32 but not
System32\WindowsPowerShell\v1.0, so on a PC whose PATH no longer lists
that folder the stage ended in a FileNotFoundError traceback, after the
shader and asset stages had already run.

windows_powershell() returns the file under %SystemRoot%, and the bare
name where the file is not at its usual place.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Ten Windows-only test files started a bare "powershell.exe", 14 launches in
all. CreateProcess does not search System32\WindowsPowerShell\v1.0, so on a
PC whose PATH no longer lists that folder every one of them ended in a
FileNotFoundError at subprocess.run and tested nothing.

They now start the file make_game.windows_powershell() returns, the one the
runtime stage starts.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@Vonsek

Vonsek commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

Independent Windows Python check of e034f95. With PATH empty, launching the old bare powershell command raised FileNotFoundError, while the new helper's full path launched Windows PowerShell and printed the expected marker. With its usual directory on PATH, both commands printed the same marker. The two focused tests passed, covering the runtime arguments via a mocked runner and the bare-name fallback when the standard executable is absent. No build script ran.

AI-assisted.

@tupacfan04

Copy link
Copy Markdown
Contributor

PASS as a test-only follow-up (the author's comment does not change the result). 20/20 across the 10 changed test files, compileall clean, and it merges cleanly; with System32\WindowsPowerShell\v1.0 removed from PATH, the base files give 4 FileNotFoundErrors and the PR passes.

Minor: tests/test_first_look_exit.py:15 and tests/test_meta_to_xml_paths.py:14 resolve windows_powershell() at import time, before the skip decorators - harmless, just an unnecessary filesystem probe.

Approve. AI-assisted review, no game files, no GPU.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants