Skip to content

Commit ecd20f3

Browse files
roachtest: Add db-console/mixed-version-endpoints roachtest
This commit registers a mixed-version variation of the db-console/endpoints roachtest. Part of: #145536 Release note: None
1 parent b1ae7bb commit ecd20f3

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed

pkg/cmd/roachtest/tests/db_console_endpoints.go

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import (
1010
_ "embed"
1111
"encoding/json"
1212
"io"
13+
"math/rand"
1314
"net/http"
1415
"strconv"
1516
"strings"
@@ -19,6 +20,8 @@ import (
1920
"github.com/cockroachdb/cockroach/pkg/cmd/roachtest/option"
2021
"github.com/cockroachdb/cockroach/pkg/cmd/roachtest/registry"
2122
"github.com/cockroachdb/cockroach/pkg/cmd/roachtest/roachtestutil"
23+
"github.com/cockroachdb/cockroach/pkg/cmd/roachtest/roachtestutil/mixedversion"
24+
"github.com/cockroachdb/cockroach/pkg/cmd/roachtest/spec"
2225
"github.com/cockroachdb/cockroach/pkg/cmd/roachtest/test"
2326
"github.com/cockroachdb/cockroach/pkg/roachpb"
2427
"github.com/cockroachdb/cockroach/pkg/roachprod/install"
@@ -90,6 +93,38 @@ func registerDBConsoleEndpoints(r registry.Registry) {
9093
})
9194
}
9295

96+
func registerDBConsoleEndpointsMixedVersion(r registry.Registry) {
97+
r.Add(registry.TestSpec{
98+
Name: "db-console/mixed-version-endpoints",
99+
Owner: registry.OwnerObservability,
100+
Cluster: r.MakeClusterSpec(5, spec.WorkloadNode()),
101+
CompatibleClouds: registry.AllClouds,
102+
Suites: registry.Suites(registry.MixedVersion, registry.Nightly),
103+
Randomized: true,
104+
Run: runDBConsoleMixedVersion,
105+
Timeout: 1 * time.Hour,
106+
})
107+
}
108+
109+
func runDBConsoleMixedVersion(ctx context.Context, t test.Test, c cluster.Cluster) {
110+
mvt := mixedversion.NewTest(ctx, t, t.L(), c,
111+
c.CRDBNodes(),
112+
// We test only upgrades from 23.2 in this test because it uses
113+
// the `workload init` command, which is only supported
114+
// reliably multi-tenant mode starting from that version.
115+
mixedversion.MinimumSupportedVersion("v23.2.0"),
116+
)
117+
118+
mvt.InMixedVersion("test db console endpoints", func(ctx context.Context, l *logger.Logger, rng *rand.Rand, h *mixedversion.Helper) error {
119+
if err := initializeSchemaAndIDs(ctx, c, t.L()); err != nil {
120+
t.Fatal(err)
121+
}
122+
return testEndpoints(ctx, c, l, getEndpoints(t), true)
123+
})
124+
125+
mvt.Run()
126+
}
127+
93128
func runDBConsole(ctx context.Context, t test.Test, c cluster.Cluster) {
94129
c.Start(ctx, t.L(), option.DefaultStartOpts(), install.MakeClusterSettings())
95130

pkg/cmd/roachtest/tests/registry.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ func RegisterTests(r registry.Registry) {
176176
registerSqlStatsMixedVersion(r)
177177
registerDbConsoleCypress(r)
178178
registerDBConsoleEndpoints(r)
179+
registerDBConsoleEndpointsMixedVersion(r)
179180
registerTTLRestart(r)
180181
perturbation.RegisterTests(r)
181182
}

0 commit comments

Comments
 (0)