-
Notifications
You must be signed in to change notification settings - Fork 37.6k
Add WSL sanity tests #290682
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+388
−15
Merged
Add WSL sanity tests #290682
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
5a3b9d0
Add WSL sanity tests
dmitrivMS 1cab638
Ensure WSL is installed and ready in Windows test script
dmitrivMS b1e9405
Try to get Ubuntu WSL installed if not present
dmitrivMS f5fb193
Use correct URL
dmitrivMS bd35d2e
Fix win32 setup script
dmitrivMS 15e202c
Script update
dmitrivMS db5de02
Another script fix
dmitrivMS File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,32 @@ | ||
| @echo off | ||
| setlocal | ||
|
|
||
| set "UBUNTU_ROOTFS=%TEMP%\ubuntu-rootfs.tar.gz" | ||
| set "UBUNTU_INSTALL=%LOCALAPPDATA%\WSL\Ubuntu" | ||
|
|
||
| echo Checking if Ubuntu WSL is available | ||
| powershell -Command "wsl -d Ubuntu echo 'WSL is ready'" 2>nul | ||
| if errorlevel 1 call :install_wsl | ||
|
|
||
| set PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 | ||
| set PLAYWRIGHT_CHROMIUM_EXECUTABLE_PATH=C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe | ||
|
|
||
| echo Running sanity tests | ||
| node "%~dp0..\out\index.js" %* | ||
| goto :eof | ||
|
|
||
| :install_wsl | ||
| echo Ubuntu not found, installing via rootfs import | ||
|
|
||
| if not exist "%UBUNTU_ROOTFS%" ( | ||
| echo Downloading Ubuntu rootfs | ||
| curl -L -o "%UBUNTU_ROOTFS%" https://cloud-images.ubuntu.com/wsl/jammy/current/ubuntu-jammy-wsl-amd64-ubuntu22.04lts.rootfs.tar.gz | ||
| ) | ||
|
|
||
| echo Importing Ubuntu into WSL | ||
| mkdir "%UBUNTU_INSTALL%" 2>nul | ||
| wsl --import Ubuntu "%UBUNTU_INSTALL%" "%UBUNTU_ROOTFS%" | ||
|
|
||
| echo Starting WSL | ||
| wsl -d Ubuntu echo WSL is ready | ||
| goto :eof |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using
context.runwithout checking if the command succeeded. If the WSL rm command fails during cleanup, the error will be silently ignored. While this might be acceptable for cleanup operations in a try-catch block (as seen at line 227), it would be better to at least log the stderr output if the command fails. Consider adding error checking:if (result.status !== 0) { this.log(\Failed to delete WSL dir: ${result.stderr}`); }`