Skip to content

Commit 0d5de8b

Browse files
committed
Enable migration tests to run on GKE clusters.
1 parent ca2be10 commit 0d5de8b

File tree

3 files changed

+17
-3
lines changed

3 files changed

+17
-3
lines changed

test/k8s-integration/main.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,6 @@ func main() {
157157
}
158158

159159
if *deploymentStrat == "gke" {
160-
ensureFlag(migrationTest, false, "Cannot set deployment strategy to 'gke' for migration tests.")
161160
ensureVariable(kubeVersion, false, "Cannot set kube-version when using deployment strategy 'gke'. Use gke-cluster-version.")
162161
ensureExactlyOneVariableSet([]*string{gkeClusterVer, gkeReleaseChannel},
163162
"For GKE cluster deployment, exactly one of 'gke-cluster-version' or 'gke-release-channel' must be set")

test/run-k8s-integration-ci.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ readonly gke_node_version=${GKE_NODE_VERSION:-}
2727
readonly run_intree_plugin_tests=${RUN_INTREE_PLUGIN_TESTS:-false}
2828
readonly use_kubetest2=${USE_KUBETEST2:-true}
2929
readonly test_pd_labels=${TEST_PD_LABELS:-true}
30+
readonly migration_test=${MIGRATION_TEST:-false}
31+
32+
readonly GCE_PD_TEST_FOCUS="PersistentVolumes\sGCEPD|[V|v]olume\sexpand|\[sig-storage\]\sIn-tree\sVolumes\s\[Driver:\sgcepd\]|allowedTopologies|Pod\sDisks|PersistentVolumes\sDefault"
3033

3134
storage_classes=sc-balanced.yaml,sc-ssd.yaml
3235

@@ -59,7 +62,9 @@ base_cmd="${PKGDIR}/bin/k8s-integration-test \
5962
--deployment-strategy=${deployment_strategy} --test-version=${test_version} \
6063
--num-nodes=3 --image-type=${image_type} --use-kubetest2=${use_kubetest2}"
6164

62-
if [ "$run_intree_plugin_tests" = true ]; then
65+
if [ "$migration_test" = true ]; then
66+
base_cmd="${base_cmd} --migration-test=true --test-focus=${GCE_PD_TEST_FOCUS}"
67+
elif [ "$run_intree_plugin_tests" = true ]; then
6368
base_cmd="${base_cmd} --test-focus='External.Storage|In-tree.*Driver.*gcepd'"
6469
else
6570
base_cmd="${base_cmd} --test-focus='External.Storage'"

test/run-k8s-integration.sh

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,12 @@ readonly gke_release_channel=${GKE_RELEASE_CHANNEL:-""}
2525
readonly teardown_driver=${GCE_PD_TEARDOWN_DRIVER:-true}
2626
readonly gke_node_version=${GKE_NODE_VERSION:-}
2727
readonly use_kubetest2=${USE_KUBETEST2:-true}
28+
readonly migration_test=${MIGRATION_TEST:-false}
2829

2930
export GCE_PD_VERBOSITY=9
3031

32+
readonly GCE_PD_TEST_FOCUS="PersistentVolumes\sGCEPD|[V|v]olume\sexpand|\[sig-storage\]\sIn-tree\sVolumes\s\[Driver:\sgcepd\]|allowedTopologies|Pod\sDisks|PersistentVolumes\sDefault"
33+
3134
make -C "${PKGDIR}" test-k8s-integration
3235

3336
if [ "$use_kubetest2" = true ]; then
@@ -42,7 +45,7 @@ base_cmd="${PKGDIR}/bin/k8s-integration-test \
4245
--run-in-prow=true --service-account-file=${E2E_GOOGLE_APPLICATION_CREDENTIALS} \
4346
--do-driver-build=${do_driver_build} --teardown-driver=${teardown_driver} --boskos-resource-type=${boskos_resource_type} \
4447
--storageclass-files=sc-standard.yaml --snapshotclass-file=pd-volumesnapshotclass.yaml \
45-
--test-focus='External.Storage' --deployment-strategy=${deployment_strategy} --test-version=${test_version} \
48+
--deployment-strategy=${deployment_strategy} --test-version=${test_version} \
4649
--num-nodes=3 --image-type=${image_type} --use-kubetest2=${use_kubetest2}"
4750

4851
if [ "$use_gke_managed_driver" = false ]; then
@@ -70,4 +73,11 @@ fi
7073
if [ -z "$gke_node_version" ]; then
7174
base_cmd="${base_cmd} --gke-node-version=${gke_node_version}"
7275
fi
76+
77+
if [ "$migration_test" = "true" ]; then
78+
base_cmd="${base_cmd} --migration-test=true --test-focus=${GCE_PD_TEST_FOCUS}"
79+
else
80+
base_cmd="${base_cmd} --test-focus='External.Storage'"
81+
fi
82+
7383
eval "$base_cmd"

0 commit comments

Comments
 (0)