Skip to content

Commit

Permalink
logictest: audit logic tests to enable default configs
Browse files Browse the repository at this point in the history
Release justification: non-production code changes.

This commit extends the number of configurations on some of the logic
tests (mostly by removing explicit configs so that all default ones are
used). It also uncomments few things, renames a few files, and moves the
contents of `exec_window` into `window`.

It also adds a new `5node-dist-vec-disk` config that about 10 files or
so are now run with.

Additionally, it removes `5node-local` config (which was used in two
files), removes `dist-` part from all 5 node config names, and adds
a special alias `5node-default-configs` which includes all 5 node
configs.

Release note: None
  • Loading branch information
yuzefovich committed Mar 24, 2020
1 parent d53a78b commit 5025c70
Show file tree
Hide file tree
Showing 61 changed files with 313 additions and 292 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# LogicTest: 5node-dist
# LogicTest: 5node

# Tests for the show partitions command.

Expand Down
2 changes: 1 addition & 1 deletion pkg/ccl/logictestccl/testdata/logic_test/drop_index
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# LogicTest: 5node-dist
# LogicTest: 5node

statement ok
CREATE TABLE t (
Expand Down
2 changes: 1 addition & 1 deletion pkg/ccl/logictestccl/testdata/logic_test/zone
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# LogicTest: 5node-dist
# LogicTest: 5node

# Ensure that cost-based-optimizer uses an index with zone constraints that most
# closely matches the gateway's locality. Use "retry" option, since it can take
Expand Down
41 changes: 29 additions & 12 deletions pkg/sql/logictest/logic.go
Original file line number Diff line number Diff line change
Expand Up @@ -512,39 +512,42 @@ var logicTestConfigs = []testClusterConfig{
skipShort: true,
},
{
name: "5node-local",
name: "5node",
numNodes: 5,
overrideDistSQLMode: "off",
overrideDistSQLMode: "on",
overrideAutoStats: "false",
},
{
name: "5node-dist",
name: "5node-vec",
numNodes: 5,
overrideDistSQLMode: "on",
overrideAutoStats: "false",
overrideVectorize: "on",
},
{
name: "5node-dist-vec",
name: "5node-vec-disk",
numNodes: 5,
overrideDistSQLMode: "on",
overrideVectorize: "on",
overrideAutoStats: "false",
overrideVectorize: "on",
sqlExecUseDisk: true,
skipShort: true,
},
{
name: "5node-dist-metadata",
name: "5node-metadata",
numNodes: 5,
overrideDistSQLMode: "on",
overrideAutoStats: "false",
distSQLMetadataTestEnabled: true,
skipShort: true,
overrideAutoStats: "false",
},
{
name: "5node-dist-disk",
name: "5node-disk",
numNodes: 5,
overrideDistSQLMode: "on",
overrideAutoStats: "false",
sqlExecUseDisk: true,
skipShort: true,
overrideAutoStats: "false",
},
}

Expand Down Expand Up @@ -572,7 +575,17 @@ var (
"fakedist-metadata",
"fakedist-disk",
}
defaultConfig = parseTestConfig(defaultConfigNames)
// fiveNodeDefaultConfigName is a special alias for all 5 node configs.
fiveNodeDefaultConfigName = "5node-default-configs"
fiveNodeDefaultConfigNames = []string{
"5node",
"5node-vec",
"5node-vec-disk",
"5node-metadata",
"5node-disk",
}
defaultConfig = parseTestConfig(defaultConfigNames)
fiveNodeDefaultConfig = parseTestConfig(fiveNodeDefaultConfigNames)
)

