fix: test case summary update on test result PUT (#17053)

This commit is contained in:
Teddy 2024-07-17 18:47:33 +02:00 committed by GitHub
parent 080314955a
commit cbfdd54057
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -162,7 +162,7 @@ public class TestCaseRepository extends EntityRepository<TestCase> {
// set the test case result state in the test case entity if the state has changed // set the test case result state in the test case entity if the state has changed
if (!Objects.equals(original, updated)) { if (!Objects.equals(original, updated)) {
TestCase testCase = TestCase testCase =
Entity.getEntityByName(TEST_CASE, fqn, "testDefinition", Include.NON_DELETED); Entity.getEntityByName(TEST_CASE, fqn, "testDefinition,testSuites", Include.NON_DELETED);
setTestCaseResult(testCase, updated, false); setTestCaseResult(testCase, updated, false);
} }
@ -314,7 +314,8 @@ public class TestCaseRepository extends EntityRepository<TestCase> {
// Validate the request content // Validate the request content
TestCase testCase = findByName(fqn, Include.NON_DELETED); TestCase testCase = findByName(fqn, Include.NON_DELETED);
ArrayList<String> fields = ArrayList<String> fields =
new ArrayList<>(List.of("testDefinition", FIELD_OWNER, FIELD_TAGS, TEST_SUITE_FIELD)); new ArrayList<>(
List.of("testDefinition", FIELD_OWNER, FIELD_TAGS, TEST_SUITE_FIELD, "testSuites"));
// set the test case resolution status reference if test failed, by either // set the test case resolution status reference if test failed, by either
// creating a new incident or returning the stateId of an unresolved incident // creating a new incident or returning the stateId of an unresolved incident
@ -426,7 +427,7 @@ public class TestCaseRepository extends EntityRepository<TestCase> {
String updatedBy, String fqn, Long timestamp) { String updatedBy, String fqn, Long timestamp) {
// Validate the request content // Validate the request content
TestCase testCase = TestCase testCase =
Entity.getEntityByName(TEST_CASE, fqn, "testDefinition", Include.NON_DELETED); Entity.getEntityByName(TEST_CASE, fqn, "testDefinition,testSuites", Include.NON_DELETED);
TestCaseResult storedTestCaseResult = TestCaseResult storedTestCaseResult =
JsonUtils.readValue( JsonUtils.readValue(
daoCollection daoCollection