Skip to content

Commit 5b27c88

Browse files
committed
fixup: address review comments
1 parent c2bd01e commit 5b27c88

7 files changed

+25
-16
lines changed

test/e2e/tests/single_zone_e2e_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -900,7 +900,7 @@ var _ = Describe("GCE PD CSI Driver", func() {
900900
Expect(err).To(BeNil(), "Could not get snapshot from cloud directly")
901901
Expect(snapshot.Name).To(Equal(snapshotName))
902902

903-
err = wait.Poll(10*time.Second, 3*time.Minute, func() (bool, error) {
903+
err = wait.Poll(10*time.Second, 5*time.Minute, func() (bool, error) {
904904
snapshot, err := computeService.Images.Get(p, snapshotName).Do()
905905
Expect(err).To(BeNil(), "Could not get snapshot from cloud directly")
906906
if snapshot.Status == "READY" {

test/k8s-integration/main.go

+15-6
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ var (
5757
// Test infrastructure flags
5858
boskosResourceType = flag.String("boskos-resource-type", "gce-project", "name of the boskos resource type to reserve")
5959
storageClassFiles = flag.String("storageclass-files", "", "name of storageclass yaml file to use for test relative to test/k8s-integration/config. This may be a comma-separated list to test multiple storage classes")
60-
snapshotClassFile = flag.String("snapshotclass-file", "", "name of snapshotclass yaml file to use for test relative to test/k8s-integration/config")
60+
snapshotClassFiles = flag.String("snapshotclass-files", "", "name of snapshotclass yaml file to use for test relative to test/k8s-integration/config. This may be a comma-separated list to test multiple snapshot classes")
6161
inProw = flag.Bool("run-in-prow", false, "is the test running in PROW")
6262

6363
// Driver flags
@@ -203,7 +203,6 @@ func handle() error {
203203
testParams := &testParameters{
204204
platform: *platform,
205205
testFocus: *testFocus,
206-
snapshotClassFile: *snapshotClassFile,
207206
stagingVersion: string(uuid.NewUUID()),
208207
deploymentStrategy: *deploymentStrat,
209208
useGKEManagedDriver: *useGKEManagedDriver,
@@ -481,6 +480,7 @@ func handle() error {
481480
// Run the tests using the k8sSourceDir kubernetes
482481
if len(*storageClassFiles) != 0 {
483482
applicableStorageClassFiles := []string{}
483+
applicableSnapshotClassFiles := []string{}
484484
for _, rawScFile := range strings.Split(*storageClassFiles, ",") {
485485
scFile := strings.TrimSpace(rawScFile)
486486
if len(scFile) == 0 {
@@ -492,16 +492,25 @@ func handle() error {
492492
}
493493
applicableStorageClassFiles = append(applicableStorageClassFiles, scFile)
494494
}
495+
for _, rawSnapshotClassFile := range strings.Split(*snapshotClassFiles, ",") {
496+
snapshotClassFile := strings.TrimSpace(rawSnapshotClassFile)
497+
if len(snapshotClassFile) != 0 {
498+
applicableSnapshotClassFiles = append(applicableStorageClassFiles, snapshotClassFile)
499+
}
500+
}
495501
if len(applicableStorageClassFiles) == 0 {
496502
return fmt.Errorf("No applicable storage classes found")
497503
}
498504
var ginkgoErrors []string
499505
var testOutputDirs []string
500506
for _, scFile := range applicableStorageClassFiles {
501-
outputDir := strings.TrimSuffix(scFile, ".yaml")
502-
testOutputDirs = append(testOutputDirs, outputDir)
503-
if err = runCSITests(testParams, scFile, outputDir); err != nil {
504-
ginkgoErrors = append(ginkgoErrors, err.Error())
507+
for _, snapshotClassFile := range applicableSnapshotClassFiles {
508+
outputDir := strings.TrimSuffix(scFile, ".yaml")
509+
testOutputDirs = append(testOutputDirs, outputDir)
510+
testParams.snapshotClassFile = snapshotClassFile
511+
if err = runCSITests(testParams, scFile, outputDir); err != nil {
512+
ginkgoErrors = append(ginkgoErrors, err.Error())
513+
}
505514
}
506515
}
507516
if err = mergeArtifacts(testOutputDirs); err != nil {

test/run-k8s-integration-ci.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,9 @@ if [ -n "$gke_node_version" ]; then
102102
fi
103103

104104
if [ "$test_disk_image_snapshot" = true ]; then
105-
base_cmd="${base_cmd} --snapshotclass-file=pd-volumesnapshotclass.yaml"
105+
base_cmd="${base_cmd} --snapshotclass-files=pd-volumesnapshotclass.yaml,image-volumesnapshotclass.yaml"
106106
else
107-
base_cmd="${base_cmd} --snapshotclass-file=image-volumesnapshotclass.yaml"
107+
base_cmd="${base_cmd} --snapshotclass-files=pd-volumesnapshotclass.yaml"
108108
fi
109109

110110
eval "$base_cmd"

test/run-k8s-integration-local.sh

+4-4
Original file line numberDiff line numberDiff line change
@@ -59,16 +59,16 @@ make -C "${PKGDIR}" test-k8s-integration
5959
# snapshot tests for the PD CSI driver using disk image snapshots.
6060
#${PKGDIR}/bin/k8s-integration-test --run-in-prow=false \
6161
#--staging-image=${GCE_PD_CSI_STAGING_IMAGE} --service-account-file=${GCE_PD_SA_DIR}/cloud-sa.json \
62-
#--deploy-overlay-name=prow-gke-release-staging-head --bringup-cluster=false --teardown-cluster=false --test-focus="External.*Storage.*snapshot" --local-k8s-dir=$KTOP \
63-
#--storageclass-files=sc-standard.yaml,sc-balanced.yaml,sc-ssd.yaml --snapshotclass-file=image-volumesnapshotclass.yaml --do-driver-build=true \
62+
#--deploy-overlay-name=prow-canary-sidecar --bringup-cluster=false --teardown-cluster=false --test-focus="External.*Storage.*snapshot" --local-k8s-dir=$KTOP \
63+
#--storageclass-files=sc-standard.yaml,sc-balanced.yaml,sc-ssd.yaml --snapshotclass-files=image-volumesnapshotclass.yaml --do-driver-build=true \
6464
#--gce-zone="us-central1-b" --num-nodes=${NUM_NODES:-3}
6565

6666
# This version of the command brings up (and subsequently tears down) a GKE
6767
# cluster with managed GCE PersistentDisk CSI driver add-on enabled, and points to
6868
# the local K8s repository to get the e2e test binary.
6969
# ${PKGDIR}/bin/k8s-integration-test --run-in-prow=false --service-account-file=${GCE_PD_SA_DIR}/cloud-sa.json \
7070
# --test-focus="External.Storage" --local-k8s-dir=$KTOP --storageclass-files=sc-standard.yaml,sc-balanced.yaml,sc-ssd.yaml \
71-
# --snapshotclass-file=pd-volumesnapshotclass.yaml --do-driver-build=false --teardown-driver=false \
71+
# --snapshotclass-files=pd-volumesnapshotclass.yaml --do-driver-build=false --teardown-driver=false \
7272
# --gce-zone="us-central1-c" --num-nodes=${NUM_NODES:-3} --gke-cluster-version="latest" --deployment-strategy="gke" \
7373
# --use-gke-managed-driver=true --teardown-cluster=true
7474

@@ -77,7 +77,7 @@ make -C "${PKGDIR}" test-k8s-integration
7777
# the local K8s repository to get the e2e test binary.
7878
# ${PKGDIR}/bin/k8s-integration-test --run-in-prow=false --service-account-file=${GCE_PD_SA_DIR}/cloud-sa.json \
7979
# --test-focus="External.Storage" --local-k8s-dir=$KTOP --storageclass-files=sc-standard.yaml,sc-balanced.yaml,sc-ssd.yaml \
80-
# --snapshotclass-file=pd-volumesnapshotclass.yaml --do-driver-build=false --teardown-driver=false \
80+
# --snapshotclass-files=pd-volumesnapshotclass.yaml --do-driver-build=false --teardown-driver=false \
8181
# --gce-zone="us-central1-c" --num-nodes=${NUM_NODES:-3} --gke-release-channel="rapid" --deployment-strategy="gke" \
8282
# --use-gke-managed-driver=true --teardown-cluster=true
8383

test/run-k8s-integration.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ fi
4444
base_cmd="${PKGDIR}/bin/k8s-integration-test \
4545
--run-in-prow=true --service-account-file=${E2E_GOOGLE_APPLICATION_CREDENTIALS} \
4646
--do-driver-build=${do_driver_build} --teardown-driver=${teardown_driver} --boskos-resource-type=${boskos_resource_type} \
47-
--storageclass-files=sc-standard.yaml --snapshotclass-file=pd-volumesnapshotclass.yaml \
47+
--storageclass-files=sc-standard.yaml --snapshotclass-files=pd-volumesnapshotclass.yaml \
4848
--deployment-strategy=${deployment_strategy} --test-version=${test_version} \
4949
--num-nodes=3 --image-type=${image_type} --use-kubetest2=${use_kubetest2}"
5050

test/run-windows-k8s-integration.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,6 @@ ${PKGDIR}/bin/k8s-integration-test \
5151
--test-version="${test_version}" \
5252
--kube-version="${kube_version}" \
5353
--storageclass-files=sc-windows.yaml \
54-
--snapshotclass-file=pd-volumesnapshotclass.yaml \
54+
--snapshotclass-files=pd-volumesnapshotclass.yaml \
5555
--test-focus='External.Storage' \
5656
--use-kubetest2="${use_kubetest2}"

test/run-windows-k8s-migration.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,6 @@ ${PKGDIR}/bin/k8s-integration-test \
6060
--kube-version="${kube_version}" \
6161
--kube-feature-gates="${feature_gates}" \
6262
--storageclass-files=sc-windows.yaml \
63-
--snapshotclass-file=pd-volumesnapshotclass.yaml \
63+
--snapshotclass-files=pd-volumesnapshotclass.yaml \
6464
--test-focus="${GCE_PD_TEST_FOCUS}" \
6565
--use-kubetest2="${use_kubetest2}"

0 commit comments

Comments
 (0)