Skip to content

Commit

Permalink
E2e tests (#249)
Browse files Browse the repository at this point in the history
* Create e2e helper scripts

* Implement e2e tests

* Remove comment in e2e manifests

* Create RoleBinding in e2e namespaces

* Keep e2e namespaces optionally

* Do not automatically build images before e2e

* Update e2e tests

* Update e2e script

* Run e2e in a kind cluster

* Move e2e manifests

* Fix e2e script

* Install kubectl in travis

* Wait kind startup more

* Set env in CI

* Show cluster info

* Fix kubeconfig path in CI

* Cache image layers

* Fix range expression

* Use kubeconfig of KUBECONFIG if it exists

* Adjust port forwarding delay

* Fix e2e client initialization

* Exclude e2e tests from make test

* Create namespace per test case

* Exclude e2e tests from make coverage
  • Loading branch information
dtaniwaki authored and magaldima committed Mar 26, 2019
1 parent 806d3e5 commit 963abc2
Show file tree
Hide file tree
Showing 22 changed files with 1,367 additions and 52 deletions.
32 changes: 31 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,36 @@ language: go
go:
- 1.x

services:
- docker

cache:
directories:
- $HOME/bin
- $HOME/docker

env:
global:
- DOCKER_PUSH=false
- IMAGE_TAG=latest
- PATH=$HOME/bin:$PATH

before_install:
# Load cached docker images
- if [[ -d $HOME/docker ]]; then ls $HOME/docker/*.tar.gz | xargs -I {file} sh -c "zcat {file} | docker load"; fi
- go get github.com/mattn/goveralls
- go get sigs.k8s.io/kind
- if [ ! -d $HOME/bin/kubectl ]; then
mkdir -p $HOME/bin;
curl -o $HOME/bin/kubectl -L https://storage.googleapis.com/kubernetes-release/release/v1.13.4/bin/linux/amd64/kubectl;
chmod +x $HOME/bin/kubectl;
fi

before_cache:
# Save tagged docker images
- >
mkdir -p $HOME/docker && docker images -a --filter='dangling=false' --format '{{.Repository}}:{{.Tag}} {{.ID}}'
| xargs -n 2 -t sh -c 'test -e $HOME/docker/$1.tar.gz || docker save $0 | gzip -2 > $HOME/docker/$1.tar.gz'
install:
- curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
Expand All @@ -14,10 +42,12 @@ script:
- make all
- make test coverage
- $GOPATH/bin/goveralls -coverprofile=profile.cov -service=travis-ci
- make build-e2e-images
- make kind-e2e

deploy:
provider: releases
api_key: $GITHUB_OAUTH_TOKEN
skip_cleanup: true
on:
tags: true
tags: true
Loading

0 comments on commit 963abc2

Please sign in to comment.