// An index in the above slice.
Expand Down Expand Up @@ -1335,9 +1348,13 @@ func readTestFileConfigs(t *testing.T, path string) []logicTestConfigIdx {
for _, configName := range fields[2:] {
idx, ok := findLogicTestConfig(configName)
if !ok {
t.Fatalf("%s: unknown config name %s", path, configName)
if configName != fiveNodeDefaultConfigName {
t.Fatalf("%s: unknown config name %s", path, configName)
}
configs = append(configs, fiveNodeDefaultConfig...)
} else {
configs = append(configs, idx)
}
configs = append(configs, idx)
}
return configs
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# LogicTest: local local-vec

statement ok
DROP TABLE IF EXISTS t; CREATE TABLE t (k INT PRIMARY KEY, a INT, b INT)

Expand Down
2 changes: 0 additions & 2 deletions pkg/sql/logictest/testdata/logic_test/apply_join
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# LogicTest: local fakedist

statement ok
CREATE TABLE t (k INT PRIMARY KEY, str STRING);
CREATE TABLE u (l INT PRIMARY KEY, str2 STRING);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# LogicTest: local local-vec

statement ok
CREATE TABLE t45837 AS SELECT 1.25::decimal AS d

Expand Down
1 change: 0 additions & 1 deletion pkg/sql/logictest/testdata/logic_test/conditional
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# LogicTest: local local-vec fakedist fakedist-metadata fakedist-vec
query II
SELECT IF(1 = 2, NULL, 1), IF(2 = 2, NULL, 2)
----
Expand Down
2 changes: 1 addition & 1 deletion pkg/sql/logictest/testdata/logic_test/dist_vectorize
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# LogicTest: 5node-dist-vec
# LogicTest: 5node-vec 5node-vec-disk

statement ok
CREATE TABLE kv (k INT PRIMARY KEY, v INT)
Expand Down
2 changes: 1 addition & 1 deletion pkg/sql/logictest/testdata/logic_test/distsql_agg
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# LogicTest: 5node-dist 5node-dist-metadata 5node-dist-disk
# LogicTest: 5node-default-configs

statement ok
CREATE TABLE data (a INT, b INT, c FLOAT, d DECIMAL, PRIMARY KEY (a, b, c, d))
Expand Down
2 changes: 1 addition & 1 deletion pkg/sql/logictest/testdata/logic_test/distsql_distinct_on
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# LogicTest: 5node-dist 5node-dist-metadata 5node-dist-disk
# LogicTest: 5node-default-configs

statement ok
CREATE TABLE xyz (
Expand Down
2 changes: 1 addition & 1 deletion pkg/sql/logictest/testdata/logic_test/distsql_event_log
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# LogicTest: 5node-dist 5node-dist-metadata
# LogicTest: 5node 5node-metadata

###################
# CREATE STATISTICS
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# LogicTest: 5node-dist 5node-dist-metadata
# LogicTest: 5node-default-configs

# The following tables form the interleaved hierarchy:
# name: primary key: # rows: 'a' = id mod X :
Expand Down
2 changes: 1 addition & 1 deletion pkg/sql/logictest/testdata/logic_test/distsql_join
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# LogicTest: 5node-dist 5node-dist-metadata
# LogicTest: 5node-default-configs

# Test that the distSQL MergeJoiner follows SQL NULL semantics for ON predicate
# equivilance. The use of sorts here force the planning of merge join.
Expand Down
2 changes: 1 addition & 1 deletion pkg/sql/logictest/testdata/logic_test/distsql_numtables
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# LogicTest: 5node-dist 5node-dist-metadata 5node-dist-disk
# LogicTest: 5node-default-configs

# First, we set up two data tables:
# - NumToSquare maps integers from 1 to 100 to their squares
Expand Down
2 changes: 0 additions & 2 deletions pkg/sql/logictest/testdata/logic_test/distsql_srfs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# LogicTest: fakedist fakedist-metadata

statement ok
CREATE TABLE data (a INT PRIMARY KEY)

Expand Down
2 changes: 1 addition & 1 deletion pkg/sql/logictest/testdata/logic_test/distsql_stats
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# LogicTest: 5node-dist 5node-dist-metadata
# LogicTest: 5node 5node-metadata

# Disable automatic stats.
statement ok
Expand Down
4 changes: 1 addition & 3 deletions pkg/sql/logictest/testdata/logic_test/distsql_subquery
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# LogicTest: 5node-dist

# TODO(radu): re-add 5node-dist-opt when #32648 is fixed.
# LogicTest: 5node-default-configs

# Regression test for #32652: make sure subqueries that have extra columns for
# stream merges don't crash when executed.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# LogicTest: 5node-dist 5node-dist-metadata
# LogicTest: 5node-default-configs

# This test verifies that we correctly tighten spans during index selection as
# well as after partitioning spans in distsql.
Expand Down
2 changes: 1 addition & 1 deletion pkg/sql/logictest/testdata/logic_test/distsql_union
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# LogicTest: 5node-dist 5node-dist-metadata 5node-dist-disk
# LogicTest: 5node-default-configs

statement ok
CREATE TABLE xyz (
Expand Down
116 changes: 0 additions & 116 deletions pkg/sql/logictest/testdata/logic_test/exec_window

This file was deleted.

2 changes: 1 addition & 1 deletion pkg/sql/logictest/testdata/logic_test/explain
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# LogicTest: local local-vec-off
# LogicTest: local local-vec-off local-vec

statement ok
CREATE TABLE t (a INT PRIMARY KEY)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# LogicTest: 5node-dist
# LogicTest: 5node

# These tests are different from explain_analyze because they require manual
# data placement.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
# LogicTest: local-vec fakedist-vec-disk

# Test that the exec HashJoiner follows SQL NULL semantics for ON predicate
# equivalence.

statement ok
CREATE TABLE t1 (k INT PRIMARY KEY, v INT)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# LogicTest: 5node-dist-vec
# LogicTest: 5node-default-configs

statement ok
CREATE TABLE t (k INT, v INT)
Expand Down
2 changes: 0 additions & 2 deletions pkg/sql/logictest/testdata/logic_test/inner-join
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# LogicTest: local fakedist

statement ok
CREATE TABLE abc (a INT, b INT, c INT, PRIMARY KEY (a, b));
INSERT INTO abc VALUES (1, 1, 2), (2, 1, 1), (2, 2, NULL)
Expand Down
2 changes: 0 additions & 2 deletions pkg/sql/logictest/testdata/logic_test/interleaved
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# LogicTest: local local-vec fakedist fakedist-metadata

# Grandparent table
statement ok
CREATE TABLE p2 (i INT PRIMARY KEY, s STRING)
Expand Down
2 changes: 1 addition & 1 deletion pkg/sql/logictest/testdata/logic_test/locality
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# LogicTest: 5node-dist
# LogicTest: 5node

query T
SELECT crdb_internal.locality_value('region')
Expand Down
2 changes: 0 additions & 2 deletions pkg/sql/logictest/testdata/logic_test/lookup_join
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# LogicTest: fakedist local

statement ok
CREATE TABLE abc (a INT, b INT, c INT, PRIMARY KEY (a, c));
INSERT INTO abc VALUES (1, 1, 2), (2, 1, 1), (2, NULL, 2)
Expand Down
Loading

0 comments on commit 5025c70

Please sign in to comment.