From 9bb23e4e32f3ebc0f83eba7b5d165c1a8aa4b27e Mon Sep 17 00:00:00 2001 From: Madhu Rajanna Date: Wed, 29 May 2019 15:32:16 +0530 Subject: [PATCH] code changes for E2E update travis and makefile for functional test skip docker pull if image is already present on local machine. if the image is not present locally pull the image from repo. export kubeconfig in travis build cephcsi image in travis job for functional testing Signed-off-by: Madhu Rajanna --- .travis.yml | 5 +++++ Makefile | 3 +++ scripts/minikube.sh | 9 +++++---- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 08abe751f..1233a07e9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -29,6 +29,7 @@ env: - KUBE_VERSION=v1.14.2 - MINIKUBE_VERSION=v1.1.0 - CHANGE_MINIKUBE_NONE_USER=true + - KUBECONFIG=$HOME/.kube/config jobs: include: @@ -50,11 +51,15 @@ jobs: script: - scripts/skip-doc-change.sh || travis_terminate 0; - make cephcsi || travis_terminate 1; + - make image-cephcsi || travis_terminate 1; - sudo scripts/minikube.sh up || travis_terminate 1; # pull docker images to speed up e2e - scripts/minikube.sh cephcsi - scripts/minikube.sh k8s-sidecar - "sudo chown -R travis: $HOME/.minikube /usr/local/bin/kubectl" + # functional tests + - make func-test TESTOPTIONS='--rook-version=v1.0.0 \ + --deploy-rook=true --deploy-timeout=10 -timeout=20m -v' deploy: - provider: script diff --git a/Makefile b/Makefile index 17b8b3d15..89eff2d11 100644 --- a/Makefile +++ b/Makefile @@ -32,6 +32,9 @@ static-check: ./scripts/lint-go.sh ./scripts/lint-text.sh +func-test: + go test github.com/ceph/ceph-csi/e2e $(TESTOPTIONS) + .PHONY: cephcsi cephcsi: if [ ! -d ./vendor ]; then dep ensure -vendor-only; fi diff --git a/scripts/minikube.sh b/scripts/minikube.sh index ab06dac2f..e421169ce 100755 --- a/scripts/minikube.sh +++ b/scripts/minikube.sh @@ -18,8 +18,10 @@ function wait_for_ssh() { function copy_image_to_cluster() { local build_image=$1 local final_image=$2 - if [[ "${VM_DRIVER}" == "none" ]]; then + if [ -z "$(docker images -q "${build_image}")" ]; then docker pull "${build_image}" + fi + if [[ "${VM_DRIVER}" == "none" ]]; then docker tag "${build_image}" "${final_image}" return fi @@ -98,9 +100,8 @@ ssh) minikube ssh ;; cephcsi) - echo "copying the cephcsi images" - copy_image_to_cluster "${CEPHCSI_IMAGE_REPO}"/rbdplugin:canary "${CEPHCSI_IMAGE_REPO}"/rbdplugin:v1.0.0 - copy_image_to_cluster "${CEPHCSI_IMAGE_REPO}"/cephfsplugin:canary "${CEPHCSI_IMAGE_REPO}"/cephfsplugin:v1.0.0 + echo "copying the cephcsi image" + copy_image_to_cluster "${CEPHCSI_IMAGE_REPO}"/cephcsi:canary "${CEPHCSI_IMAGE_REPO}"/cephcsi:canary ;; k8s-sidecar) echo "copying the kubernetes sidecar images"