Remove unused variables and verbose e2e logs

This commit is contained in:
Manuel Alejandro de Brito Fontes 2020-06-27 11:57:00 -04:00
parent 47b5e20a88
commit 10dcf0db15
35 changed files with 331 additions and 427 deletions

View file

@ -1,24 +1,8 @@
.PHONY: all
all: image
DIR:=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
# Use docker to run makefile tasks
USE_DOCKER ?= true
# Disable run docker tasks if running in prow.
# only checks the existence of the variable, not the value.
ifdef DIND_TASKS
USE_DOCKER=false
endif
.PHONY: image
image:
ifeq ($(USE_DOCKER), true)
@$(DIR)/../../build/run-in-docker.sh make e2e-test-binary
else
@make -C $(DIR)/../../ e2e-test-binary
endif
make -C $(DIR)/../../ e2e-test-binary
cp $(DIR)/../e2e/e2e.test .
cp $(DIR)/../e2e/wait-for-nginx.sh .
@ -30,7 +14,9 @@ endif
docker build \
--tag nginx-ingress-controller:e2e .
.PHONY: clean
clean:
rm -rf _cache e2e.test kubectl cluster ginkgo
docker rmi -f nginx-ingress-controller:e2e || true
.PHONY: image clean

View file

@ -19,48 +19,37 @@ set -e
NC='\e[0m'
BGREEN='\e[32m'
SLOW_E2E_THRESHOLD=${SLOW_E2E_THRESHOLD:-50}
SLOW_E2E_THRESHOLD=${SLOW_E2E_THRESHOLD:-5}
FOCUS=${FOCUS:-.*}
E2E_NODES=${E2E_NODES:-5}
E2E_CHECK_LEAKS=${E2E_CHECK_LEAKS:-""}
if [ ! -f "${HOME}/.kube/config" ]; then
kubectl config set-cluster dev --certificate-authority=/var/run/secrets/kubernetes.io/serviceaccount/ca.crt --embed-certs=true --server="https://kubernetes.default/"
kubectl config set-credentials user --token="$(cat /var/run/secrets/kubernetes.io/serviceaccount/token)"
kubectl config set-context default --cluster=dev --user=user
kubectl config use-context default
fi
ginkgo_args=(
"-randomizeSuites"
"-randomizeAllSpecs"
"-flakeAttempts=2"
"-p"
"-trace"
"-progress"
"-slowSpecThreshold=${SLOW_E2E_THRESHOLD}"
"-r"
"-succinct"
"-timeout=45m" # Suite timeout should be lower than Prow job timeout to avoid abrupt termination
)
echo -e "${BGREEN}Running e2e test suite (FOCUS=${FOCUS})...${NC}"
ginkgo "${ginkgo_args[@]}" \
-focus="${FOCUS}" \
-skip="\[Serial\]|\[MemoryLeak\]" \
-nodes="${E2E_NODES}" \
-focus="${FOCUS}" \
-skip="\[Serial\]|\[MemoryLeak\]" \
-nodes="${E2E_NODES}" \
/e2e.test
echo -e "${BGREEN}Running e2e test suite with tests that require serial execution...${NC}"
ginkgo "${ginkgo_args[@]}" \
-focus="\[Serial\]" \
-skip="\[MemoryLeak\]" \
-nodes=1 \
ginkgo "${ginkgo_args[@]}" \
-focus="\[Serial\]" \
-skip="\[MemoryLeak\]" \
/e2e.test
if [[ ${E2E_CHECK_LEAKS} != "" ]]; then
echo -e "${BGREEN}Running e2e test suite with tests that check for memory leaks...${NC}"
ginkgo "${ginkgo_args[@]}" \
-focus="\[MemoryLeak\]" \
-skip="\[Serial\]" \
-nodes=1 \
ginkgo "${ginkgo_args[@]}" \
-focus="\[MemoryLeak\]" \
-skip="\[Serial\]" \
/e2e.test
fi