update travis to run func test against different kube version

updated travis to run functional tests
against different kubernetes versions

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
This commit is contained in:
Madhu Rajanna 2019-06-13 14:40:02 +05:30 committed by mergify[bot]
parent 69662e63ed
commit fb0cbef68b
3 changed files with 28 additions and 13 deletions

View File

@ -21,12 +21,11 @@ go: 1.11.x
env: env:
global: global:
- GOLANGCI_VERSION="v1.17.0" - GOLANGCI_VERSION=v1.17.0
- TEST_COVERAGE=stdout - TEST_COVERAGE=stdout
- GO_METALINTER_THREADS=1 - GO_METALINTER_THREADS=1
- GO_COVER_DIR=_output - GO_COVER_DIR=_output
- VM_DRIVER=none - VM_DRIVER=none
- KUBE_VERSION=v1.14.2
- MINIKUBE_VERSION=v1.1.1 - MINIKUBE_VERSION=v1.1.1
- CHANGE_MINIKUBE_NONE_USER=true - CHANGE_MINIKUBE_NONE_USER=true
- KUBECONFIG=$HOME/.kube/config - KUBECONFIG=$HOME/.kube/config
@ -39,26 +38,26 @@ jobs:
- pip install --user --upgrade pip - pip install --user --upgrade pip
- pip install --user yamllint - pip install --user yamllint
# install golangci-lint # install golangci-lint
# workaround for https://github.com/golangci/golangci-lint/issues/575
- curl -sf - curl -sf
"https://install.goreleaser.com/github.com/golangci/golangci-lint.sh" "https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh"
| bash -s -- -b $GOPATH/bin "${GOLANGCI_VERSION}" | bash -s -- -b $GOPATH/bin "${GOLANGCI_VERSION}"
script: script:
- scripts/lint-text.sh --require-all - scripts/lint-text.sh --require-all
- scripts/lint-go.sh - scripts/lint-go.sh
- scripts/test-go.sh - scripts/test-go.sh
- name: cephcsi - name: cephcsi with kube 1.13.7
script: script:
- scripts/skip-doc-change.sh || travis_terminate 0; - scripts/skip-doc-change.sh || travis_terminate 0;
- make image-cephcsi || travis_terminate 1; - make image-cephcsi || travis_terminate 1;
- sudo scripts/minikube.sh up || travis_terminate 1; - scripts/travis-functest.sh v1.13.7 || travis_terminate 1;
# pull docker images to speed up e2e
- scripts/minikube.sh cephcsi - name: cephcsi with kube 1.14.3
- scripts/minikube.sh k8s-sidecar script:
- "sudo chown -R travis: $HOME/.minikube /usr/local/bin/kubectl" - scripts/skip-doc-change.sh || travis_terminate 0;
# functional tests - make image-cephcsi || travis_terminate 1;
- make func-test TESTOPTIONS='--rook-version=v1.0.1 \ - scripts/travis-functest.sh v1.14.3 || travis_terminate 1;
--deploy-rook=true --deploy-timeout=10 -timeout=30m -v'
deploy: deploy:
- provider: script - provider: script

View File

@ -11,7 +11,7 @@ function check_file_present() {
local file=$1 local file=$1
for FILE in "${FILES[@]}"; do for FILE in "${FILES[@]}"; do
if [[ $file =~ $FILE ]]; then if [[ $file =~ $FILE ]]; then
if [[ $file =~ minikube.sh ]]; then if [[ $file =~ (minikube.sh|travis-functest.sh) ]]; then
continue continue
fi fi
return 0 return 0

16
scripts/travis-functest.sh Executable file
View File

@ -0,0 +1,16 @@
#!/bin/bash
set -e
# This script will be used by travis to run functional test
# against different kuberentes version
export KUBE_VERSION=$1
sudo scripts/minikube.sh up
# pull docker images to speed up e2e
sudo scripts/minikube.sh cephcsi
sudo scripts/minikube.sh k8s-sidecar
sudo chown -R travis: "$HOME"/.minikube /usr/local/bin/kubectl
# functional tests
go test github.com/ceph/ceph-csi/e2e --rook-version=v1.0.1 --deploy-rook=true --deploy-timeout=10 -timeout=30m -v
sudo scripts/minikube.sh clean