@@ -10,6 +10,7 @@ import (
10
10
_ "embed"
11
11
"encoding/json"
12
12
"io"
13
+ "math/rand"
13
14
"net/http"
14
15
"strconv"
15
16
"strings"
@@ -19,6 +20,8 @@ import (
19
20
"github.com/cockroachdb/cockroach/pkg/cmd/roachtest/option"
20
21
"github.com/cockroachdb/cockroach/pkg/cmd/roachtest/registry"
21
22
"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"
22
25
"github.com/cockroachdb/cockroach/pkg/cmd/roachtest/test"
23
26
"github.com/cockroachdb/cockroach/pkg/roachpb"
24
27
"github.com/cockroachdb/cockroach/pkg/roachprod/install"
@@ -90,6 +93,38 @@ func registerDBConsoleEndpoints(r registry.Registry) {
90
93
})
91
94
}
92
95
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
+
93
128
func runDBConsole (ctx context.Context , t test.Test , c cluster.Cluster ) {
94
129
c .Start (ctx , t .L (), option .DefaultStartOpts (), install .MakeClusterSettings ())
95
130
0 commit comments