mirror of
https://github.com/logos-storage/logos-storage-nim-cs-dist-tests.git
synced 2026-02-25 15:33:11 +00:00
Enables console output for test logs
This commit is contained in:
parent
fe2d7484db
commit
18b1f73025
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -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()
|
||||
);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user