Adds test-type to STATUS log jsons.

This commit is contained in:
benbierens 2023-11-10 15:28:53 +01:00
parent 096282ae1a
commit b78f527c39
No known key found for this signature in database
GPG Key ID: FE44815D96D0A1AA
3 changed files with 7 additions and 4 deletions

View File

@ -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...");

View File

@ -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());

View File

@ -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<string, string> 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);
}