Skip to content
14 changes: 13 additions & 1 deletion .azure-pipelines/PipelineSteps/test-steps.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,19 @@ if ($PowerShellPlatform) {
$preference = $ErrorActionPreference
$ErrorActionPreference = 'Continue'
$buildProjPath = Join-Path $RepoRoot 'build.proj'
dotnet msbuild $buildProjPath /t:Test "/p:Configuration=$Configuration;TestFramework=$TestFramework"

$buildArgs = "/p:Configuration=$Configuration;TestFramework=$TestFramework"

if ($IsLinux) {
# Applying various parallelism/heap restriction behaviors to prevent OOM issues on Ubuntu 24.04
Write-Host -ForegroundColor Yellow "Detected Linux agent – applying memory tuning for tests"
$env:DOTNET_gcServer = "0"
$env:DOTNET_gcHeapCount = "2"
$buildArgs += ";RunConfiguration.MaxCpuCount=2"
}

dotnet msbuild $buildProjPath /t:Test $buildArgs

Write-Host -ForegroundColor DarkGreen "-------------------- End testing ... --------------------`n`n`n`n`n"

# Test AutoGen Modules With PowerShell Core
Expand Down