Skip to content

Detect WSL2 when filtering PATH in tests - #32

Merged
plicease merged 2 commits into
mainfrom
graham/wsl2-detect
Oct 7, 2026
Merged

plicease merged 2 commits into
mainfrom
graham/wsl2-detect

Conversation

@plicease

@plicease plicease commented Oct 7, 2026

Copy link
Copy Markdown
Member

Fixes #31.

t/lib/TestPath.pm strips /mnt/X/ entries from PATH under WSL, but detected WSL with /-Microsoft$/, which only matches WSL1 kernels. WSL2 kernels report e.g. 6.6.87.2-microsoft-standard-WSL2, so the Windows cmd.exe/powershell.exe were found and used by the tests, failing on unsigned scripts from \\\\wsl.localhost\\....

Changed the check to /microsoft/i.

Tested on WSL2 with Windows system32 and PowerShell dirs on PATH: suite fails before the change, passes after.

🤖 Generated with Claude Code

plicease and others added 2 commits October 7, 2026 09:40
WSL2 kernel releases look like 6.6.87.2-microsoft-standard-WSL2, which
the old /-Microsoft$/ check (WSL1 only) did not match, so Windows
cmd.exe/powershell.exe under /mnt/c were picked up by the tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@plicease plicease mentioned this pull request Oct 7, 2026
@plicease
plicease merged commit 3c1bbe2 into main Oct 7, 2026
21 checks passed
@plicease
plicease deleted the graham/wsl2-detect branch October 7, 2026 15:48
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.

test failures under WSL

1 participant