forked from Qovery/documentation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtests.toml
184 lines (160 loc) · 5.06 KB
/
tests.toml
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
[tests]
type = "[table]"
common = true
required = true
description = "A table that defines a unit test."
[tests.children.name]
type = "string"
examples = ["foo test"]
common = true
required = true
description = "A unique identifier for this test."
[tests.children.inputs]
type = "[table]"
common = true
required = true
toml_display = "normal"
description = "A table that defines a unit test input event."
[tests.children.inputs.children.insert_at]
type = "string"
examples = ["foo"]
common = true
required = true
description = """\
The name of a transform, the input event will be delivered to this transform in \
order to begin the test.\
"""
[tests.children.inputs.children.type]
type = "string"
required = true
common = true
description = "The event type."
[tests.children.inputs.children.type.enum]
raw = "Creates a log event where the message contents are specified in the field 'value'."
log = "Creates a log event where log fields are specified in the table 'log_fields'."
metric = "Creates a metric event, where its type and fields are specified in the table 'metric'."
[tests.children.inputs.children.value]
type = "string"
common = true
examples = ["some message contents"]
relevant_when = {type = "raw"}
required = true
description = "Specifies the log message field contents when the input type is 'raw'."
[tests.children.inputs.children.log_fields]
type = "table"
common = false
relevant_when = {type = "log"}
required = true
description = "Specifies the log fields when the input type is 'log'."
[tests.children.inputs.children.log_fields.children."`[field-name]`"]
type = "*"
examples = [
{message = "some message contents"},
{host = "myhost"},
]
required = true
description = """\
A key/value pair representing a field to be added to the input event.\
"""
[tests.children.inputs.children.metric]
type = "table"
common = false
relevant_when = {type = "metric"}
required = true
description = "Specifies the metric type when the input type is 'metric'."
[tests.children.inputs.children.metric.children.type]
type = "string"
required = true
common = true
description = "The metric type."
[tests.children.inputs.children.metric.children.type.enum]
counter = "A [counter metric type][docs.quickstart.metric#counter]."
gauge = "A [gauge metric type][docs.quickstart.metric#gauge]."
histogram = "A [distribution metric type][docs.quickstart.metric#distribution]."
set = "A [set metric type][docs.quickstart.metric#set]."
[tests.children.inputs.children.metric.children.name]
type = "string"
examples = ["duration_total"]
required = true
common = true
description = """\
The name of the metric. Defaults to `<field>_total` for `counter` and \
`<field>` for `gauge`.\
"""
[tests.children.inputs.children.metric.children.tags]
type = "table"
common = true
description = "Key/value pairs representing [metric tags][docs.quickstart.metric#tags]."
[tests.children.inputs.children.metric.children.tags.children."`[tag-name]`"]
type = "string"
examples = [
{host = "foohost"},
{region = "us-east-1"},
]
required = true
common = true
description = """\
Key/value pairs representing [metric tags][docs.quickstart.metric#tags].\
"""
[tests.children.inputs.children.metric.children.val]
type = "float"
examples = [10.2]
required = true
description = """\
Amount to increment/decrement or gauge.\
"""
[tests.children.inputs.children.metric.children.timestamp]
type = "string"
examples = ["2019-11-01T21:15:47.443232Z"]
required = true
description = """\
Time metric was created/ingested.\
"""
[tests.children.inputs.children.metric.children.sample_rate]
type = "float"
examples = [1]
description = """\
The bucket/distribution the metric is a part of.\
"""
[tests.children.inputs.children.metric.children.direction]
type = "string"
description = """\
The direction to increase or decrease the gauge value.\
"""
[tests.children.inputs.children.metric.children.direction.enum]
plus = "Increase the gauge"
minus = "Decrease the gauge"
[tests.children.outputs]
type = "[table]"
common = true
required = true
toml_display = "normal"
description = "A table that defines a unit test expected output."
[tests.children.outputs.children.extract_from]
type = "string"
examples = ["foo"]
common = true
required = true
description = """\
The name of a transform, at the end of the test events extracted from this \
transform will be checked against a table of conditions.\
"""
[tests.children.outputs.children.conditions]
type = "[table]"
common = true
required = false
description = """\
A table that defines a collection of conditions to check against the output of a \
transform. A test is considered to have passed when each condition has resolved \
true for one or more events extracted from the target transform.\
\
An expected output without conditions instead prints the input and output of a \
target without checking its values.\
"""
<%= render("_partials/fields/_conditions_options.toml", namespace: "tests.children.outputs.children.conditions.children") %>
[tests.children.no_outputs_from]
type = "[string]"
common = false
required = true
description = "A list of transforms that must NOT output events in order for the test to pass."
examples = [["foo"]]