E2E: enable skipping multiple tests and improve log messages

pull/364/head v3.0.2
iwilltry42 4 years ago
parent f6028305c9
commit 66a63f654f
No known key found for this signature in database
GPG Key ID: 7BA57AD1CFF16110
  1. 15
      tests/extra_test_k3s_versions.sh
  2. 6
      tests/runner.sh
  3. 10
      tests/test_multi_master.sh

@ -3,7 +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; }
K3S_VERSIONS=("v1.17.12-k3s1" "v1.18.9-k3s1" "v1.19.1-k3s1")
K3S_VERSIONS=("v1.17.12-k3s1" "v1.18.9-k3s1" "v1.19.2-rc2-k3s1" "v1.19.1-k3s1")
FAILED_VERSIONS=()
# shellcheck source=./common.sh
source "$CURR_DIR/common.sh"
@ -20,9 +21,15 @@ for version in "${K3S_VERSIONS[@]}"; do
$EXE cluster delete c1 || failed "could not delete the cluster c1"
K3S_IMAGE_TAG="$version" $CURR_DIR/test_multi_master.sh
if [[ $? -eq 1 ]]; then
FAILED_VERSIONS+=("$version")
fi
done
exit 0
if [[ ${#FAILED_VERSIONS[@]} -gt 0 ]]; then
failed "Tests failed for k3s versions: ${FAILED_VERSIONS[*]}"
else
passed "Successfully verified all given k3s versions"
exit 0
fi

@ -21,7 +21,11 @@ section "BASIC TESTS"
for i in $CURR_DIR/test_*.sh ; do
base=$(basename "$i" .sh)
if [[ $E2E_SKIP =~ (^| )$base($| ) ]]; then
skip=false
for skiptest in "${E2E_SKIP[@]}"; do
[[ "$skiptest" =~ (^| )${base}($| ) ]] && skip=true
done
if [ "$skip" = true ]; then
highlight "***** Skipping $base *****"
else
highlight "***** Running $base *****"

@ -15,18 +15,20 @@ if [[ -n "$K3S_IMAGE_TAG" ]]; then
fi
info "Creating cluster multiserver $EXTRA_TITLE ..."
$EXE cluster create "multiserver" --servers 3 --api-port 6443 --wait --timeout 360s $EXTRA_FLAG || failed "could not create cluster multiserver"
$EXE cluster create "multiserver" --servers 3 --api-port 6443 --wait --timeout 360s $EXTRA_FLAG || failed "could not create cluster multiserver $EXTRA_TITLE"
info "Checking that we have access to the cluster..."
check_clusters "multiserver" || failed "error checking cluster"
check_clusters "multiserver" || failed "error checking cluster $EXTRA_TITLE"
info "Sleeping for 5 seconds to give the cluster enough time to get ready..."
sleep 5
info "Checking that we have 3 server nodes online..."
check_multi_node "multiserver" 3 || failed "failed to verify number of nodes"
check_multi_node "multiserver" 3 || failed "failed to verify number of nodes $EXTRA_TITLE"
info "Deleting cluster multiserver..."
$EXE cluster delete "multiserver" || failed "could not delete the cluster multiserver"
$EXE cluster delete "multiserver" || failed "could not delete the cluster multiserver $EXTRA_TITLE"
passed "GOOD: multiserver cluster test successful $EXTRA_TITLE"
exit 0

Loading…
Cancel
Save