Don't throw on dotnet exit codes (#21639)

Operation can succeed for purposes of the tests, the tests will fail if things aren't setup properly, so we can safely ignore the errors
This commit is contained in:
Hao Kung 2020-05-11 15:08:42 -07:00 committed by GitHub
parent 4b88074e30
commit 4434cf43ce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 4 deletions

View File

@ -122,26 +122,30 @@ namespace RunTests
$"nuget add source {Options.HELIX_WORKITEM_ROOT} --configfile NuGet.config",
environmentVariables: EnvironmentVariables,
outputDataReceived: Console.WriteLine,
errorDataReceived: Console.Error.WriteLine);
errorDataReceived: Console.Error.WriteLine,
throwOnError: false);
await ProcessUtil.RunAsync($"{Options.DotnetRoot}/dotnet",
"nuget add source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5/nuget/v3/index.json --configfile NuGet.config",
environmentVariables: EnvironmentVariables,
outputDataReceived: Console.WriteLine,
errorDataReceived: Console.Error.WriteLine);
errorDataReceived: Console.Error.WriteLine,
throwOnError: false);
// Write nuget sources to console, useful for debugging purposes
await ProcessUtil.RunAsync($"{Options.DotnetRoot}/dotnet",
"nuget list source",
environmentVariables: EnvironmentVariables,
outputDataReceived: Console.WriteLine,
errorDataReceived: Console.Error.WriteLine);
errorDataReceived: Console.Error.WriteLine,
throwOnError: false);
await ProcessUtil.RunAsync($"{Options.DotnetRoot}/dotnet",
$"tool install dotnet-ef --version {Options.EfVersion} --tool-path {Options.HELIX_WORKITEM_ROOT}",
environmentVariables: EnvironmentVariables,
outputDataReceived: Console.WriteLine,
errorDataReceived: Console.Error.WriteLine);
errorDataReceived: Console.Error.WriteLine,
throwOnError: false);
// ';' is the path separator on Windows, and ':' on Unix
Options.Path += RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? ";" : ":";