tests/e2e: add E2E_SKIP env var to skip specific e2e tests, as test_multi_master tends to fail in travis

pull/212/head v3.0.0-beta.1
iwilltry42 4 years ago
parent fe21c27a32
commit e98f96b4f4
No known key found for this signature in database
GPG Key ID: 7BA57AD1CFF16110
  1. 2
      .travis.yml
  2. 3
      Makefile
  3. 1
      tests/dind.sh
  4. 12
      tests/runner.sh

@ -12,7 +12,7 @@ matrix:
before_script:
- make ci-setup
script:
- make ci-tests build-cross
- make -e "E2E_SKIP=test_multi_master" ci-tests build-cross
deploy:
provider: releases
skip_cleanup: true

@ -27,6 +27,7 @@ INTERACTIVE:=$(shell [ -t 0 ] && echo 1)
# E2E test settings
E2E_LOG_LEVEL ?= WARN
E2E_SKIP ?=
# Go options
GO ?= go
@ -94,7 +95,7 @@ fmt:
e2e: build-docker
@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:
@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 CI="true" \
-e LOG_LEVEL="$LOG_LEVEL" \
-e E2E_SKIP="$E2E_SKIP" \
--name "k3d-e2e-runner-$TIMESTAMP" \
k3d:$K3D_IMAGE_TAG)

@ -3,6 +3,8 @@
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; }
: "${E2E_SKIP:=""}"
# shellcheck source=./common.sh
source "$CURR_DIR/common.sh"
@ -14,12 +16,14 @@ info "Preparing filesystem and environment..."
mkdir -p /root/.kube
info "Starting e2e tests..."
for i in $CURR_DIR/test_*.sh ; do
base=$(basename $i .sh)
highlight "***** Running $base *****"
$i || abort "test $base failed"
if [[ $E2E_SKIP =~ (^| )$base($| ) ]]; then
highlight "***** Skipping $base *****"
else
highlight "***** Running $base *****"
$i || abort "test $base failed"
fi
done
exit 0

Loading…
Cancel
Save