diff --git a/pkg/BUILD.bazel b/pkg/BUILD.bazel index a1f8afe1ba36..1ae9a0cb7e3e 100644 --- a/pkg/BUILD.bazel +++ b/pkg/BUILD.bazel @@ -447,6 +447,7 @@ ALL_TESTS = [ "//pkg/sql/lex:lex_disallowed_imports_test", "//pkg/sql/lex:lex_test", "//pkg/sql/lexbase:lexbase_test", + "//pkg/sql/logictest/logictestbase:logictestbase_test", "//pkg/sql/logictest/tests/5node-disk:5node-disk_test", "//pkg/sql/logictest/tests/5node:5node_test", "//pkg/sql/logictest/tests/cockroach-go-testserver-upgrade-to-master:cockroach-go-testserver-upgrade-to-master_test", @@ -1851,6 +1852,7 @@ GO_TARGETS = [ "//pkg/sql/lexbase:lexbase", "//pkg/sql/lexbase:lexbase_test", "//pkg/sql/logictest/logictestbase:logictestbase", + "//pkg/sql/logictest/logictestbase:logictestbase_test", "//pkg/sql/logictest/tests/5node-disk:5node-disk_test", "//pkg/sql/logictest/tests/5node:5node_test", "//pkg/sql/logictest/tests/cockroach-go-testserver-upgrade-to-master:cockroach-go-testserver-upgrade-to-master_test", diff --git a/pkg/sql/logictest/logictestbase/BUILD.bazel b/pkg/sql/logictest/logictestbase/BUILD.bazel index b61700d24af5..36bd1ab1823d 100644 --- a/pkg/sql/logictest/logictestbase/BUILD.bazel +++ b/pkg/sql/logictest/logictestbase/BUILD.bazel @@ -1,4 +1,4 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") go_library( name = "logictestbase", @@ -12,3 +12,10 @@ go_library( "//pkg/roachpb", ], ) + +go_test( + name = "logictestbase_test", + srcs = ["logictestbase_test.go"], + embed = [":logictestbase"], + deps = ["//pkg/clusterversion"], +) diff --git a/pkg/sql/logictest/logictestbase/logictestbase_test.go b/pkg/sql/logictest/logictestbase/logictestbase_test.go new file mode 100644 index 000000000000..54fb7f9008ad --- /dev/null +++ b/pkg/sql/logictest/logictestbase/logictestbase_test.go @@ -0,0 +1,31 @@ +// Copyright 2023 The Cockroach Authors. +// +// Use of this software is governed by the Business Source License +// included in the file licenses/BSL.txt. +// +// As of the Change Date specified in that file, in accordance with +// the Business Source License, use of this software will be governed +// by the Apache License, Version 2.0, included in the file +// licenses/APL.txt. + +package logictestbase + +import ( + "testing" + + "github.com/cockroachdb/cockroach/pkg/clusterversion" +) + +func TestLogicTestMixedVersionConfigs(t *testing.T) { + // Verify there is a mixed-version config for each supported release. + for _, v := range clusterversion.SupportedPreviousReleases() { + t.Run(v.String(), func(t *testing.T) { + for _, c := range LogicTestConfigs { + if c.DisableUpgrade && c.BootstrapVersion == v { + return + } + } + t.Errorf("no mixed-version config for %v", v) + }) + } +}