[Helix] Capture more output/errors in test runner (#20919)
This commit is contained in:
parent
01ca6a74ca
commit
f3c2c1c5b3
|
|
@ -98,7 +98,7 @@ namespace RunTests
|
||||||
Console.WriteLine($"'{process.StartInfo.FileName} {process.StartInfo.Arguments}' completed with exit code '{process.ExitCode}'");
|
Console.WriteLine($"'{process.StartInfo.FileName} {process.StartInfo.Arguments}' completed with exit code '{process.ExitCode}'");
|
||||||
if (throwOnError && process.ExitCode != 0)
|
if (throwOnError && process.ExitCode != 0)
|
||||||
{
|
{
|
||||||
processLifetimeTask.TrySetException(new InvalidOperationException($"Command {filename} {arguments} returned exit code {process.ExitCode}"));
|
processLifetimeTask.TrySetException(new InvalidOperationException($"Command {filename} {arguments} returned exit code {process.ExitCode} output: {outputBuilder.ToString()}"));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -120,22 +120,28 @@ namespace RunTests
|
||||||
|
|
||||||
await ProcessUtil.RunAsync($"{Options.DotnetRoot}/dotnet",
|
await ProcessUtil.RunAsync($"{Options.DotnetRoot}/dotnet",
|
||||||
$"nuget add source {Options.HELIX_WORKITEM_ROOT} --configfile NuGet.config",
|
$"nuget add source {Options.HELIX_WORKITEM_ROOT} --configfile NuGet.config",
|
||||||
environmentVariables: EnvironmentVariables);
|
environmentVariables: EnvironmentVariables,
|
||||||
|
outputDataReceived: Console.WriteLine,
|
||||||
|
errorDataReceived: Console.Error.WriteLine);
|
||||||
|
|
||||||
await ProcessUtil.RunAsync($"{Options.DotnetRoot}/dotnet",
|
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",
|
"nuget add source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5/nuget/v3/index.json --configfile NuGet.config",
|
||||||
environmentVariables: EnvironmentVariables);
|
environmentVariables: EnvironmentVariables,
|
||||||
|
outputDataReceived: Console.WriteLine,
|
||||||
|
errorDataReceived: Console.Error.WriteLine);
|
||||||
|
|
||||||
// Write nuget sources to console, useful for debugging purposes
|
// Write nuget sources to console, useful for debugging purposes
|
||||||
await ProcessUtil.RunAsync($"{Options.DotnetRoot}/dotnet",
|
await ProcessUtil.RunAsync($"{Options.DotnetRoot}/dotnet",
|
||||||
"nuget list source",
|
"nuget list source",
|
||||||
environmentVariables: EnvironmentVariables,
|
environmentVariables: EnvironmentVariables,
|
||||||
outputDataReceived: Console.WriteLine,
|
outputDataReceived: Console.WriteLine,
|
||||||
errorDataReceived: Console.WriteLine);
|
errorDataReceived: Console.Error.WriteLine);
|
||||||
|
|
||||||
await ProcessUtil.RunAsync($"{Options.DotnetRoot}/dotnet",
|
await ProcessUtil.RunAsync($"{Options.DotnetRoot}/dotnet",
|
||||||
$"tool install dotnet-ef --global --version {Options.EfVersion}",
|
$"tool install dotnet-ef --global --version {Options.EfVersion}",
|
||||||
environmentVariables: EnvironmentVariables);
|
environmentVariables: EnvironmentVariables,
|
||||||
|
outputDataReceived: Console.WriteLine,
|
||||||
|
errorDataReceived: Console.Error.WriteLine);
|
||||||
|
|
||||||
// ';' is the path separator on Windows, and ':' on Unix
|
// ';' is the path separator on Windows, and ':' on Unix
|
||||||
Options.Path += RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? ";" : ":";
|
Options.Path += RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? ";" : ":";
|
||||||
|
|
@ -219,7 +225,7 @@ namespace RunTests
|
||||||
commonTestArgs + " --TestCaseFilter:\"Quarantined=true\"",
|
commonTestArgs + " --TestCaseFilter:\"Quarantined=true\"",
|
||||||
environmentVariables: EnvironmentVariables,
|
environmentVariables: EnvironmentVariables,
|
||||||
outputDataReceived: Console.WriteLine,
|
outputDataReceived: Console.WriteLine,
|
||||||
errorDataReceived: Console.WriteLine,
|
errorDataReceived: Console.Error.WriteLine,
|
||||||
throwOnError: false);
|
throwOnError: false);
|
||||||
|
|
||||||
if (result.ExitCode != 0)
|
if (result.ExitCode != 0)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue