Skip to content

Commit f487f02

Browse files
author
Sergey Brenko
authored
Merge pull request #55 from zebrunner/test-groups
Tracked test groups
2 parents 155c721 + 6fee0c4 commit f487f02

File tree

3 files changed

+24
-2
lines changed

3 files changed

+24
-2
lines changed

src/main/java/com/zebrunner/agent/core/registrar/ReportingRegistrar.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,7 @@ public void registerTestStart(String id, TestStartDescriptor ts) {
183183
.maintainer(maintainerResolver.resolve(ts.getTestClass(), ts.getTestMethod()))
184184
.startedAt(ts.getStartedAt())
185185
.labels(labelResolver.resolve(ts.getTestClass(), ts.getTestMethod()))
186+
.testGroups(ts.getTestGroups())
186187
.build();
187188

188189
Long headlessTestId = RunContext.getCurrentTest()

src/main/java/com/zebrunner/agent/core/registrar/descriptor/TestStartDescriptor.java

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,24 @@
11
package com.zebrunner.agent.core.registrar.descriptor;
22

3+
import lombok.AllArgsConstructor;
4+
import lombok.Builder;
35
import lombok.Getter;
46
import lombok.RequiredArgsConstructor;
57
import lombok.Setter;
68
import lombok.ToString;
79

810
import java.lang.reflect.Method;
911
import java.time.OffsetDateTime;
12+
import java.util.List;
1013

1114
/**
1215
* Descriptor of test start event. Captures initial test data, such as its name, class and corresponding method,
1316
* test maintainer and start time
1417
*/
1518
@Getter
19+
@Builder
1620
@ToString
21+
@AllArgsConstructor
1722
@RequiredArgsConstructor
1823
public class TestStartDescriptor {
1924

@@ -61,8 +66,23 @@ public class TestStartDescriptor {
6166
*/
6267
private final Integer argumentsIndex;
6368

64-
public TestStartDescriptor(String uuid, String name, Class<?> testClass, Method testMethod, Integer argumentsIndex) {
65-
this(uuid, name, OffsetDateTime.now(), testClass, testMethod, argumentsIndex);
69+
/**
70+
* Test groups that test belongs to. Test groups allow you to group tests depending on specific criteria and manage them
71+
* more effectively.
72+
*/
73+
private final List<String> testGroups;
74+
75+
public TestStartDescriptor(String correlationData, String name, Class<?> testClass, Method testMethod, Integer argumentsIndex) {
76+
this(correlationData, name, OffsetDateTime.now(), testClass, testMethod, argumentsIndex, List.of());
77+
}
78+
79+
public TestStartDescriptor(String correlationData,
80+
String name,
81+
OffsetDateTime startedAt,
82+
Class<?> testClass,
83+
Method testMethod,
84+
Integer argumentsIndex) {
85+
this(correlationData, name, startedAt, testClass, testMethod, argumentsIndex, List.of());
6686
}
6787

6888
}

src/main/java/com/zebrunner/agent/core/registrar/domain/TestDTO.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ public class TestDTO {
2727
private String maintainer;
2828
private List<LabelDTO> labels;
2929
private List<ArtifactReferenceDTO> artifactReferences;
30+
private List<String> testGroups;
3031
private String result;
3132
private String reason;
3233

0 commit comments

Comments
 (0)