Skip to content
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

Try to fix more of the build script to handle paths with spaces #18143

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions eng/Build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -368,8 +368,8 @@ function TestUsingMSBuild([string] $testProject, [string] $targetFramework, [str
$projectName = [System.IO.Path]::GetFileNameWithoutExtension($testProject)
$testLogPath = "$ArtifactsDir\TestResults\$configuration\${projectName}_$targetFramework.xml"
$testBinLogPath = "$LogDir\${projectName}_$targetFramework.binlog"
$args = "test $testProject -c $configuration -f $targetFramework -v n --test-adapter-path $testadapterpath --logger ""xunit;LogFilePath=$testLogPath"" /bl:$testBinLogPath"
$args += " --blame --results-directory $ArtifactsDir\TestResults\$configuration -p:vstestusemsbuildoutput=false"
$args = "test ""$testProject"" -c $configuration -f $targetFramework -v n --test-adapter-path ""$testadapterpath"" --logger ""xunit;LogFilePath=$testLogPath"" ""/bl:$testBinLogPath"""
$args += " --blame --results-directory ""$ArtifactsDir\TestResults\$configuration"" -p:vstestusemsbuildoutput=false"

if (-not $noVisualStudio -or $norestore) {
$args += " --no-restore"
Expand All @@ -383,13 +383,13 @@ function TestUsingMSBuild([string] $testProject, [string] $targetFramework, [str
Write-Host("Starting on the background: $args")
Write-Host("------------------------------------")
$bgJob = Start-Job -ScriptBlock {
& $using:dotnetExe test $using:testProject -c $using:configuration -f $using:targetFramework -v n --test-adapter-path $using:testadapterpath --logger "xunit;LogFilePath=$using:testLogPath" /bl:$using:testBinLogPath --blame --results-directory $using:ArtifactsDir\TestResults\$using:configuration
& $using:dotnetExe test "$using:testProject" -c "$using:configuration" -f "$using:targetFramework" -v n --test-adapter-path "$using:testadapterpath" --logger "xunit;LogFilePath=$using:testLogPath" "/bl:$using:testBinLogPath" --blame --results-directory "$using:ArtifactsDir\TestResults\$using:configuration"
if ($LASTEXITCODE -ne 0) {
throw "Command failed to execute with exit code $($LASTEXITCODE): $using:dotnetExe $using:args"
}
}
return $bgJob
} else{
} else {
Write-Host("$args")
Exec-Console $dotnetExe $args
}
Expand Down
Loading