1
1
package com .zebrunner .agent .core .config ;
2
2
3
+ import com .zebrunner .agent .core .config .annotation .Configuration ;
4
+ import com .zebrunner .agent .core .config .annotation .EnvironmentVariable ;
5
+ import com .zebrunner .agent .core .config .annotation .PropertiesFileProperty ;
6
+ import com .zebrunner .agent .core .config .annotation .SystemProperty ;
7
+ import com .zebrunner .agent .core .config .annotation .YamlProperty ;
3
8
import lombok .AllArgsConstructor ;
4
9
import lombok .Builder ;
5
10
import lombok .Data ;
10
15
@ Getter
11
16
@ Setter
12
17
@ Builder
18
+ @ NoArgsConstructor
19
+ @ AllArgsConstructor
13
20
public class ReportingConfiguration {
14
21
22
+ @ YamlProperty ("reporting.enabled" )
23
+ @ SystemProperty ("reporting.enabled" )
24
+ @ EnvironmentVariable ("REPORTING_ENABLED" )
25
+ @ PropertiesFileProperty ("reporting.enabled" )
15
26
private Boolean reportingEnabled ;
27
+
28
+ @ EnvironmentVariable ("REPORTING_PROJECT_KEY" )
29
+ @ YamlProperty ({"reporting.project-key" , "reporting.projectKey" })
30
+ @ SystemProperty ({"reporting.project-key" , "reporting.projectKey" })
31
+ @ PropertiesFileProperty ({"reporting.project-key" , "reporting.projectKey" })
16
32
private String projectKey ;
33
+
34
+ @ Configuration
17
35
private ServerConfiguration server ;
36
+
37
+ @ Configuration
18
38
private RunConfiguration run ;
39
+
40
+ @ Configuration
19
41
private MilestoneConfiguration milestone ;
42
+
43
+ @ Configuration
20
44
private NotificationConfiguration notification ;
45
+
46
+ @ Configuration
21
47
private TcmConfiguration tcm ;
22
48
23
49
public boolean isReportingEnabled () {
@@ -29,7 +55,16 @@ public boolean isReportingEnabled() {
29
55
@ AllArgsConstructor
30
56
public static class MilestoneConfiguration {
31
57
58
+ @ YamlProperty ("reporting.milestone.id" )
59
+ @ SystemProperty ("reporting.milestone.id" )
60
+ @ EnvironmentVariable ("REPORTING_MILESTONE_ID" )
61
+ @ PropertiesFileProperty ("reporting.milestone.id" )
32
62
private Long id ;
63
+
64
+ @ YamlProperty ("reporting.milestone.name" )
65
+ @ SystemProperty ("reporting.milestone.name" )
66
+ @ EnvironmentVariable ("REPORTING_MILESTONE_NAME" )
67
+ @ PropertiesFileProperty ("reporting.milestone.name" )
33
68
private String name ;
34
69
35
70
}
@@ -40,7 +75,16 @@ public static class MilestoneConfiguration {
40
75
@ AllArgsConstructor
41
76
public static class ServerConfiguration {
42
77
78
+ @ YamlProperty ("reporting.server.hostname" )
79
+ @ SystemProperty ("reporting.server.hostname" )
80
+ @ EnvironmentVariable ("REPORTING_SERVER_HOSTNAME" )
81
+ @ PropertiesFileProperty ("reporting.server.hostname" )
43
82
private String hostname ;
83
+
84
+ @ YamlProperty ("reporting.server.access-token" )
85
+ @ EnvironmentVariable ("REPORTING_SERVER_ACCESS_TOKEN" )
86
+ @ PropertiesFileProperty ("reporting.server.access-token" )
87
+ @ SystemProperty ({"reporting.server.access-token" , "reporting.server.accessToken" })
44
88
private String accessToken ;
45
89
46
90
}
@@ -51,12 +95,43 @@ public static class ServerConfiguration {
51
95
@ AllArgsConstructor
52
96
public static class RunConfiguration {
53
97
98
+ @ EnvironmentVariable ("REPORTING_RUN_DISPLAY_NAME" )
99
+ @ YamlProperty ({"reporting.run.display-name" , "reporting.run.displayName" })
100
+ @ SystemProperty ({"reporting.run.display-name" , "reporting.run.displayName" })
101
+ @ PropertiesFileProperty ({"reporting.run.display-name" , "reporting.run.displayName" })
54
102
private String displayName ;
103
+
104
+ @ YamlProperty ("reporting.run.build" )
105
+ @ SystemProperty ("reporting.run.build" )
106
+ @ EnvironmentVariable ("REPORTING_RUN_BUILD" )
107
+ @ PropertiesFileProperty ("reporting.run.build" )
55
108
private String build ;
109
+
110
+ @ YamlProperty ("reporting.run.environment" )
111
+ @ SystemProperty ("reporting.run.environment" )
112
+ @ EnvironmentVariable ("REPORTING_RUN_ENVIRONMENT" )
113
+ @ PropertiesFileProperty ("reporting.run.environment" )
56
114
private String environment ;
115
+
116
+ @ YamlProperty ("reporting.run.context" )
117
+ @ SystemProperty ("reporting.run.context" )
118
+ @ EnvironmentVariable ("REPORTING_RUN_CONTEXT" )
119
+ @ PropertiesFileProperty ("reporting.run.context" )
57
120
private String context ;
121
+
122
+ @ YamlProperty ("reporting.run.retry-known-issues" )
123
+ @ EnvironmentVariable ("REPORTING_RUN_RETRY_KNOWN_ISSUES" )
124
+ @ PropertiesFileProperty ("reporting.run.retry-known-issues" )
125
+ @ SystemProperty ({"reporting.run.retry-known-issues" , "reporting.run.retryKnownIssues" })
58
126
private Boolean retryKnownIssues ;
127
+
128
+ @ EnvironmentVariable ("REPORTING_RUN_SUBSTITUTE_REMOTE_WEB_DRIVERS" )
59
129
private Boolean substituteRemoteWebDrivers ;
130
+
131
+ @ YamlProperty ("reporting.run.treat-skips-as-failures" )
132
+ @ SystemProperty ("reporting.run.treat-skips-as-failures" )
133
+ @ EnvironmentVariable ("REPORTING_RUN_TREAT_SKIPS_AS_FAILURES" )
134
+ @ PropertiesFileProperty ("reporting.run.treat-skips-as-failures" )
60
135
private Boolean treatSkipsAsFailures ;
61
136
62
137
}
@@ -66,10 +141,34 @@ public static class RunConfiguration {
66
141
@ AllArgsConstructor
67
142
public static class NotificationConfiguration {
68
143
144
+ @ YamlProperty ("reporting.notification.enabled" )
145
+ @ SystemProperty ("reporting.notification.enabled" )
146
+ @ EnvironmentVariable ("REPORTING_NOTIFICATION_ENABLED" )
147
+ @ PropertiesFileProperty ("reporting.notification.enabled" )
69
148
private Boolean enabled ;
149
+
150
+ @ YamlProperty ("reporting.notification.notify-on-each-failure" )
151
+ @ SystemProperty ("reporting.notification.notify-on-each-failure" )
152
+ @ EnvironmentVariable ("REPORTING_NOTIFICATION_NOTIFY_ON_EACH_FAILURE" )
153
+ @ PropertiesFileProperty ("reporting.notification.notify-on-each-failure" )
70
154
private Boolean notifyOnEachFailure ;
155
+
156
+ @ YamlProperty ("reporting.notification.slack-channels" )
157
+ @ SystemProperty ("reporting.notification.slack-channels" )
158
+ @ EnvironmentVariable ("REPORTING_NOTIFICATION_SLACK_CHANNELS" )
159
+ @ PropertiesFileProperty ("reporting.notification.slack-channels" )
71
160
private String slackChannels ;
161
+
162
+ @ YamlProperty ("reporting.notification.ms-teams-channels" )
163
+ @ SystemProperty ("reporting.notification.ms-teams-channels" )
164
+ @ EnvironmentVariable ("REPORTING_NOTIFICATION_MS_TEAMS_CHANNELS" )
165
+ @ PropertiesFileProperty ("reporting.notification.ms-teams-channels" )
72
166
private String msTeamsChannels ;
167
+
168
+ @ YamlProperty ("reporting.notification.emails" )
169
+ @ SystemProperty ("reporting.notification.emails" )
170
+ @ EnvironmentVariable ("REPORTING_NOTIFICATION_EMAILS" )
171
+ @ PropertiesFileProperty ("reporting.notification.emails" )
73
172
private String emails ;
74
173
75
174
}
@@ -80,10 +179,15 @@ public static class NotificationConfiguration {
80
179
@ AllArgsConstructor
81
180
public static class TcmConfiguration {
82
181
182
+ @ Configuration
83
183
private TestCaseStatus testCaseStatus = new TestCaseStatus ();
184
+ @ Configuration
84
185
private Zebrunner zebrunner = new Zebrunner ();
186
+ @ Configuration
85
187
private TestRail testRail = new TestRail ();
188
+ @ Configuration
86
189
private Xray xray = new Xray ();
190
+ @ Configuration
87
191
private Zephyr zephyr = new Zephyr ();
88
192
89
193
@ Getter
@@ -92,8 +196,22 @@ public static class TcmConfiguration {
92
196
@ AllArgsConstructor
93
197
public static class TestCaseStatus {
94
198
199
+ @ YamlProperty ("reporting.tcm.test-case-status.on-pass" )
200
+ @ SystemProperty ("reporting.tcm.test-case-status.on-pass" )
201
+ @ EnvironmentVariable ("REPORTING_TCM_TEST_CASE_STATUS_ON_PASS" )
202
+ @ PropertiesFileProperty ("reporting.tcm.test-case-status.on-pass" )
95
203
private String onPass ;
204
+
205
+ @ YamlProperty ("reporting.tcm.test-case-status.on-fail" )
206
+ @ SystemProperty ("reporting.tcm.test-case-status.on-fail" )
207
+ @ EnvironmentVariable ("REPORTING_TCM_TEST_CASE_STATUS_ON_FAIL" )
208
+ @ PropertiesFileProperty ("reporting.tcm.test-case-status.on-fail" )
96
209
private String onFail ;
210
+
211
+ @ YamlProperty ("reporting.tcm.test-case-status.on-skip" )
212
+ @ SystemProperty ("reporting.tcm.test-case-status.on-skip" )
213
+ @ EnvironmentVariable ("REPORTING_TCM_TEST_CASE_STATUS_ON_SKIP" )
214
+ @ PropertiesFileProperty ("reporting.tcm.test-case-status.on-skip" )
97
215
private String onSkip ;
98
216
99
217
}
@@ -104,8 +222,22 @@ public static class TestCaseStatus {
104
222
@ AllArgsConstructor
105
223
public static class Zebrunner {
106
224
225
+ @ YamlProperty ("reporting.tcm.zebrunner.push-results" )
226
+ @ SystemProperty ("reporting.tcm.zebrunner.push-results" )
227
+ @ EnvironmentVariable ("REPORTING_TCM_ZEBRUNNER_PUSH_RESULTS" )
228
+ @ PropertiesFileProperty ("reporting.tcm.zebrunner.push-results" )
107
229
private Boolean pushResults ;
230
+
231
+ @ YamlProperty ("reporting.tcm.zebrunner.push-in-real-time" )
232
+ @ SystemProperty ("reporting.tcm.zebrunner.push-in-real-time" )
233
+ @ EnvironmentVariable ("REPORTING_TCM_ZEBRUNNER_PUSH_IN_REAL_TIME" )
234
+ @ PropertiesFileProperty ("reporting.tcm.zebrunner.push-in-real-time" )
108
235
private Boolean pushInRealTime ;
236
+
237
+ @ EnvironmentVariable ("REPORTING_TCM_ZEBRUNNER_RUN_ID" )
238
+ @ YamlProperty ({"reporting.tcm.zebrunner.test-run-id" , "reporting.tcm.zebrunner.run-id" })
239
+ @ SystemProperty ({"reporting.tcm.zebrunner.test-run-id" , "reporting.tcm.zebrunner.run-id" })
240
+ @ PropertiesFileProperty ({"reporting.tcm.zebrunner.test-run-id" , "reporting.tcm.zebrunner.run-id" })
109
241
private String testRunId ;
110
242
111
243
}
@@ -117,13 +249,52 @@ public static class Zebrunner {
117
249
@ AllArgsConstructor
118
250
public static class TestRail {
119
251
252
+ @ YamlProperty ("reporting.tcm.test-rail.push-results" )
253
+ @ SystemProperty ("reporting.tcm.test-rail.push-results" )
254
+ @ EnvironmentVariable ("REPORTING_TCM_TEST_RAIL_PUSH_RESULTS" )
255
+ @ PropertiesFileProperty ("reporting.tcm.test-rail.push-results" )
120
256
private Boolean pushResults ;
257
+
258
+ @ YamlProperty ("reporting.tcm.test-rail.push-in-real-time" )
259
+ @ SystemProperty ("reporting.tcm.test-rail.push-in-real-time" )
260
+ @ EnvironmentVariable ("REPORTING_TCM_TEST_RAIL_PUSH_IN_REAL_TIME" )
261
+ @ PropertiesFileProperty ("reporting.tcm.test-rail.push-in-real-time" )
121
262
private Boolean pushInRealTime ;
263
+
264
+ @ YamlProperty ("reporting.tcm.test-rail.suite-id" )
265
+ @ SystemProperty ("reporting.tcm.test-rail.suite-id" )
266
+ @ EnvironmentVariable ("REPORTING_TCM_TEST_RAIL_SUITE_ID" )
267
+ @ PropertiesFileProperty ("reporting.tcm.test-rail.suite-id" )
122
268
private String suiteId ;
269
+
270
+ @ YamlProperty ("reporting.tcm.test-rail.run-id" )
271
+ @ SystemProperty ("reporting.tcm.test-rail.run-id" )
272
+ @ EnvironmentVariable ("REPORTING_TCM_TEST_RAIL_RUN_ID" )
273
+ @ PropertiesFileProperty ("reporting.tcm.test-rail.run-id" )
123
274
private String runId ;
275
+
276
+ @ YamlProperty ("reporting.tcm.test-rail.include-all-test-cases-in-new-run" )
277
+ @ SystemProperty ("reporting.tcm.test-rail.include-all-test-cases-in-new-run" )
278
+ @ EnvironmentVariable ("REPORTING_TCM_TEST_RAIL_INCLUDE_ALL_TEST_CASES_IN_NEW_RUN" )
279
+ @ PropertiesFileProperty ("reporting.tcm.test-rail.include-all-test-cases-in-new-run" )
124
280
private Boolean includeAllTestCasesInNewRun ;
281
+
282
+ @ YamlProperty ("reporting.tcm.test-rail.run-name" )
283
+ @ SystemProperty ("reporting.tcm.test-rail.run-name" )
284
+ @ EnvironmentVariable ("REPORTING_TCM_TEST_RAIL_RUN_NAME" )
285
+ @ PropertiesFileProperty ("reporting.tcm.test-rail.run-name" )
125
286
private String runName ;
287
+
288
+ @ YamlProperty ("reporting.tcm.test-rail.milestone-name" )
289
+ @ SystemProperty ("reporting.tcm.test-rail.milestone-name" )
290
+ @ EnvironmentVariable ("REPORTING_TCM_TEST_RAIL_MILESTONE_NAME" )
291
+ @ PropertiesFileProperty ("reporting.tcm.test-rail.milestone-name" )
126
292
private String milestoneName ;
293
+
294
+ @ YamlProperty ("reporting.tcm.test-rail.assignee" )
295
+ @ SystemProperty ("reporting.tcm.test-rail.assignee" )
296
+ @ EnvironmentVariable ("REPORTING_TCM_TEST_RAIL_ASSIGNEE" )
297
+ @ PropertiesFileProperty ("reporting.tcm.test-rail.assignee" )
127
298
private String assignee ;
128
299
129
300
}
@@ -134,8 +305,22 @@ public static class TestRail {
134
305
@ AllArgsConstructor
135
306
public static class Xray {
136
307
308
+ @ YamlProperty ("reporting.tcm.xray.push-results" )
309
+ @ SystemProperty ("reporting.tcm.xray.push-results" )
310
+ @ EnvironmentVariable ("REPORTING_TCM_XRAY_PUSH_RESULTS" )
311
+ @ PropertiesFileProperty ("reporting.tcm.xray.push-results" )
137
312
private Boolean pushResults ;
313
+
314
+ @ YamlProperty ("reporting.tcm.xray.push-in-real-time" )
315
+ @ SystemProperty ("reporting.tcm.xray.push-in-real-time" )
316
+ @ EnvironmentVariable ("REPORTING_TCM_XRAY_PUSH_IN_REAL_TIME" )
317
+ @ PropertiesFileProperty ("reporting.tcm.xray.push-in-real-time" )
138
318
private Boolean pushInRealTime ;
319
+
320
+ @ YamlProperty ("reporting.tcm.xray.execution-key" )
321
+ @ SystemProperty ("reporting.tcm.xray.execution-key" )
322
+ @ EnvironmentVariable ("REPORTING_TCM_XRAY_EXECUTION_KEY" )
323
+ @ PropertiesFileProperty ("reporting.tcm.xray.execution-key" )
139
324
private String executionKey ;
140
325
141
326
}
@@ -146,9 +331,28 @@ public static class Xray {
146
331
@ AllArgsConstructor
147
332
public static class Zephyr {
148
333
334
+ @ YamlProperty ("reporting.tcm.zephyr.push-results" )
335
+ @ SystemProperty ("reporting.tcm.zephyr.push-results" )
336
+ @ EnvironmentVariable ("REPORTING_TCM_ZEPHYR_PUSH_RESULTS" )
337
+ @ PropertiesFileProperty ("reporting.tcm.zephyr.push-results" )
149
338
private Boolean pushResults ;
339
+
340
+ @ YamlProperty ("reporting.tcm.zephyr.push-in-real-time" )
341
+ @ SystemProperty ("reporting.tcm.zephyr.push-in-real-time" )
342
+ @ EnvironmentVariable ("REPORTING_TCM_ZEPHYR_PUSH_IN_REAL_TIME" )
343
+ @ PropertiesFileProperty ("reporting.tcm.zephyr.push-in-real-time" )
150
344
private Boolean pushInRealTime ;
345
+
346
+ @ YamlProperty ("reporting.tcm.zephyr.jira-project-key" )
347
+ @ SystemProperty ("reporting.tcm.zephyr.jira-project-key" )
348
+ @ EnvironmentVariable ("REPORTING_TCM_ZEPHYR_JIRA_PROJECT_KEY" )
349
+ @ PropertiesFileProperty ("reporting.tcm.zephyr.jira-project-key" )
151
350
private String jiraProjectKey ;
351
+
352
+ @ YamlProperty ("reporting.tcm.zephyr.test-cycle-key" )
353
+ @ SystemProperty ("reporting.tcm.zephyr.test-cycle-key" )
354
+ @ EnvironmentVariable ("REPORTING_TCM_ZEPHYR_TEST_CYCLE_KEY" )
355
+ @ PropertiesFileProperty ("reporting.tcm.zephyr.test-cycle-key" )
152
356
private String testCycleKey ;
153
357
154
358
}
0 commit comments