Skip to content

Commit 2379b35

Browse files
authored
Merge pull request #2221 from k8s-infra-cherrypick-robot/cherry-pick-2215-to-release-1.21
[release-1.21] Add option to skip Hd tests
2 parents 7129e19 + 071d34f commit 2379b35

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

test/e2e/tests/setup_e2e_test.go

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ import (
3838
remote "sigs.k8s.io/gcp-compute-persistent-disk-csi-driver/test/remote"
3939
)
4040

41+
const (
42+
noMachineType = "none"
43+
)
44+
4145
var (
4246
project = flag.String("project", "", "Project to run tests in")
4347
serviceAccount = flag.String("service-account", "", "Service account to bring up instance with")
@@ -55,7 +59,7 @@ var (
5559
enableConfidentialCompute = flag.Bool("enable-confidential-compute", false, "Create VMs with confidential compute mode. This uses NVMe devices")
5660
// Multi-writer is only supported on M3, C3, and N4
5761
// https://cloud.google.com/compute/docs/disks/sharing-disks-between-vms#hd-multi-writer
58-
hdMachineType = flag.String("hyperdisk-machine-type", "c3-standard-4", "Type of machine to provision instance on")
62+
hdMachineType = flag.String("hyperdisk-machine-type", "c3-standard-4", "Type of machine to provision instance on, or `none' to skip")
5963
hdMinCpuPlatform = flag.String("hyperdisk-min-cpu-platform", "sapphirerapids", "Minimum CPU architecture")
6064

6165
testContexts = []*remote.TestContext{}
@@ -121,11 +125,13 @@ var _ = BeforeSuite(func() {
121125
}(zone, j)
122126
}
123127
wg.Add(1)
124-
go func(curZone string) {
125-
defer GinkgoRecover()
126-
defer wg.Done()
127-
hdtcc <- NewTestContext(curZone, *hdMinCpuPlatform, *hdMachineType, "0")
128-
}(zone)
128+
if *hdMachineType != noMachineType {
129+
go func(curZone string) {
130+
defer GinkgoRecover()
131+
defer wg.Done()
132+
hdtcc <- NewTestContext(curZone, *hdMinCpuPlatform, *hdMachineType, "0")
133+
}(zone)
134+
}
129135
wg.Wait()
130136
}
131137

0 commit comments

Comments
 (0)