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 <madhupr007@gmail.com>
This commit is contained in:
Madhu Rajanna 2019-05-29 15:32:16 +05:30
parent 5e04be9e1f
commit 9bb23e4e32
3 changed files with 13 additions and 4 deletions

View File

@ -29,6 +29,7 @@ env:
- KUBE_VERSION=v1.14.2 - KUBE_VERSION=v1.14.2
- MINIKUBE_VERSION=v1.1.0 - MINIKUBE_VERSION=v1.1.0
- CHANGE_MINIKUBE_NONE_USER=true - CHANGE_MINIKUBE_NONE_USER=true
- KUBECONFIG=$HOME/.kube/config
jobs: jobs:
include: include:
@ -50,11 +51,15 @@ jobs:
script: script:
- scripts/skip-doc-change.sh || travis_terminate 0; - scripts/skip-doc-change.sh || travis_terminate 0;
- make cephcsi || travis_terminate 1; - make cephcsi || travis_terminate 1;
- make image-cephcsi || travis_terminate 1;
- sudo scripts/minikube.sh up || travis_terminate 1; - sudo scripts/minikube.sh up || travis_terminate 1;
# pull docker images to speed up e2e # pull docker images to speed up e2e
- scripts/minikube.sh cephcsi - scripts/minikube.sh cephcsi
- scripts/minikube.sh k8s-sidecar - scripts/minikube.sh k8s-sidecar
- "sudo chown -R travis: $HOME/.minikube /usr/local/bin/kubectl" - "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: deploy:
- provider: script - provider: script

View File

@ -32,6 +32,9 @@ static-check:
./scripts/lint-go.sh ./scripts/lint-go.sh
./scripts/lint-text.sh ./scripts/lint-text.sh
func-test:
go test github.com/ceph/ceph-csi/e2e $(TESTOPTIONS)
.PHONY: cephcsi .PHONY: cephcsi
cephcsi: cephcsi:
if [ ! -d ./vendor ]; then dep ensure -vendor-only; fi if [ ! -d ./vendor ]; then dep ensure -vendor-only; fi

View File

@ -18,8 +18,10 @@ function wait_for_ssh() {
function copy_image_to_cluster() { function copy_image_to_cluster() {
local build_image=$1 local build_image=$1
local final_image=$2 local final_image=$2
if [[ "${VM_DRIVER}" == "none" ]]; then if [ -z "$(docker images -q "${build_image}")" ]; then
docker pull "${build_image}" docker pull "${build_image}"
fi
if [[ "${VM_DRIVER}" == "none" ]]; then
docker tag "${build_image}" "${final_image}" docker tag "${build_image}" "${final_image}"
return return
fi fi
@ -98,9 +100,8 @@ ssh)
minikube ssh minikube ssh
;; ;;
cephcsi) cephcsi)
echo "copying the cephcsi images" echo "copying the cephcsi image"
copy_image_to_cluster "${CEPHCSI_IMAGE_REPO}"/rbdplugin:canary "${CEPHCSI_IMAGE_REPO}"/rbdplugin:v1.0.0 copy_image_to_cluster "${CEPHCSI_IMAGE_REPO}"/cephcsi:canary "${CEPHCSI_IMAGE_REPO}"/cephcsi:canary
copy_image_to_cluster "${CEPHCSI_IMAGE_REPO}"/cephfsplugin:canary "${CEPHCSI_IMAGE_REPO}"/cephfsplugin:v1.0.0
;; ;;
k8s-sidecar) k8s-sidecar)
echo "copying the kubernetes sidecar images" echo "copying the kubernetes sidecar images"