From b78f527c395e969c6d1db490b900850c09605cc1 Mon Sep 17 00:00:00 2001 From: benbierens Date: Fri, 10 Nov 2023 15:28:53 +0100 Subject: [PATCH] Adds test-type to STATUS log jsons. --- Tests/CodexContinuousTests/ContinuousTestRunner.cs | 2 +- Tests/DistTestCore/DistTest.cs | 2 +- Tests/DistTestCore/Logs/StatusLog.cs | 7 +++++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Tests/CodexContinuousTests/ContinuousTestRunner.cs b/Tests/CodexContinuousTests/ContinuousTestRunner.cs index 7e4ffd9..a7d709b 100644 --- a/Tests/CodexContinuousTests/ContinuousTestRunner.cs +++ b/Tests/CodexContinuousTests/ContinuousTestRunner.cs @@ -28,7 +28,7 @@ namespace ContinuousTests new FixtureLog(logConfig, startTime, "Overview"), new ConsoleLog() ); - var statusLog = new StatusLog(logConfig, startTime, "ContinuousTestRun"); + var statusLog = new StatusLog(logConfig, startTime, "continuous-tests", "ContinuousTestRun"); overviewLog.Log("Initializing..."); diff --git a/Tests/DistTestCore/DistTest.cs b/Tests/DistTestCore/DistTest.cs index 95e69a9..0cfdbe5 100644 --- a/Tests/DistTestCore/DistTest.cs +++ b/Tests/DistTestCore/DistTest.cs @@ -29,7 +29,7 @@ namespace DistTestCore var logConfig = configuration.GetLogConfig(); var startTime = DateTime.UtcNow; fixtureLog = new FixtureLog(logConfig, startTime); - statusLog = new StatusLog(logConfig, startTime); + statusLog = new StatusLog(logConfig, startTime, "dist-tests"); globalEntryPoint = new EntryPoint(fixtureLog, configuration.GetK8sConfiguration(new DefaultTimeSet(), TestNamespacePrefix), configuration.GetFileManagerFolder()); diff --git a/Tests/DistTestCore/Logs/StatusLog.cs b/Tests/DistTestCore/Logs/StatusLog.cs index b7ce891..7a6f207 100644 --- a/Tests/DistTestCore/Logs/StatusLog.cs +++ b/Tests/DistTestCore/Logs/StatusLog.cs @@ -8,11 +8,13 @@ namespace DistTestCore.Logs private readonly object fileLock = new object(); private readonly string fullName; private readonly string fixtureName; + private readonly string testType; - public StatusLog(LogConfig config, DateTime start, string name = "") + public StatusLog(LogConfig config, DateTime start, string testType, string name = "") { fullName = NameUtils.GetFixtureFullName(config, start, name) + "_STATUS.log"; fixtureName = NameUtils.GetRawFixtureName(); + this.testType = testType; } public void ConcludeTest(string resultStatus, string testDuration, Dictionary data) @@ -20,10 +22,11 @@ namespace DistTestCore.Logs data.Add("timestamp", DateTime.UtcNow.ToString("o")); data.Add("runid", NameUtils.GetRunId()); data.Add("status", resultStatus); - data.Add("testid", NameUtils.GetTestId()); data.Add("category", NameUtils.GetCategoryName()); data.Add("fixturename", fixtureName); + data.Add("testid", NameUtils.GetTestId()); data.Add("testname", NameUtils.GetTestMethodName()); + data.Add("testtype", testType); data.Add("testduration", testDuration); Write(data); }