From d29a293ece7ad824da0708d82b6da7b8d690628b Mon Sep 17 00:00:00 2001 From: Matt Date: Sat, 14 Oct 2023 21:09:53 +0100 Subject: [PATCH] Add test case run id field generated from run id and test case unique id --- src/KiBoards.Xunit/Models/KiBoardsTestCaseRun.cs | 3 ++- src/KiBoards.Xunit/Services/KiBoardsTestRunner.cs | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/KiBoards.Xunit/Models/KiBoardsTestCaseRun.cs b/src/KiBoards.Xunit/Models/KiBoardsTestCaseRun.cs index 6908aaa..52dc4ad 100644 --- a/src/KiBoards.Xunit/Models/KiBoardsTestCaseRun.cs +++ b/src/KiBoards.Xunit/Models/KiBoardsTestCaseRun.cs @@ -2,12 +2,13 @@ { class KiBoardsTestCaseRun { + public string Id { get; internal set; } public TestRun TestRun { get; set; } public KiBoardsTestCase TestCase { get; set; } public KiBoardsTestCaseRunSkipped Skipped { get; set; } public KiBoardsTestCaseRunFailed Failed { get; set; } public decimal ExecutionTime { get; set; } public string Status { get; set; } - public string Output { get; set; } + public string Output { get; set; } } } diff --git a/src/KiBoards.Xunit/Services/KiBoardsTestRunner.cs b/src/KiBoards.Xunit/Services/KiBoardsTestRunner.cs index 5ab7822..356b3ef 100644 --- a/src/KiBoards.Xunit/Services/KiBoardsTestRunner.cs +++ b/src/KiBoards.Xunit/Services/KiBoardsTestRunner.cs @@ -42,6 +42,7 @@ public async Task IndexTestCaseRunAsync(ITestResultMessage testResult) { await _elasticService.IndexDocumentAsync(new KiBoardsTestCaseRun() { + Id = (TestFramework.TestRun.Id + testResult.TestCase.UniqueID).ComputeMD5(), TestRun = TestFramework.TestRun, ExecutionTime = testResult.ExecutionTime, Output = testResult.Output,