diff --git a/pkg/cmd/roachtest/tests/awsdms.go b/pkg/cmd/roachtest/tests/awsdms.go index d15a2a4d38d2..aff716d80f0d 100644 --- a/pkg/cmd/roachtest/tests/awsdms.go +++ b/pkg/cmd/roachtest/tests/awsdms.go @@ -210,7 +210,7 @@ func runAWSDMS(ctx context.Context, t test.Test, c cluster.Cluster) { t.Fatal("cannot be run in local mode") } // We may not have the requisite certificates to start DMS/RDS on non-AWS invocations. - if cloud := c.Spec().Cloud; cloud != spec.AWS { + if cloud := c.Cloud(); cloud != spec.AWS { t.Skipf("skipping test on cloud %s", cloud) return } diff --git a/pkg/cmd/roachtest/tests/backup.go b/pkg/cmd/roachtest/tests/backup.go index 9cd279d24b50..ea1a4cb3181e 100644 --- a/pkg/cmd/roachtest/tests/backup.go +++ b/pkg/cmd/roachtest/tests/backup.go @@ -444,7 +444,7 @@ func registerBackup(r registry.Registry) { CompatibleClouds: registry.AllExceptAWS, Suites: registry.Suites(registry.Nightly), Run: func(ctx context.Context, t test.Test, c cluster.Cluster) { - if c.Spec().Cloud != item.machine { + if c.Cloud() != item.machine { t.Skip("backup assumeRole is only configured to run on "+item.machine, "") } @@ -555,7 +555,7 @@ func registerBackup(r registry.Registry) { Suites: registry.Suites(registry.Nightly), Tags: item.tags, Run: func(ctx context.Context, t test.Test, c cluster.Cluster) { - if c.Spec().Cloud != item.machine { + if c.Cloud() != item.machine { t.Skip("backupKMS roachtest is only configured to run on "+item.machine, "") } @@ -899,7 +899,7 @@ func registerBackup(r registry.Registry) { CompatibleClouds: registry.AllExceptAWS, Suites: registry.Suites(registry.Nightly), Run: func(ctx context.Context, t test.Test, c cluster.Cluster) { - if c.Spec().Cloud != spec.GCE { + if c.Cloud() != spec.GCE { t.Skip("uses gs://cockroach-fixtures; see https://github.com/cockroachdb/cockroach/issues/105968") } runBackupMVCCRangeTombstones(ctx, t, c, mvccRangeTombstoneConfig{}) diff --git a/pkg/cmd/roachtest/tests/copy.go b/pkg/cmd/roachtest/tests/copy.go index c3d83b3e47f7..f56e449cc127 100644 --- a/pkg/cmd/roachtest/tests/copy.go +++ b/pkg/cmd/roachtest/tests/copy.go @@ -199,7 +199,7 @@ func registerCopy(r registry.Registry) { Suites: registry.Suites(registry.Nightly), Leases: registry.MetamorphicLeases, Run: func(ctx context.Context, t test.Test, c cluster.Cluster) { - if c.Spec().Cloud != spec.GCE { + if c.Cloud() != spec.GCE { t.Skip("uses gs://cockroach-fixtures; see https://github.com/cockroachdb/cockroach/issues/105968") } runCopy(ctx, t, c, tc.rows, tc.txn) diff --git a/pkg/cmd/roachtest/tests/disk_stall.go b/pkg/cmd/roachtest/tests/disk_stall.go index 5c70a99ec96e..643a206fdeca 100644 --- a/pkg/cmd/roachtest/tests/disk_stall.go +++ b/pkg/cmd/roachtest/tests/disk_stall.go @@ -290,7 +290,7 @@ type dmsetupDiskStaller struct { var _ diskStaller = (*dmsetupDiskStaller)(nil) -func (s *dmsetupDiskStaller) device() string { return getDevice(s.t, s.c.Spec()) } +func (s *dmsetupDiskStaller) device() string { return getDevice(s.t, s.c) } func (s *dmsetupDiskStaller) Setup(ctx context.Context) { dev := s.device() @@ -365,15 +365,15 @@ func (s *cgroupDiskStaller) Unstall(ctx context.Context, nodes option.NodeListOp func (s *cgroupDiskStaller) device() (major, minor int) { // TODO(jackson): Programmatically determine the device major,minor numbers. // eg,: - // deviceName := getDevice(s.t, s.c.Spec()) + // deviceName := getDevice(s.t, s.c) // `cat /proc/partitions` and find `deviceName` - switch s.c.Spec().Cloud { + switch s.c.Cloud() { case spec.GCE: // ls -l /dev/sdb // brw-rw---- 1 root disk 8, 16 Mar 27 22:08 /dev/sdb return 8, 16 default: - s.t.Fatalf("unsupported cloud %q", s.c.Spec().Cloud) + s.t.Fatalf("unsupported cloud %q", s.c.Cloud()) return 0, 0 } } @@ -391,14 +391,14 @@ func (s *cgroupDiskStaller) setThroughput( )) } -func getDevice(t test.Test, s spec.ClusterSpec) string { - switch s.Cloud { +func getDevice(t test.Test, c cluster.Cluster) string { + switch c.Cloud() { case spec.GCE: return "/dev/sdb" case spec.AWS: return "/dev/nvme1n1" default: - t.Fatalf("unsupported cloud %q", s.Cloud) + t.Fatalf("unsupported cloud %q", c.Cloud()) return "" } } diff --git a/pkg/cmd/roachtest/tests/follower_reads.go b/pkg/cmd/roachtest/tests/follower_reads.go index 7a9b70854712..eb06ee596519 100644 --- a/pkg/cmd/roachtest/tests/follower_reads.go +++ b/pkg/cmd/roachtest/tests/follower_reads.go @@ -68,7 +68,7 @@ func registerFollowerReads(r registry.Registry) { Suites: registry.Suites(registry.Nightly), Leases: registry.MetamorphicLeases, Run: func(ctx context.Context, t test.Test, c cluster.Cluster) { - if c.Spec().Cloud == spec.GCE && c.Spec().Arch == vm.ArchARM64 { + if c.Cloud() == spec.GCE && c.Spec().Arch == vm.ArchARM64 { t.Skip("arm64 in GCE is available only in us-central1") } c.Start(ctx, t.L(), option.DefaultStartOpts(), install.MakeClusterSettings()) diff --git a/pkg/cmd/roachtest/tests/import.go b/pkg/cmd/roachtest/tests/import.go index 795af85c08fe..8d5ad0113f67 100644 --- a/pkg/cmd/roachtest/tests/import.go +++ b/pkg/cmd/roachtest/tests/import.go @@ -92,7 +92,7 @@ func registerImportNodeShutdown(r registry.Registry) { Suites: registry.Suites(registry.Nightly), Leases: registry.MetamorphicLeases, Run: func(ctx context.Context, t test.Test, c cluster.Cluster) { - if c.Spec().Cloud != spec.GCE { + if c.Cloud() != spec.GCE { t.Skip("uses gs://cockroach-fixtures; see https://github.com/cockroachdb/cockroach/issues/105968") } c.Start(ctx, t.L(), option.DefaultStartOpts(), install.MakeClusterSettings()) @@ -111,7 +111,7 @@ func registerImportNodeShutdown(r registry.Registry) { Suites: registry.Suites(registry.Nightly), Leases: registry.MetamorphicLeases, Run: func(ctx context.Context, t test.Test, c cluster.Cluster) { - if c.Spec().Cloud != spec.GCE { + if c.Cloud() != spec.GCE { t.Skip("uses gs://cockroach-fixtures; see https://github.com/cockroachdb/cockroach/issues/105968") } c.Start(ctx, t.L(), option.DefaultStartOpts(), install.MakeClusterSettings()) @@ -232,7 +232,7 @@ func registerImportTPCH(r registry.Registry) { EncryptionSupport: registry.EncryptionMetamorphic, Leases: registry.MetamorphicLeases, Run: func(ctx context.Context, t test.Test, c cluster.Cluster) { - if c.Spec().Cloud != spec.GCE { + if c.Cloud() != spec.GCE { t.Skip("uses gs://cockroach-fixtures; see https://github.com/cockroachdb/cockroach/issues/105968") } tick, perfBuf := initBulkJobPerfArtifacts(t.Name(), item.timeout) diff --git a/pkg/cmd/roachtest/tests/import_cancellation.go b/pkg/cmd/roachtest/tests/import_cancellation.go index e3613c9d7726..bddc29ae0ddb 100644 --- a/pkg/cmd/roachtest/tests/import_cancellation.go +++ b/pkg/cmd/roachtest/tests/import_cancellation.go @@ -40,7 +40,7 @@ func registerImportCancellation(r registry.Registry) { Suites: registry.Suites(registry.Nightly), Leases: registry.MetamorphicLeases, Run: func(ctx context.Context, t test.Test, c cluster.Cluster) { - if c.Spec().Cloud != spec.GCE { + if c.Cloud() != spec.GCE { t.Skip("uses gs://cockroach-fixtures; see https://github.com/cockroachdb/cockroach/issues/105968") } runImportCancellation(ctx, t, c, rangeTombstones) diff --git a/pkg/cmd/roachtest/tests/indexes.go b/pkg/cmd/roachtest/tests/indexes.go index 83d6cf8af93b..5bdaebed30d5 100644 --- a/pkg/cmd/roachtest/tests/indexes.go +++ b/pkg/cmd/roachtest/tests/indexes.go @@ -47,7 +47,7 @@ func registerNIndexes(r registry.Registry, secondaryIndexes int) { // Uses CONFIGURE ZONE USING ... COPY FROM PARENT syntax. Run: func(ctx context.Context, t test.Test, c cluster.Cluster) { firstAZ := gceGeoZones[0] - if c.Spec().Cloud == spec.AWS { + if c.Cloud() == spec.AWS { firstAZ = awsGeoZones[0] } roachNodes := c.Range(1, nodes) diff --git a/pkg/cmd/roachtest/tests/kv.go b/pkg/cmd/roachtest/tests/kv.go index d52f900a0322..b134477aa4d0 100644 --- a/pkg/cmd/roachtest/tests/kv.go +++ b/pkg/cmd/roachtest/tests/kv.go @@ -307,25 +307,26 @@ func registerKV(r registry.Registry) { } cSpec := r.MakeClusterSpec(opts.nodes+1, spec.CPU(opts.cpus), spec.SSD(opts.ssds), spec.RAID0(opts.raid0)) - clouds := registry.AllExceptAWS - var tags map[string]struct{} - // All the kv0|95 tests should run on AWS by default - if !opts.weekly && opts.ssds == 0 && (opts.readPercent == 95 || opts.readPercent == 0) { + var clouds registry.CloudSet + tags := make(map[string]struct{}) + if opts.ssds != 0 { + // Multi-store tests are only supported on GCE. + clouds = registry.OnlyGCE + } else if !opts.weekly && (opts.readPercent == 95 || opts.readPercent == 0) { + // All the kv0|95 tests should run on AWS. clouds = registry.AllClouds tags = registry.Tags("aws") + } else { + clouds = registry.AllExceptAWS } + suites := registry.Suites(registry.Nightly) if opts.weekly { suites = registry.Suites(registry.Weekly) - tags = registry.Tags("weekly") + tags["weekly"] = struct{}{} } - var skip string - if opts.ssds != 0 && cSpec.Cloud != spec.GCE { - skip = fmt.Sprintf("multi-store tests are not supported on cloud %s", cSpec.Cloud) - } r.Add(registry.TestSpec{ - Skip: skip, Name: strings.Join(nameParts, "/"), Owner: owner, Benchmark: true, diff --git a/pkg/cmd/roachtest/tests/mixed_version_backup.go b/pkg/cmd/roachtest/tests/mixed_version_backup.go index a2593a6e85a2..a5c4fc89ba2e 100644 --- a/pkg/cmd/roachtest/tests/mixed_version_backup.go +++ b/pkg/cmd/roachtest/tests/mixed_version_backup.go @@ -2468,7 +2468,7 @@ func registerBackupMixedVersion(r registry.Registry) { CompatibleClouds: registry.AllExceptAWS, Suites: registry.Suites(registry.Nightly), Run: func(ctx context.Context, t test.Test, c cluster.Cluster) { - if c.Spec().Cloud != spec.GCE && !c.IsLocal() { + if c.Cloud() != spec.GCE && !c.IsLocal() { t.Skip("uses gs://cockroachdb-backup-testing-long-ttl; see https://github.com/cockroachdb/cockroach/issues/105968") } diff --git a/pkg/cmd/roachtest/tests/mixed_version_decl_schemachange_compat.go b/pkg/cmd/roachtest/tests/mixed_version_decl_schemachange_compat.go index 8d3404f2523d..b650c70f8a79 100644 --- a/pkg/cmd/roachtest/tests/mixed_version_decl_schemachange_compat.go +++ b/pkg/cmd/roachtest/tests/mixed_version_decl_schemachange_compat.go @@ -34,7 +34,7 @@ func registerDeclSchemaChangeCompatMixedVersions(r registry.Registry) { CompatibleClouds: registry.AllExceptAWS, Suites: registry.Suites(registry.Nightly), Run: func(ctx context.Context, t test.Test, c cluster.Cluster) { - if c.Spec().Cloud != spec.GCE { + if c.Cloud() != spec.GCE { t.Skip("uses gs://cockroach-corpus; see https://github.com/cockroachdb/cockroach/issues/105968") } runDeclSchemaChangeCompatMixedVersions(ctx, t, c) diff --git a/pkg/cmd/roachtest/tests/rebalance_load.go b/pkg/cmd/roachtest/tests/rebalance_load.go index 25079acc03be..3b6506b4c75c 100644 --- a/pkg/cmd/roachtest/tests/rebalance_load.go +++ b/pkg/cmd/roachtest/tests/rebalance_load.go @@ -283,17 +283,12 @@ func registerRebalanceLoad(r registry.Registry) { }, ) cSpec := r.MakeClusterSpec(7, spec.SSD(2)) // the last node is just used to generate load - var skip string - if cSpec.Cloud != spec.GCE { - skip = fmt.Sprintf("multi-store tests are not supported on cloud %s", cSpec.Cloud) - } r.Add( registry.TestSpec{ - Skip: skip, Name: `rebalance/by-load/replicas/ssds=2`, Owner: registry.OwnerKV, Cluster: cSpec, - CompatibleClouds: registry.AllExceptAWS, + CompatibleClouds: registry.OnlyGCE, Suites: registry.Suites(registry.Nightly), Leases: registry.MetamorphicLeases, Run: func(ctx context.Context, t test.Test, c cluster.Cluster) { diff --git a/pkg/cmd/roachtest/tests/restore.go b/pkg/cmd/roachtest/tests/restore.go index a9502faec26d..216b9b1ee57f 100644 --- a/pkg/cmd/roachtest/tests/restore.go +++ b/pkg/cmd/roachtest/tests/restore.go @@ -745,8 +745,7 @@ func makeRestoreDriver(t test.Test, c cluster.Cluster, sp restoreSpecs) restoreD } func (rd *restoreDriver) prepareCluster(ctx context.Context) { - - if rd.c.Spec().Cloud != rd.sp.backup.cloud { + if rd.c.Cloud() != rd.sp.backup.cloud { // For now, only run the test on the cloud provider that also stores the backup. rd.t.Skipf("test configured to run on %s", rd.sp.backup.cloud) } diff --git a/pkg/cmd/roachtest/tests/schemachange.go b/pkg/cmd/roachtest/tests/schemachange.go index a2236658d0b1..4df4ce9cd8e5 100644 --- a/pkg/cmd/roachtest/tests/schemachange.go +++ b/pkg/cmd/roachtest/tests/schemachange.go @@ -36,7 +36,7 @@ func registerSchemaChangeDuringKV(r registry.Registry) { Suites: registry.Suites(registry.Nightly), Leases: registry.MetamorphicLeases, Run: func(ctx context.Context, t test.Test, c cluster.Cluster) { - if c.Spec().Cloud != spec.GCE { + if c.Cloud() != spec.GCE { t.Skip("uses gs://cockroach-fixtures; see https://github.com/cockroachdb/cockroach/issues/105968") } const fixturePath = `gs://cockroach-fixtures/workload/tpch/scalefactor=10/backup?AUTH=implicit` diff --git a/pkg/cmd/roachtest/tests/sqlsmith.go b/pkg/cmd/roachtest/tests/sqlsmith.go index be8a0c820d64..f7742a7447c1 100644 --- a/pkg/cmd/roachtest/tests/sqlsmith.go +++ b/pkg/cmd/roachtest/tests/sqlsmith.go @@ -296,7 +296,7 @@ WITH into_db = 'defaultdb', unsafe_restore_incompatible_version; // NB: sqlsmith failures should never block a release. NonReleaseBlocker: true, Run: func(ctx context.Context, t test.Test, c cluster.Cluster) { - if c.Spec().Cloud != spec.GCE { + if c.Cloud() != spec.GCE { t.Skip("uses gs://cockroach-fixtures; see https://github.com/cockroachdb/cockroach/issues/105968") } runSQLSmith(ctx, t, c, setup, setting) diff --git a/pkg/cmd/roachtest/tests/tpc_utils.go b/pkg/cmd/roachtest/tests/tpc_utils.go index ebf613d10f48..78887dd20550 100644 --- a/pkg/cmd/roachtest/tests/tpc_utils.go +++ b/pkg/cmd/roachtest/tests/tpc_utils.go @@ -44,7 +44,7 @@ func loadTPCHDataset( disableMergeQueue bool, secure bool, ) (retErr error) { - if c.Spec().Cloud != spec.GCE { + if c.Cloud() != spec.GCE { t.Skip("uses gs://cockroach-fixtures; see https://github.com/cockroachdb/cockroach/issues/105968") } diff --git a/pkg/cmd/roachtest/tests/tpcdsvec.go b/pkg/cmd/roachtest/tests/tpcdsvec.go index 54e6573c0a05..31e5000a2b9b 100644 --- a/pkg/cmd/roachtest/tests/tpcdsvec.go +++ b/pkg/cmd/roachtest/tests/tpcdsvec.go @@ -192,7 +192,7 @@ WITH unsafe_restore_incompatible_version; CompatibleClouds: registry.AllExceptAWS, Suites: registry.Suites(registry.Nightly), Run: func(ctx context.Context, t test.Test, c cluster.Cluster) { - if c.Spec().Cloud != spec.GCE { + if c.Cloud() != spec.GCE { t.Skip("uses gs://cockroach-fixtures; see https://github.com/cockroachdb/cockroach/issues/105968") } runTPCDSVec(ctx, t, c) diff --git a/pkg/cmd/roachtest/tests/ycsb.go b/pkg/cmd/roachtest/tests/ycsb.go index ede2e9ca21c7..538c37df534e 100644 --- a/pkg/cmd/roachtest/tests/ycsb.go +++ b/pkg/cmd/roachtest/tests/ycsb.go @@ -49,7 +49,7 @@ func registerYCSB(r registry.Registry) { ) { // For now, we only want to run the zfs tests on GCE, since only GCE supports // starting roachprod instances on zfs. - if c.Spec().FileSystem == spec.Zfs && c.Spec().Cloud != spec.GCE { + if c.Spec().FileSystem == spec.Zfs && c.Cloud() != spec.GCE { t.Skip("YCSB zfs benchmark can only be run on GCE", "") }