-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Expand file tree
/
Copy pathgenerated_test.go
More file actions
288 lines (249 loc) · 6.97 KB
/
generated_test.go
File metadata and controls
288 lines (249 loc) · 6.97 KB
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
// Copyright 2022 The Cockroach Authors.
//
// Use of this software is governed by the CockroachDB Software License
// included in the /LICENSE file.
// Code generated by generate-logictest, DO NOT EDIT.
package test5node
import (
"os"
"path/filepath"
"testing"
"github.com/cockroachdb/cockroach/pkg/base"
"github.com/cockroachdb/cockroach/pkg/build/bazel"
"github.com/cockroachdb/cockroach/pkg/ccl"
"github.com/cockroachdb/cockroach/pkg/security/securityassets"
"github.com/cockroachdb/cockroach/pkg/security/securitytest"
"github.com/cockroachdb/cockroach/pkg/server"
"github.com/cockroachdb/cockroach/pkg/sql"
"github.com/cockroachdb/cockroach/pkg/sql/logictest"
"github.com/cockroachdb/cockroach/pkg/testutils/serverutils"
"github.com/cockroachdb/cockroach/pkg/testutils/skip"
"github.com/cockroachdb/cockroach/pkg/testutils/testcluster"
"github.com/cockroachdb/cockroach/pkg/util/leaktest"
"github.com/cockroachdb/cockroach/pkg/util/randutil"
)
const configIdx = 9
var execBuildLogicTestDir string
func init() {
if bazel.BuiltWithBazel() {
var err error
execBuildLogicTestDir, err = bazel.Runfile("pkg/sql/opt/exec/execbuilder/testdata")
if err != nil {
panic(err)
}
} else {
execBuildLogicTestDir = "../../../../../../sql/opt/exec/execbuilder/testdata"
}
}
func TestMain(m *testing.M) {
defer ccl.TestingEnableEnterprise()()
securityassets.SetLoader(securitytest.EmbeddedAssets)
randutil.SeedForTests()
serverutils.InitTestServerFactory(server.TestServerFactory,
serverutils.WithTenantOption(base.TestIsForStuffThatShouldWorkWithSecondaryTenantsButDoesntYet(156124)))
serverutils.InitTestClusterFactory(testcluster.TestClusterFactory)
os.Exit(m.Run())
}
func runExecBuildLogicTest(t *testing.T, file string) {
defer sql.TestingOverrideExplainEnvVersion("CockroachDB execbuilder test version")()
skip.UnderDeadlock(t, "times out and/or hangs")
serverArgs := logictest.TestServerArgs{
DisableWorkmemRandomization: true,
ForceProductionValues: true,
// Disable the direct scans in order to keep the output of EXPLAIN (VEC)
// deterministic.
DisableDirectColumnarScans: true,
}
logictest.RunLogicTest(t, serverArgs, configIdx, filepath.Join(execBuildLogicTestDir, file))
}
// TestLogic_tmp runs any tests that are prefixed with "_", in which a dedicated
// test is not generated for. This allows developers to create and run temporary
// test files that are not checked into the repository, without repeatedly
// regenerating and reverting changes to this file, generated_test.go.
//
// TODO(mgartner): Add file filtering so that individual files can be run,
// instead of all files with the "_" prefix.
func TestLogic_tmp(t *testing.T) {
defer leaktest.AfterTest(t)()
var glob string
glob = filepath.Join(execBuildLogicTestDir, "_*")
serverArgs := logictest.TestServerArgs{
DisableWorkmemRandomization: true,
DisableOptimizerPerturbations: true,
}
logictest.RunLogicTests(t, serverArgs, configIdx, glob)
}
func TestExecBuild_dist_union(
t *testing.T,
) {
defer leaktest.AfterTest(t)()
runExecBuildLogicTest(t, "dist_union")
}
func TestExecBuild_dist_vectorize(
t *testing.T,
) {
defer leaktest.AfterTest(t)()
runExecBuildLogicTest(t, "dist_vectorize")
}
func TestExecBuild_distsql_agg(
t *testing.T,
) {
defer leaktest.AfterTest(t)()
runExecBuildLogicTest(t, "distsql_agg")
}
func TestExecBuild_distsql_auto_mode(
t *testing.T,
) {
defer leaktest.AfterTest(t)()
runExecBuildLogicTest(t, "distsql_auto_mode")
}
func TestExecBuild_distsql_distinct_on(
t *testing.T,
) {
defer leaktest.AfterTest(t)()
runExecBuildLogicTest(t, "distsql_distinct_on")
}
func TestExecBuild_distsql_group_join(
t *testing.T,
) {
defer leaktest.AfterTest(t)()
runExecBuildLogicTest(t, "distsql_group_join")
}
func TestExecBuild_distsql_indexjoin(
t *testing.T,
) {
defer leaktest.AfterTest(t)()
runExecBuildLogicTest(t, "distsql_indexjoin")
}
func TestExecBuild_distsql_inverted_index(
t *testing.T,
) {
defer leaktest.AfterTest(t)()
runExecBuildLogicTest(t, "distsql_inverted_index")
}
func TestExecBuild_distsql_join(
t *testing.T,
) {
defer leaktest.AfterTest(t)()
runExecBuildLogicTest(t, "distsql_join")
}
func TestExecBuild_distsql_merge_join(
t *testing.T,
) {
defer leaktest.AfterTest(t)()
runExecBuildLogicTest(t, "distsql_merge_join")
}
func TestExecBuild_distsql_misc(
t *testing.T,
) {
defer leaktest.AfterTest(t)()
runExecBuildLogicTest(t, "distsql_misc")
}
func TestExecBuild_distsql_numtables(
t *testing.T,
) {
defer leaktest.AfterTest(t)()
runExecBuildLogicTest(t, "distsql_numtables")
}
func TestExecBuild_distsql_ordinality(
t *testing.T,
) {
defer leaktest.AfterTest(t)()
runExecBuildLogicTest(t, "distsql_ordinality")
}
func TestExecBuild_distsql_scan(
t *testing.T,
) {
defer leaktest.AfterTest(t)()
runExecBuildLogicTest(t, "distsql_scan")
}
func TestExecBuild_distsql_single_flow(
t *testing.T,
) {
defer leaktest.AfterTest(t)()
runExecBuildLogicTest(t, "distsql_single_flow")
}
func TestExecBuild_distsql_tighten_spans(
t *testing.T,
) {
defer leaktest.AfterTest(t)()
runExecBuildLogicTest(t, "distsql_tighten_spans")
}
func TestExecBuild_distsql_union(
t *testing.T,
) {
defer leaktest.AfterTest(t)()
runExecBuildLogicTest(t, "distsql_union")
}
func TestExecBuild_distsql_window(
t *testing.T,
) {
defer leaktest.AfterTest(t)()
runExecBuildLogicTest(t, "distsql_window")
}
func TestExecBuild_experimental_distsql_planning_5node(
t *testing.T,
) {
defer leaktest.AfterTest(t)()
runExecBuildLogicTest(t, "experimental_distsql_planning_5node")
}
func TestExecBuild_explain_analyze_plans(
t *testing.T,
) {
defer leaktest.AfterTest(t)()
runExecBuildLogicTest(t, "explain_analyze_plans")
}
func TestExecBuild_inverted_filter_geospatial_dist(
t *testing.T,
) {
defer leaktest.AfterTest(t)()
runExecBuildLogicTest(t, "inverted_filter_geospatial_dist")
}
func TestExecBuild_inverted_filter_json_array_dist(
t *testing.T,
) {
defer leaktest.AfterTest(t)()
runExecBuildLogicTest(t, "inverted_filter_json_array_dist")
}
func TestExecBuild_inverted_join_geospatial_dist(
t *testing.T,
) {
defer leaktest.AfterTest(t)()
runExecBuildLogicTest(t, "inverted_join_geospatial_dist")
}
func TestExecBuild_inverted_join_geospatial_dist_vec(
t *testing.T,
) {
defer leaktest.AfterTest(t)()
runExecBuildLogicTest(t, "inverted_join_geospatial_dist_vec")
}
func TestExecBuild_inverted_join_json_array_dist(
t *testing.T,
) {
defer leaktest.AfterTest(t)()
runExecBuildLogicTest(t, "inverted_join_json_array_dist")
}
func TestExecBuild_inverted_join_multi_column_dist(
t *testing.T,
) {
defer leaktest.AfterTest(t)()
runExecBuildLogicTest(t, "inverted_join_multi_column_dist")
}
func TestExecBuild_lookup_join(
t *testing.T,
) {
defer leaktest.AfterTest(t)()
runExecBuildLogicTest(t, "lookup_join")
}
func TestExecBuild_merge_join_dist_vec(
t *testing.T,
) {
defer leaktest.AfterTest(t)()
runExecBuildLogicTest(t, "merge_join_dist_vec")
}
func TestExecBuild_scan_parallel(
t *testing.T,
) {
defer leaktest.AfterTest(t)()
runExecBuildLogicTest(t, "scan_parallel")
}