tests/e2e: add E2E_SKIP env var to skip specific e2e tests, as test_multi_master tends to fail in travis
This commit is contained in:
parent
fe21c27a32
commit
e98f96b4f4
@ -12,7 +12,7 @@ matrix:
|
|||||||
before_script:
|
before_script:
|
||||||
- make ci-setup
|
- make ci-setup
|
||||||
script:
|
script:
|
||||||
- make ci-tests build-cross
|
- make -e "E2E_SKIP=test_multi_master" ci-tests build-cross
|
||||||
deploy:
|
deploy:
|
||||||
provider: releases
|
provider: releases
|
||||||
skip_cleanup: true
|
skip_cleanup: true
|
||||||
|
3
Makefile
3
Makefile
@ -27,6 +27,7 @@ INTERACTIVE:=$(shell [ -t 0 ] && echo 1)
|
|||||||
|
|
||||||
# E2E test settings
|
# E2E test settings
|
||||||
E2E_LOG_LEVEL ?= WARN
|
E2E_LOG_LEVEL ?= WARN
|
||||||
|
E2E_SKIP ?=
|
||||||
|
|
||||||
# Go options
|
# Go options
|
||||||
GO ?= go
|
GO ?= go
|
||||||
@ -94,7 +95,7 @@ fmt:
|
|||||||
|
|
||||||
e2e: build-docker
|
e2e: build-docker
|
||||||
@echo "Running e2e tests in k3d:$(K3D_IMAGE_TAG)"
|
@echo "Running e2e tests in k3d:$(K3D_IMAGE_TAG)"
|
||||||
LOG_LEVEL=$(E2E_LOG_LEVEL) tests/dind.sh "${K3D_IMAGE_TAG}"
|
LOG_LEVEL="$(E2E_LOG_LEVEL)" E2E_SKIP="$(E2E_SKIP)" tests/dind.sh "${K3D_IMAGE_TAG}"
|
||||||
# check-fmt returns an error code if any source code contains format error.
|
# check-fmt returns an error code if any source code contains format error.
|
||||||
check-fmt:
|
check-fmt:
|
||||||
@test -z $(shell gofmt -s -l $(GO_SRC) | tee /dev/stderr) || echo "[WARN] Fix formatting issues with 'make fmt'"
|
@test -z $(shell gofmt -s -l $(GO_SRC) | tee /dev/stderr) || echo "[WARN] Fix formatting issues with 'make fmt'"
|
||||||
|
@ -16,6 +16,7 @@ k3de2e=$(docker run -d \
|
|||||||
-e EXE="$K3D_EXE" \
|
-e EXE="$K3D_EXE" \
|
||||||
-e CI="true" \
|
-e CI="true" \
|
||||||
-e LOG_LEVEL="$LOG_LEVEL" \
|
-e LOG_LEVEL="$LOG_LEVEL" \
|
||||||
|
-e E2E_SKIP="$E2E_SKIP" \
|
||||||
--name "k3d-e2e-runner-$TIMESTAMP" \
|
--name "k3d-e2e-runner-$TIMESTAMP" \
|
||||||
k3d:$K3D_IMAGE_TAG)
|
k3d:$K3D_IMAGE_TAG)
|
||||||
|
|
||||||
|
@ -3,6 +3,8 @@
|
|||||||
CURR_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
|
CURR_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
|
||||||
[ -d "$CURR_DIR" ] || { echo "FATAL: no current dir (maybe running in zsh?)"; exit 1; }
|
[ -d "$CURR_DIR" ] || { echo "FATAL: no current dir (maybe running in zsh?)"; exit 1; }
|
||||||
|
|
||||||
|
: "${E2E_SKIP:=""}"
|
||||||
|
|
||||||
# shellcheck source=./common.sh
|
# shellcheck source=./common.sh
|
||||||
source "$CURR_DIR/common.sh"
|
source "$CURR_DIR/common.sh"
|
||||||
|
|
||||||
@ -14,12 +16,14 @@ info "Preparing filesystem and environment..."
|
|||||||
|
|
||||||
mkdir -p /root/.kube
|
mkdir -p /root/.kube
|
||||||
|
|
||||||
info "Starting e2e tests..."
|
|
||||||
|
|
||||||
for i in $CURR_DIR/test_*.sh ; do
|
for i in $CURR_DIR/test_*.sh ; do
|
||||||
base=$(basename $i .sh)
|
base=$(basename $i .sh)
|
||||||
highlight "***** Running $base *****"
|
if [[ $E2E_SKIP =~ (^| )$base($| ) ]]; then
|
||||||
$i || abort "test $base failed"
|
highlight "***** Skipping $base *****"
|
||||||
|
else
|
||||||
|
highlight "***** Running $base *****"
|
||||||
|
$i || abort "test $base failed"
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
Loading…
Reference in New Issue
Block a user