Enables console output for test logs

This commit is contained in:
Ben 2025-05-14 15:01:21 +02:00
parent fe2d7484db
commit 18b1f73025
No known key found for this signature in database
GPG Key ID: 0F16E812E736C24B
2 changed files with 8 additions and 19 deletions

View File

@ -1,4 +1,5 @@
using System.Reflection;
using System.Diagnostics;
using System.Reflection;
using Core;
using Logging;
@ -33,7 +34,9 @@ namespace DistTestCore
{
try
{
Stopwatch.Measure(log, "Global setup", () =>
Trace.Listeners.Add(new ConsoleTraceListener());
Logging.Stopwatch.Measure(log, "Global setup", () =>
{
globalEntryPoint.Announce();
globalEntryPoint.Tools.CreateWorkflow().DeleteNamespacesStartingWith(TestNamespacePrefix, wait: true);
@ -55,6 +58,8 @@ namespace DistTestCore
deleteTrackedFiles: true,
waitTillDone: true
);
Trace.Flush();
}
}
}

View File

@ -59,24 +59,8 @@ namespace DistTestCore.Logs
protected static ILog CreateMainLog(string fullName, string name)
{
ILog log = new FileLog(fullName);
log = ApplyConsoleOutput(log);
return log;
}
private static ILog ApplyConsoleOutput(ILog log)
{
// If we're running as a release test, we'll split the log output
// to the console as well.
var testType = Environment.GetEnvironmentVariable("TEST_TYPE");
if (string.IsNullOrEmpty(testType) || testType.ToLowerInvariant() != "release-tests")
{
return log;
}
return new LogSplitter(
log,
new FileLog(fullName),
new ConsoleLog()
);
}