kube-prometheus: Add e2e tests

This commit is contained in:
Max Leonard Inden
2019-01-24 11:30:21 +01:00
parent f0d8ba64d7
commit 0687c56cea
4 changed files with 197 additions and 0 deletions

24
tests/e2e/travis-e2e.sh Executable file
View File

@@ -0,0 +1,24 @@
#!/usr/bin/env bash
# exit immediately when a command fails
set -e
# only exit with zero if all commands of the pipeline exit successfully
set -o pipefail
# error on unset variables
set -u
# print each command before executing it
set -x
SCRIPT_DIR=$(dirname "${BASH_SOURCE[0]}")
"${SCRIPT_DIR}"/../../../../scripts/create-minikube.sh
# waiting for kube-dns to be ready
JSONPATH='{range .items[*]}{@.metadata.name}:{range @.status.conditions[*]}{@.type}={@.status};{end}{end}'; until kubectl -n kube-system get pods -lk8s-app=kube-dns -o jsonpath="$JSONPATH" 2>&1 | grep -q "Ready=True"; do sleep 1;echo "waiting for kube-dns to be available"; kubectl get pods --all-namespaces; done
(
cd "${SCRIPT_DIR}"/../.. || exit
kubectl apply -f manifests
KUBECONFIG=~/.kube/config make test-e2e
)
"${SCRIPT_DIR}"/../../../../scripts/delete-minikube.sh