Skip to content

Commit 1cd3f0f

Browse files
committed
run e2e tests as a part of PR workflow
1 parent 7fdf127 commit 1cd3f0f

File tree

3 files changed

+44
-1
lines changed

3 files changed

+44
-1
lines changed

Makefile

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
CMDS=nfsplugin
15+
CMDS=nfsplugin tests
1616
all: build
1717

1818
include release-tools/build.make
@@ -21,3 +21,10 @@ include release-tools/build.make
2121
sanity-test: build
2222
./test/sanity/run-test.sh
2323

24+
.PHONY: deploy-kind
25+
deploy-kind:
26+
test/util/deploy-kind.sh
27+
28+
.PHONY: e2e-test
29+
e2e-tests: deploy-kind build-tests
30+
./bin/tests --ginkgo.v --ginkgo.progress --kubeconfig=$$HOME/.kube/config

release-tools/travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ before_script:
1414
- export PATH=$PWD/bin:$PATH
1515
script:
1616
- make -k all test GOFLAGS_VENDOR=$( [ -d vendor ] && echo '-mod=vendor' )
17+
- make e2e-test
1718
after_success:
1819
- if [ "${TRAVIS_PULL_REQUEST}" == "false" ]; then
1920
docker login -u "${DOCKER_USERNAME}" -p "${DOCKER_PASSWORD}" quay.io;

test/utils/deploy-kind.sh

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Copyright 2020 The Kubernetes Authors.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
#!/bin/bash
16+
17+
KUBERNETES_VERSION=v1.18.8
18+
KUBECONFIG=$HOME/.kube/config
19+
20+
# Setup and download kind
21+
# curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.9.0/kind-linux-amd64 && chmod +x ./kind && sudo mv ./kind /usr/local/bin/kind
22+
# curl -Lo kubectl https://storage.googleapis.com/kubernetes-release/release/$KUBERNETES_VERSION/bin/linux/amd64/kubectl && chmod +x kubectl && sudo mv kubectl /usr/local/bin/
23+
# curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash
24+
25+
sudo kind create cluster --image kindest/node:$KUBERNETES_VERSION
26+
mkdir -p $HOME/.kube
27+
sudo chown -R $USER: $HOME/.kube/
28+
sudo kind get kubeconfig > $KUBECONFIG
29+
30+
echo "Seting up nfs-server-provisioner and deploying NFS CSI driver"
31+
32+
kubectl cluster-info
33+
JSONPATH='{range .items[*]}{@.metadata.name}:{range @.status.conditions[*]}{@.type}={@.status};{end}{end}'; until kubectl -n kube-system get pods -lk8s-app=kube-dns -o jsonpath="$JSONPATH" 2>&1 | grep -q "Ready=True"; do sleep 1;echo "waiting for kube-dns to be available"; done
34+
35+
echo "Cluster is running"

0 commit comments

Comments
 (0)