Skip to content

Commit

Permalink
Fail unit and e2e tests on any errors
Browse files Browse the repository at this point in the history
  • Loading branch information
seanmalloy committed May 19, 2021
1 parent 0397425 commit 70c0ac8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
9 changes: 6 additions & 3 deletions test/run-e2e-tests.sh
Expand Up @@ -14,22 +14,25 @@

#!/bin/bash

set -x
set -o errexit
set -o nounset

# This just runs e2e tests.
if [ -n "$KIND_E2E" ]; then
K8S_VERSION=${KUBERNETES_VERSION:-v1.21.1}
curl -Lo kubectl https://storage.googleapis.com/kubernetes-release/release/${K8S_VERSION}/bin/linux/amd64/kubectl && chmod +x kubectl && sudo mv kubectl /usr/local/bin/
curl -Lo kubectl https://storage.googleapis.com/kubernetes-release/release/${K8S_VERSION}/bin/linux/amd64/kubectl && chmod +x kubectl && mv kubectl /usr/local/bin/
wget https://github.com/kubernetes-sigs/kind/releases/download/v0.11.0/kind-linux-amd64
chmod +x kind-linux-amd64
mv kind-linux-amd64 kind
export PATH=$PATH:$PWD
kind create cluster --image kindest/node:${K8S_VERSION} --config=./hack/kind_config.yaml
export KUBECONFIG="$(kind get kubeconfig-path)"
docker pull kubernetes/pause
kind load docker-image kubernetes/pause
kind get kubeconfig > /tmp/admin.conf
export KUBECONFIG="/tmp/admin.conf"
mkdir -p ~/gopath/src/sigs.k8s.io/
mv ~/gopath/src/github.com/kubernetes-sigs/descheduler ~/gopath/src/sigs.k8s.io/.
#mv ~/gopath/src/github.com/kubernetes-sigs/descheduler ~/gopath/src/sigs.k8s.io/.
fi

PRJ_PREFIX="sigs.k8s.io/descheduler"
Expand Down
4 changes: 4 additions & 0 deletions test/run-unit-tests.sh
Expand Up @@ -14,6 +14,10 @@

#!/bin/bash

set -x
set -o errexit
set -o nounset

# This just run unit-tests. Ignoring the current directory so as to avoid running e2e tests.
PRJ_PREFIX="sigs.k8s.io/descheduler"
go test $(go list ${PRJ_PREFIX}/... | grep -v ${PRJ_PREFIX}/vendor/| grep -v ${PRJ_PREFIX}/test/)

0 comments on commit 70c0ac8

Please sign in to comment.