@@ -4,14 +4,30 @@ import { Schedule, User } from 'rosters';
4
4
import { ParseOptions } from 'test-results-parser' ;
5
5
import TestResult from 'test-results-parser/src/models/TestResult' ;
6
6
7
+ export interface ITarget {
8
+ name : TargetName ;
9
+ enable ?: string | boolean ;
10
+ condition ?: Condition ;
11
+ inputs ?: SlackInputs | TeamsInputs | ChatInputs | CustomTargetInputs | InfluxDBTargetInputs ;
12
+ extensions ?: IExtension [ ] ;
13
+ }
14
+
15
+ export interface IExtension {
16
+ name : ExtensionName ;
17
+ enable ?: string | boolean ;
18
+ condition ?: Condition ;
19
+ hook ?: Hook ;
20
+ inputs ?: ReportPortalAnalysisInputs | ReportPortalHistoryInputs | HyperlinkInputs | MentionInputs | QuickChartTestSummaryInputs | PercyAnalysisInputs | CustomExtensionInputs | MetadataInputs | CIInfoInputs | AIFailureSummaryInputs ;
21
+ }
22
+
7
23
export type ExtensionName = 'report-portal-analysis' | 'hyperlinks' | 'mentions' | 'report-portal-history' | 'quick-chart-test-summary' | 'metadata' | 'ci-info' | 'custom' | 'ai-failure-summary' ;
8
24
export type Hook = 'start' | 'end' | 'after-summary' ;
9
25
export type TargetName = 'slack' | 'teams' | 'chat' | 'custom' | 'delay' ;
10
26
export type PublishReportType = 'test-summary' | 'test-summary-slim' | 'failure-details' ;
11
27
12
28
export interface ConditionFunctionContext {
13
- target : Target ;
14
- extension ?: Extension ,
29
+ target : ITarget ;
30
+ extension ?: IExtension ,
15
31
result : TestResult ;
16
32
}
17
33
export type ConditionFunction = ( ctx : ConditionFunctionContext ) => boolean | Promise < boolean > ;
@@ -67,12 +83,7 @@ export interface AIFailureSummaryInputs extends ExtensionInputs {
67
83
failure_summary : string ;
68
84
}
69
85
70
- export interface Extension {
71
- name : ExtensionName ;
72
- condition ?: Condition ;
73
- hook ?: Hook ;
74
- inputs ?: ReportPortalAnalysisInputs | ReportPortalHistoryInputs | HyperlinkInputs | MentionInputs | QuickChartTestSummaryInputs | PercyAnalysisInputs | CustomExtensionInputs | MetadataInputs | CIInfoInputs | AIFailureSummaryInputs ;
75
- }
86
+
76
87
77
88
export interface PercyAnalysisInputs extends ExtensionInputs {
78
89
url ?: string ;
@@ -90,14 +101,14 @@ export interface PercyAnalysisOutputs {
90
101
project ?: object ;
91
102
}
92
103
93
- export interface PercyAnalysisExtension extends Extension {
104
+ export interface PercyAnalysisExtension extends IExtension {
94
105
inputs ?: PercyAnalysisInputs ;
95
106
outputs ?: PercyAnalysisOutputs ;
96
107
}
97
108
98
109
export interface CustomExtensionFunctionContext {
99
- target : Target ;
100
- extension : Extension ,
110
+ target : ITarget ;
111
+ extension : IExtension ,
101
112
result : TestResult ;
102
113
payload : any ;
103
114
root_payload : any ;
@@ -109,13 +120,13 @@ export interface CustomExtensionInputs extends ExtensionInputs {
109
120
load : string | CustomExtensionFunction ;
110
121
}
111
122
112
- export interface CustomExtension extends Extension {
123
+ export interface CustomExtension extends IExtension {
113
124
inputs ?: CustomExtensionInputs ;
114
125
outputs ?: any ;
115
126
}
116
127
117
128
export interface LinkUrlFunctionContext {
118
- target : Target ;
129
+ target : ITarget ;
119
130
extension : HyperlinksExtension ,
120
131
result : TestResult ;
121
132
}
@@ -132,7 +143,7 @@ export interface HyperlinkInputs extends ExtensionInputs {
132
143
links : Link [ ] ;
133
144
}
134
145
135
- export interface HyperlinksExtension extends Extension {
146
+ export interface HyperlinksExtension extends IExtension {
136
147
inputs ?: HyperlinkInputs ;
137
148
}
138
149
@@ -148,7 +159,7 @@ export interface MetadataInputs extends ExtensionInputs {
148
159
data ?: Metadata [ ] ;
149
160
}
150
161
151
- export interface MetadataExtension extends Extension {
162
+ export interface MetadataExtension extends IExtension {
152
163
inputs ?: MetadataInputs ;
153
164
}
154
165
@@ -202,7 +213,7 @@ export interface InfluxDBTargetInputs {
202
213
}
203
214
204
215
export interface CustomTargetFunctionContext {
205
- target : Target ;
216
+ target : ITarget ;
206
217
result : TestResult ;
207
218
}
208
219
@@ -212,12 +223,7 @@ export interface CustomTargetInputs {
212
223
load : string | CustomTargetFunction ;
213
224
}
214
225
215
- export interface Target {
216
- name : TargetName ;
217
- condition ?: Condition ;
218
- inputs ?: SlackInputs | TeamsInputs | ChatInputs | CustomTargetInputs | InfluxDBTargetInputs ;
219
- extensions ?: Extension [ ] ;
220
- }
226
+
221
227
222
228
export interface CustomResultOptions {
223
229
type : string ;
@@ -232,17 +238,17 @@ export interface PublishReport {
232
238
show_failure_analysis ?: boolean ;
233
239
show_smart_analysis ?: boolean ;
234
240
show_error_clusters ?: boolean ;
235
- targets ?: Target [ ] ;
236
- extensions ?: Extension [ ] ;
241
+ targets ?: ITarget [ ] ;
242
+ extensions ?: IExtension [ ] ;
237
243
results ?: ParseOptions [ ] | PerformanceParseOptions [ ] | CustomResultOptions [ ] ;
238
244
}
239
245
240
246
export interface PublishConfig {
241
247
api_key ?: string ;
242
248
project ?: string ;
243
249
run ?: string ;
244
- targets ?: Target [ ] ;
245
- extensions ?: Extension [ ] ;
250
+ targets ?: ITarget [ ] ;
251
+ extensions ?: IExtension [ ] ;
246
252
results ?: ParseOptions [ ] | PerformanceParseOptions [ ] | CustomResultOptions [ ] ;
247
253
}
248
254
0 commit comments