windows: Fix tests on Windows (#22616)
Release Notes: - N/A --------- Co-authored-by: Mikayla <mikayla.c.maki@gmail.com>
This commit is contained in:
parent
c252b5db16
commit
74c4dbd237
56 changed files with 1540 additions and 856 deletions
22
script/exit-ci-if-dev-drive-is-full.ps1
Normal file
22
script/exit-ci-if-dev-drive-is-full.ps1
Normal file
|
@ -0,0 +1,22 @@
|
|||
param (
|
||||
[Parameter(Mandatory = $true)]
|
||||
[int]$MAX_SIZE_IN_GB
|
||||
)
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
$PSNativeCommandUseErrorActionPreference = $true
|
||||
$ProgressPreference = "SilentlyContinue"
|
||||
|
||||
if (-Not (Test-Path -Path "target")) {
|
||||
Write-Host "target directory does not exist yet"
|
||||
exit 0
|
||||
}
|
||||
|
||||
$current_size_gb = (Get-ChildItem -Recurse -Force -File -Path "target" | Measure-Object -Property Length -Sum).Sum / 1GB
|
||||
|
||||
Write-Host "target directory size: ${current_size_gb}GB. max size: ${MAX_SIZE_IN_GB}GB"
|
||||
|
||||
if ($current_size_gb -gt $MAX_SIZE_IN_GB) {
|
||||
Write-Host "Dev drive is almost full, increase the size first!"
|
||||
exit 1
|
||||
}
|
|
@ -3,7 +3,8 @@
|
|||
# The current version of the Windows runner is 10.0.20348 which does not support DevDrive option.
|
||||
# Ref: https://learn.microsoft.com/en-us/windows/dev-drive/
|
||||
|
||||
$Volume = New-VHD -Path C:/zed_dev_drive.vhdx -SizeBytes 30GB |
|
||||
# Currently, total CI requires almost 45GB of space, here we are creating a 60GB drive.
|
||||
$Volume = New-VHD -Path C:/zed_dev_drive.vhdx -SizeBytes 60GB |
|
||||
Mount-VHD -Passthru |
|
||||
Initialize-Disk -Passthru |
|
||||
New-Partition -AssignDriveLetter -UseMaximumSize |
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue