Skip to content

tests: copy every local import of the debug launcher into the run.ps1 control - #3701

Merged
R0Y00 merged 1 commit into
R0Y00:mainfrom
KelboLive:tests/run-ps1-local-imports
Dec 1, 2026
Merged

R0Y00 merged 1 commit into
R0Y00:mainfrom
KelboLive:tests/run-ps1-local-imports

Conversation

@KelboLive

Copy link
Copy Markdown
Contributor

Change

The real_log_error control of startup_run_ps1 copies the real debug_launch.py into a scratch tree,
then makes log/events.txt a directory so the launcher raises PermissionError and the check looks for that
text in the captured summary. The modules it copied alongside were a hard-coded list:

for name in ("debug_launch.py", "launch.py", "host_cpu.py", "hook_window.py", "window_capture.py"):

#3674 (58352a682) added an import to the launcher:

tools/startup/debug_launch.py:37: from stall_watch import StallWatch  # noqa: E402

and did not update that list. The copied launcher therefore dies at import with ModuleNotFoundError, before
it reaches events.txt; the exit code is still 1, so the exit-code half of the control passes, and the
summary half fails:

FAIL powershell: real debugger log error was not captured in the summary
FAIL pwsh: real debugger log error was not captured in the summary

Fix

Copy every local module debug_launch.py imports, derived from the file itself, instead of a list that has to
be maintained by hand — so the next import addition cannot break this control the same way.

Verification

In-box dev preset, daddf6155:

before: startup_run_ps1  ***Failed  17.00 s
after:  startup_run_ps1   Passed   17.90 s, 17.09 s

startup_run_sh      ***Skipped (no bash)
startup_run_preset   Passed

The powershell and pwsh cases both pass, which is what distinguishes this from an environment problem:
the failure was Python import resolution inside the copied tree, identical on both shells.

Refs #3674.

… control

The real_log_error control copies debug_launch.py plus a hard-coded list of local modules into a
scratch tree. R0Y00#3674 (58352a6) added 'from stall_watch import StallWatch' to debug_launch.py and
did not update that list, so the copied launcher died with ModuleNotFoundError before reaching the
events.txt open. The control then reported that the debugger log error was not captured, because the
summary held the missing module instead of the PermissionError it looks for.

Derive the list from debug_launch.py's own imports so the next addition cannot break the control the
same way.

@R0Y00 R0Y00 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the temporary launcher fixture dependency discovery. Local startup_run_ps1 passed outside the sandbox, including the expected real launcher log error path.

@R0Y00
R0Y00 merged commit a89bb52 into R0Y00:main Dec 1, 2026
5 checks passed
@KelboLive
KelboLive deleted the tests/run-ps1-local-imports branch December 1, 2026 11:46
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