-
Notifications
You must be signed in to change notification settings - Fork 67
/
tests.yaml
350 lines (334 loc) 路 9 KB
/
tests.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
openapi: 3.0.0
components:
schemas:
Test:
type: object
properties:
id:
type: string
readOnly: true
name:
type: string
description:
type: string
version:
type: integer
description: version number of the test
createdAt:
type: string
format: date-time
serviceUnderTest:
$ref: "./triggers.yaml#/components/schemas/Trigger"
specs:
$ref: "#/components/schemas/TestSpecs"
description: specification of assertions that are going to be made
outputs:
description: define test outputs, in a key/value format. The value is processed as an expression
type: array
items:
$ref: "#/components/schemas/TestOutput"
example:
- name: USER_ID
selector: span[name="user_signup" result="success"]
value: "attr:myapp.signup.user_id"
- name: PROFILE_URL
selector: span[tracetest.span.type="general" name="Tracetest trigger"]
value: "${attr:tracetest.response.body | json_path '.user.profileUrl' }"
summary:
$ref: "#/components/schemas/TestSummary"
description: summary of test data
readOnly: true
TestOutput:
type: object
properties:
name:
type: string
selector:
$ref: "#/components/schemas/Selector"
value:
type: string
TestSummary:
type: object
properties:
runs:
type: integer
readOnly: true
lastRun:
type: object
readOnly: true
properties:
time:
type: string
format: date-time
nullable: true
passes:
type: integer
readOnly: true
fails:
type: integer
readOnly: true
TestSpecs:
type: object
properties:
specs:
type: array
items:
type: object
properties:
name:
type: string
nullable: true
selector:
$ref: "#/components/schemas/Selector"
assertions:
type: array
items:
type: string
example:
specs:
- selector:
query: span[tracetest.span.type="http"]
structure:
- filters:
- property: tracetest.span.type
operator: "="
value: http
assertions:
- attribute: tracetest.span.duration
comparator: "<"
expected: "2000"
- attribute: http.status_code
comparator: "="
expected: "200"
TestRun:
type: object
properties:
id:
type: string
readOnly: true
traceId:
type: string
readOnly: true
spanId:
type: string
readOnly: true
testVersion:
type: integer
description: Test version used when running this test run
state:
type: string
enum:
[
CREATED,
EXECUTING,
AWAITING_TRACE,
AWAITING_TEST_RESULTS,
FINISHED,
STOPPED,
TRIGGER_FAILED,
TRACE_FAILED,
ASSERTION_FAILED,
]
description: Current execution state
lastErrorState:
type: string
description: Details of the cause for the last `FAILED` state
executionTime:
type: integer
description: time in seconds it took for the test to complete, either success or fail. If the test is still running, it will show the time up to the time of the request
triggerTime:
type: integer
description: time in milliseconds it took for the triggering transaction to complete, either success or fail. If the test is still running, it will show the time up to the time of the request
createdAt:
type: string
format: date-time
serviceTriggeredAt:
type: string
format: date-time
serviceTriggerCompletedAt:
type: string
format: date-time
obtainedTraceAt:
type: string
format: date-time
completedAt:
type: string
format: date-time
environment:
$ref: "./environments.yaml#/components/schemas/Environment"
triggerResult:
$ref: "./triggers.yaml#/components/schemas/TriggerResult"
trace:
$ref: "./trace.yaml#/components/schemas/Trace"
result:
$ref: "#/components/schemas/AssertionResults"
outputs:
type: array
items:
type: object
properties:
name:
type: string
spanId:
type: string
value:
type: string
metadata:
type: object
additionalProperties:
type: string
transactionId:
type: string
transactionRunId:
type: string
RunInformation:
type: object
properties:
metadata:
type: object
nullable: true
additionalProperties:
type: string
environmentId:
type: string
variables:
type: array
items:
$ref: "./environments.yaml#/components/schemas/EnvironmentValue"
AssertionResults:
type: object
properties:
allPassed:
type: boolean
results:
type: array
items:
type: object
properties:
selector:
$ref: "#/components/schemas/Selector"
results:
type: array
items:
$ref: "#/components/schemas/AssertionResult"
example:
allPassed: true
results:
- selector:
query: span[tracetest.span.type="http"]
structure:
- filters:
- property: tracetest.span.type
operator: "="
value: http
results:
- assertion:
attribute: http.status_code
comparator: "="
expected: "200"
allPassed: true
spanResults:
- spanId: "123"
observedValue: "test"
passed: true
- assertion:
attribute: http.status_code
comparator: "="
expected: "200"
allPassed: true
spanResults:
- spanId: "123"
observedValue: "test"
passed: true
AssertionResult:
type: object
properties:
assertion:
type: string
allPassed:
type: boolean
spanResults:
type: array
items:
$ref: "#/components/schemas/AssertionSpanResult"
AssertionSpanResult:
type: object
properties:
spanId:
type: string
observedValue:
type: string
passed:
type: boolean
error:
type: string
DefinitionFile:
type: object
properties:
content:
type: string
SelectedSpansResult:
type: object
properties:
selector:
$ref: "#/components/schemas/Selector"
spanIds:
type: array
items:
type: string
Selector:
type: object
properties:
query:
type: string
structure:
type: array
items:
$ref: "#/components/schemas/SpanSelector"
SpanSelector:
type: object
nullable: true
required:
- filters
properties:
filters:
type: array
items:
$ref: "#/components/schemas/SelectorFilter"
pseudoClass:
$ref: "#/components/schemas/SelectorPseudoClass"
childSelector:
$ref: "#/components/schemas/SpanSelector"
SelectorFilter:
type: object
required:
- property
- operator
- value
properties:
property:
type: string
operator:
type: string
value:
type: string
SelectorPseudoClass:
type: object
nullable: true
required:
- name
properties:
name:
type: string
argument:
type: integer
ExportedTestInformation:
type: object
required:
- test
- run
properties:
test:
$ref: "#/components/schemas/Test"
run:
$ref: "#/components/schemas/TestRun"