-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathregression.py
executable file
·232 lines (217 loc) · 8.07 KB
/
regression.py
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
#!/usr/bin/env python3
import os
import sys
from testflows.core import *
append_path(sys.path, "..")
from helpers.cluster import create_cluster
from helpers.common import experimental_analyzer
from helpers.argparser import argparser, CaptureClusterArgs
from datetime64_extended_range.requirements import *
from datetime64_extended_range.common import *
from datetime64_extended_range.requirements import RQ_SRS_010_DateTime64_ExtendedRange
# cross-outs
# https://github.com/ClickHouse/ClickHouse/issues/16581#issuecomment-804360350: 128 and 256-bit types are not supported for now
# https://github.com/ClickHouse/ClickHouse/issues/17079#issuecomment-783396589 : leap seconds unsupported
# https://github.com/ClickHouse/ClickHouse/issues/22824 : dateDiff not working woth dt64
# https://github.com/ClickHouse/ClickHouse/issues/22852 : formatDateTime wrong value
# https://github.com/ClickHouse/ClickHouse/issues/22854 : timeSlot(), toMonday() wrong when out of normal
# https://github.com/ClickHouse/ClickHouse/issues/16260 : timeSlots(), dateDiff() not working with DT64
# https://github.com/ClickHouse/ClickHouse/issues/22927#issuecomment-816574952 : toRelative...Num() wrong when out of normal range
# https://github.com/ClickHouse/ClickHouse/issues/22928 : toStartOf...() wrong when out of normal range
# https://github.com/ClickHouse/ClickHouse/issues/22929 : toUnixTimestamp() exception when out of normal
# https://github.com/ClickHouse/ClickHouse/issues/22930 : toWeek()
# https://github.com/ClickHouse/ClickHouse/issues/22948 : toYearWeek()
# https://github.com/ClickHouse/ClickHouse/issues/22959 : toUnixTimestamp64*() wrong fractal seconds treatment
# https://github.com/ClickHouse/ClickHouse/issues/34831 : DateTime64 to Arrow format mistreats negative timestamps
# For `reference times` test it is unclear how to evaluate correctness - majority of test cases are correct, and ONLY
# Juba and Monrovia timezones are damaged - probably, due to wrong DST shifts lookup tables
xfails = {
"type conversion/to int 8 16 32 64 128 256/:": [
(
Fail,
"https://github.com/ClickHouse/ClickHouse/issues/16581#issuecomment-804360350",
)
],
"type conversion/to uint 8 16 32 64 256/:": [
(
Fail,
"https://github.com/ClickHouse/ClickHouse/issues/16581#issuecomment-804360350",
)
],
"non existent time/leap seconds/:": [
(
Fail,
"https://github.com/ClickHouse/ClickHouse/issues/17079#issuecomment-783396589",
)
],
"date time funcs/format date time/:": [
(Fail, "https://github.com/ClickHouse/ClickHouse/issues/22852")
],
"date time funcs/time slot/:": [
(Fail, "https://github.com/ClickHouse/ClickHouse/issues/22854")
],
"date time funcs/to monday/:": [
(Fail, "https://github.com/ClickHouse/ClickHouse/issues/22854")
],
"date time funcs/time slots/:": [
(Fail, "https://github.com/ClickHouse/ClickHouse/issues/16260")
],
"date time funcs/to relative :/:": [
(
Fail,
"https://github.com/ClickHouse/ClickHouse/issues/22927#issuecomment-816574952",
)
],
"date time funcs/to start of :/:": [
(Fail, "https://github.com/ClickHouse/ClickHouse/issues/22928")
],
"date time funcs/to unix timestamp/:": [
(Fail, "https://github.com/ClickHouse/ClickHouse/issues/22929")
],
"date time funcs/to week/:": [
(Fail, "https://github.com/ClickHouse/ClickHouse/issues/22930")
],
"date time funcs/to year week/:": [
(Fail, "https://github.com/ClickHouse/ClickHouse/issues/22948")
],
"type conversion/to unix timestamp64 */:": [
(Fail, "https://github.com/ClickHouse/ClickHouse/issues/22959")
],
"type conversion/from unix timestamp64 */:": [
(Fail, "https://github.com/ClickHouse/ClickHouse/issues/22959")
],
"reference times/:": [(Fail, "check procedure unclear")],
"generic/transform/:": [
(Fail, "https://github.com/ClickHouse/ClickHouse/issues/32387")
],
"format conversion/arrow format/:": [
(Fail, "https://github.com/ClickHouse/ClickHouse/issues/34831")
],
"type conversion/to datetime/:": [(Fail, "needs to be investigated")],
"/datetime64 extended range/date time funcs/date diff/*1927-01-01*": [
(
Fail,
"https://github.com/ClickHouse/ClickHouse/pull/42308",
check_clickhouse_version("<22.9"),
)
],
"/datetime64 extended range/date time funcs/date diff/*1927-12-31*": [
(
Fail,
"https://github.com/ClickHouse/ClickHouse/pull/42308",
check_clickhouse_version("<22.9"),
)
],
"/datetime64 extended range/date time funcs/date diff/*2236-01-01*": [
(
Fail,
"https://github.com/ClickHouse/ClickHouse/pull/42308",
check_clickhouse_version("<22.9"),
)
],
"/datetime64 extended range/date time funcs/date diff/*2236-12-31*": [
(
Fail,
"https://github.com/ClickHouse/ClickHouse/pull/42308",
check_clickhouse_version("<22.9"),
)
],
"/datetime64 extended range/date time funcs/date diff/*2236-02-29*": [
(
Fail,
"https://github.com/ClickHouse/ClickHouse/pull/42308",
check_clickhouse_version("<22.9"),
)
],
}
ffails = {
"type conversion/to date32/:": (
XFail,
"toDate32 not implemented before 21.10",
(lambda test: check_clickhouse_version("<21.10")(test)),
)
}
@TestModule
@Name("datetime64 extended range")
@ArgumentParser(argparser)
@Specifications(QA_SRS010_ClickHouse_DateTime64_Extended_Range)
@Requirements(
RQ_SRS_010_DateTime64_ExtendedRange("1.0"),
)
@XFails(xfails)
@FFails(ffails)
@CaptureClusterArgs
def regression(
self,
cluster_args,
clickhouse_version,
stress=False,
with_analyzer=False,
):
"""ClickHouse DateTime64 Extended Range regression module."""
nodes = {
"clickhouse": ("clickhouse1", "clickhouse2", "clickhouse3"),
}
self.context.clickhouse_version = clickhouse_version
if stress is not None:
self.context.stress = stress
with Given("docker-compose cluster"):
cluster = create_cluster(
**cluster_args,
nodes=nodes,
configs_dir=current_dir(),
)
self.context.cluster = cluster
with And("I enable or disable experimental analyzer if needed"):
for node in nodes["clickhouse"]:
experimental_analyzer(node=cluster.node(node), with_analyzer=with_analyzer)
with Pool(2) as pool:
try:
Scenario(
run=load("datetime64_extended_range.tests.generic", "generic"),
parallel=True,
executor=pool,
)
Scenario(
run=load(
"datetime64_extended_range.tests.non_existent_time", "feature"
),
parallel=True,
executor=pool,
)
Scenario(
run=load(
"datetime64_extended_range.tests.reference_times",
"reference_times",
),
parallel=True,
executor=pool,
)
Scenario(
run=load(
"datetime64_extended_range.tests.date_time_functions",
"date_time_funcs",
),
parallel=True,
executor=pool,
)
Scenario(
run=load(
"datetime64_extended_range.tests.type_conversion",
"type_conversion",
),
parallel=True,
executor=pool,
)
Scenario(
run=load(
"datetime64_extended_range.tests.format_conversion",
"format_conversion",
),
parallel=True,
executor=pool,
)
finally:
join()
if main():
regression()