Skip to content

Commit 4434cf4

Browse files
authored
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
1 parent 4b88074 commit 4434cf4

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

eng/helix/content/RunTests/TestRunner.cs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,26 +122,30 @@ await ProcessUtil.RunAsync($"{Options.DotnetRoot}/dotnet",
122122
$"nuget add source {Options.HELIX_WORKITEM_ROOT} --configfile NuGet.config",
123123
environmentVariables: EnvironmentVariables,
124124
outputDataReceived: Console.WriteLine,
125-
errorDataReceived: Console.Error.WriteLine);
125+
errorDataReceived: Console.Error.WriteLine,
126+
throwOnError: false);
126127

127128
await ProcessUtil.RunAsync($"{Options.DotnetRoot}/dotnet",
128129
"nuget add source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5/nuget/v3/index.json --configfile NuGet.config",
129130
environmentVariables: EnvironmentVariables,
130131
outputDataReceived: Console.WriteLine,
131-
errorDataReceived: Console.Error.WriteLine);
132+
errorDataReceived: Console.Error.WriteLine,
133+
throwOnError: false);
132134

133135
// Write nuget sources to console, useful for debugging purposes
134136
await ProcessUtil.RunAsync($"{Options.DotnetRoot}/dotnet",
135137
"nuget list source",
136138
environmentVariables: EnvironmentVariables,
137139
outputDataReceived: Console.WriteLine,
138-
errorDataReceived: Console.Error.WriteLine);
140+
errorDataReceived: Console.Error.WriteLine,
141+
throwOnError: false);
139142

140143
await ProcessUtil.RunAsync($"{Options.DotnetRoot}/dotnet",
141144
$"tool install dotnet-ef --version {Options.EfVersion} --tool-path {Options.HELIX_WORKITEM_ROOT}",
142145
environmentVariables: EnvironmentVariables,
143146
outputDataReceived: Console.WriteLine,
144-
errorDataReceived: Console.Error.WriteLine);
147+
errorDataReceived: Console.Error.WriteLine,
148+
throwOnError: false);
145149

146150
// ';' is the path separator on Windows, and ':' on Unix
147151
Options.Path += RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? ";" : ":";

0 commit comments

Comments
 (0)