Skip to content

Commit b03106a

Browse files
committed
Add option to skip Hd tests
Change-Id: If21cb2ae447e3d3a383046e383df2d863a6952b3
1 parent 4c5bb0b commit b03106a

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

test/e2e/tests/setup_e2e_test.go

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

41+
const (
42+
noMachineType = "none"
43+
4144
var (
4245
project = flag.String("project", "", "Project to run tests in")
4346
serviceAccount = flag.String("service-account", "", "Service account to bring up instance with")
@@ -55,7 +58,7 @@ var (
5558
enableConfidentialCompute = flag.Bool("enable-confidential-compute", false, "Create VMs with confidential compute mode. This uses NVMe devices")
5659
// Multi-writer is only supported on M3, C3, and N4
5760
// 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")
61+
hdMachineType = flag.String("hyperdisk-machine-type", "c3-standard-4", "Type of machine to provision instance on, or `none' to skip")
5962
hdMinCpuPlatform = flag.String("hyperdisk-min-cpu-platform", "sapphirerapids", "Minimum CPU architecture")
6063

6164
testContexts = []*remote.TestContext{}
@@ -121,11 +124,13 @@ var _ = BeforeSuite(func() {
121124
}(zone, j)
122125
}
123126
wg.Add(1)
124-
go func(curZone string) {
125-
defer GinkgoRecover()
126-
defer wg.Done()
127-
hdtcc <- NewTestContext(curZone, *hdMinCpuPlatform, *hdMachineType, "0")
128-
}(zone)
127+
if *hdMachineType != noMachineType {
128+
go func(curZone string) {
129+
defer GinkgoRecover()
130+
defer wg.Done()
131+
hdtcc <- NewTestContext(curZone, *hdMinCpuPlatform, *hdMachineType, "0")
132+
}(zone)
133+
}
129134
wg.Wait()
130135
}
131136

0 commit comments

Comments
 (0)