Skip to content

Commit

Permalink
Don't throw on dotnet exit codes (#21639)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
HaoK committed May 11, 2020
1 parent 4b88074 commit 4434cf4
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions eng/helix/content/RunTests/TestRunner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -122,26 +122,30 @@ await ProcessUtil.RunAsync($"{Options.DotnetRoot}/dotnet",
$"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) ? ";" : ":";
Expand Down

0 comments on commit 4434cf4

Please sign in to comment.