Files
odo/.travis.yml
Priti Kumari 7da08b69ba devfile create Interation test on kubernetes cluster using travis CI (#2884)
* Run devfile create Interation test on kubernetes cluster

* Skipping s2i image related test on kubernetes cluster
2020-06-11 04:23:34 -04:00

197 lines
6.7 KiB
YAML

dist: xenial
sudo: required
language: go
jobs:
include:
# YAML alias, for settings shared across the tests
- &base-test
stage: test
go_import_path: github.com/openshift/odo
go: "1.12.x"
install:
- make goget-tools
script:
- lsb_release -a
- export PATH="$PATH:$GOPATH/bin"
- make bin
- make validate
- make test-coverage
after_success:
# submit coverage.txt to codecov.io
- bash <(curl -s https://codecov.io/bash)
# YAML alias, for settings shared across the tests on windows
- &windows-test
stage: Test
name: "Unit test on windows"
os:
- windows
init:
- git config --system core.longpaths true
go_import_path: github.com/openshift/odo
go: "1.12.x"
install:
- systeminfo.exe | grep '^OS'
- choco install make
- make goget-tools
script:
- export PATH="$PATH:$GOPATH/bin"
- make bin
- rm -r /tmp/*
- make test
after_success: skip
# YAML alias, for settings shared across the tests on macOS
- &osx-test
stage: Test
name: "Unit test on OSX"
os:
- osx
go_import_path: github.com/openshift/odo
go: "1.12.x"
install:
- make goget-tools
script:
- system_profiler SPSoftwareDataType
- export PATH="$PATH:$GOPATH/bin"
- make bin
- make validate
- make test
after_success: skip
- <<: *base-test
stage: test
name: "generic, login and component command integration tests"
script:
- ./scripts/oc-cluster.sh
- make bin
- sudo cp odo /usr/bin
- odo login -u developer
- travis_wait make test-generic
- travis_wait make test-cmd-login-logout
- travis_wait make test-cmd-cmp
- odo logout
- <<: *base-test
stage: test
name: "preference, config, url and debug command integration tests"
script:
- ./scripts/oc-cluster.sh
- make bin
- sudo cp odo /usr/bin
- odo login -u developer
- travis_wait make test-cmd-pref-config
- travis_wait make test-cmd-url
- travis_wait make test-cmd-devfile-url
- travis_wait make test-cmd-debug
- odo logout
# Run service-catalog e2e tests
- <<: *base-test
stage: test
name: "service, link and component sub-commands command integration tests"
script:
- ./scripts/oc-cluster.sh service-catalog
- make bin
- sudo cp odo /usr/bin
- odo login -u developer
- travis_wait make test-cmd-service
- travis_wait make test-cmd-link-unlink
- travis_wait make test-cmd-cmp-sub
- odo logout
- <<: *base-test
stage: test
name: "watch, storage, app, project and push command integration tests"
script:
- ./scripts/oc-cluster.sh
- make bin
- sudo cp odo /usr/bin
- odo login -u developer
- travis_wait make test-cmd-watch
- travis_wait make test-cmd-storage
- travis_wait make test-cmd-app
- travis_wait make test-cmd-push
- travis_wait make test-cmd-project
- odo logout
- <<: *base-test
stage: test
# Docker push target test command does not need a running cluster at all, however few test
# scenario of docker devfile url testing needs only Kube config file. So the test has been
# added here just to make sure docker devfile url command test gets a proper kube config file.
# without creating a separate OpenShift cluster.
name: "devfile catalog, create, push, delete, registry and docker devfile url command integration tests"
script:
- ./scripts/oc-cluster.sh
- make bin
- sudo cp odo /usr/bin
- travis_wait make test-cmd-docker-devfile-url-pushtarget
# These tests need cluster login as they will be interacting with a Kube environment
- odo login -u developer
- travis_wait make test-cmd-devfile-catalog
- travis_wait make test-cmd-devfile-create
- travis_wait make test-cmd-devfile-push
- travis_wait make test-cmd-devfile-watch
- travis_wait make test-cmd-devfile-delete
- travis_wait make test-cmd-devfile-registry
- odo logout
- <<: *base-test
stage: test
name: "core beta, java, source e2e tests"
script:
- ./scripts/oc-cluster.sh
- make bin
- sudo cp odo /usr/bin
- odo login -u developer
- travis_wait make test-e2e-beta
- travis_wait make test-e2e-java
- travis_wait make test-e2e-source
- travis_wait make test-e2e-images
- odo logout
- <<: *base-test
stage: test
name: "docker devfile push, watch, catalog and delete command integration tests"
script:
- make bin
- sudo cp odo /usr/bin
- travis_wait make test-cmd-docker-devfile-push
- travis_wait make test-cmd-docker-devfile-watch
- travis_wait make test-cmd-docker-devfile-catalog
- travis_wait make test-cmd-docker-devfile-delete
- travis_wait make test-cmd-docker-devfile-url
# Run devfile integration test on Kubernetes cluster
- <<: *base-test
stage: test
name: "devfile catalog, watch, push, delete and create command integration tests on kubernetes cluster"
env:
- MINIKUBE_WANTUPDATENOTIFICATION=false
- MINIKUBE_WANTREPORTERRORPROMPT=false
- MINIKUBE_HOME=$HOME
- CHANGE_MINIKUBE_NONE_USER=true
- KUBECONFIG=$HOME/.kube/config
before_script:
# Download kubectl, a cli tool for accessing Kubernetes cluster
- curl -Lo kubectl https://storage.googleapis.com/kubernetes-release/release/v1.16.0/bin/linux/amd64/kubectl && chmod +x kubectl && sudo mv kubectl /usr/local/bin/
# Download minikube and set up Kubernetes single node cluster
- curl -Lo minikube https://storage.googleapis.com/minikube/releases/v1.4.0/minikube-linux-amd64 && chmod +x minikube && sudo mv minikube /usr/local/bin/
- mkdir -p $HOME/.kube $HOME/.minikube
- touch $KUBECONFIG
- sudo minikube start --vm-driver=none --kubernetes-version=v1.16.0
- "sudo chown -R travis: /home/travis/.minikube/"
script:
- kubectl cluster-info
- make bin
- sudo cp odo /usr/bin
- export KUBERNETES=true
- travis_wait make test-cmd-devfile-catalog
- travis_wait make test-cmd-devfile-watch
- travis_wait make test-cmd-devfile-push
- travis_wait make test-cmd-devfile-delete
- travis_wait make test-cmd-devfile-create