Skip to content

Commit

Permalink
setup k8s external e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
boddumanohar committed Apr 26, 2021
1 parent ab54953 commit 4368a82
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 4 deletions.
23 changes: 19 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,6 @@ integration-test: azuredisk
integration-test-v2: azuredisk-v2
go test -v -timeout=30m ./test/integration --temp-use-driver-v2

.PHONY: e2e-test
e2e-test:
go test -v -timeout=0 ./test/e2e ${GINKGO_FLAGS}

.PHONY: e2e-bootstrap
e2e-bootstrap: install-helm
docker pull $(IMAGE_TAG) || make container-all push-manifest
Expand Down Expand Up @@ -227,3 +223,22 @@ create-metrics-svc:
delete-metrics-svc:
kubectl delete -f deploy/example/metrics/csi-azuredisk-controller-svc.yaml --ignore-not-found

.PHONY: setup-external-e2e
setup-external-e2e:
curl -sL https://storage.googleapis.com/kubernetes-release/release/v1.19.0/kubernetes-test-linux-amd64.tar.gz --output e2e-tests.tar.gz
tar -xvf e2e-tests.tar.gz
rm e2e-tests.tar.gz
mkdir /tmp/csi-azuredisk
cp ./kubernetes/test/bin/e2e.test /tmp/csi-azuredisk/e2e.test
rm -r kubernetes
cp ./deploy/example/storageclass-azuredisk-csi.yaml /tmp/csi-azuredisk/storageclass.yaml
cp ./test/external-e2e/manifest/testdriver.yaml /tmp/csi-azuredisk/testdriver.yaml
./deploy/install-driver.sh

.PHONY: e2e-test
e2e-test: setup-external-e2e
if [[ -z "$(EXTERNAL_E2E_TEST)" ]]; then \
bash ./test/external-e2e/run.sh;\
else \
go test -v -timeout=0 ./test/e2e ${GINKGO_FLAGS};\
fi
28 changes: 28 additions & 0 deletions test/external-e2e/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/bash

# Copyright 2021 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Ensure that we have the desired version of the ginkgo test runner.
install_ginkgo () {
apt update -y
apt install -y golang-ginkgo-dev
}

install_ginkgo

ginkgo -p --progress --v -focus='External.Storage' \
-skip='\[Disruptive\]' /tmp/csi-azuredisk/e2e.test -- \
-storage.testdriver=/tmp/csi-azuredisk/testdriver.yaml \
--kubeconfig=$KUBECONFIG

0 comments on commit 4368a82

Please sign in to comment.