Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

K8SPS-322 - fix TEMP_DIR in E2E tests, change drop-finalizer step to have 99- prefix in all tests #481

Merged
merged 1 commit into from
Nov 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion e2e-tests/functions
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,13 @@

# set root repo relatively to a test dir
ROOT_REPO=${ROOT_REPO:-$(realpath ../../..)}
source "${ROOT_REPO}/e2e-tests/vars.sh"
test_name=$(basename "$(pwd)")
source "${ROOT_REPO}/e2e-tests/vars.sh"

init_temp_dir() {
rm -rf "$TEMP_DIR"
mkdir -p "$TEMP_DIR"
}

deploy_operator() {
kubectl -n "${NAMESPACE}" apply --server-side --force-conflicts -f "${DEPLOY_DIR}/crd.yaml"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ commands:
set -o xtrace

source ../../functions
init_temp_dir # do this only in the first TestStep

deploy_operator
deploy_client
1 change: 1 addition & 0 deletions e2e-tests/tests/auto-config/00-deploy-operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ commands:
set -o xtrace

source ../../functions
init_temp_dir # do this only in the first TestStep

deploy_operator
deploy_non_tls_cluster_secrets
Expand Down
1 change: 1 addition & 0 deletions e2e-tests/tests/config-router/00-deploy-operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ commands:
set -o xtrace

source ../../functions
init_temp_dir # do this only in the first TestStep

deploy_operator
deploy_non_tls_cluster_secrets
Expand Down
1 change: 1 addition & 0 deletions e2e-tests/tests/config/00-deploy-operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ commands:
set -o xtrace

source ../../functions
init_temp_dir # do this only in the first TestStep

deploy_operator
deploy_non_tls_cluster_secrets
Expand Down
1 change: 1 addition & 0 deletions e2e-tests/tests/demand-backup/01-deploy-operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ commands:
set -o xtrace

source ../../functions
init_temp_dir # do this only in the first TestStep

kubectl -n "${NAMESPACE}" apply -f "${TESTS_CONFIG_DIR}/cloud-secret.yml"
deploy_operator
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ commands:
set -o xtrace

source ../../functions
init_temp_dir # do this only in the first TestStep

deploy_operator
deploy_non_tls_cluster_secrets
Expand Down
1 change: 1 addition & 0 deletions e2e-tests/tests/gr-demand-backup/01-deploy-operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ commands:
set -o xtrace

source ../../functions
init_temp_dir # do this only in the first TestStep

kubectl -n "${NAMESPACE}" apply -f "${TESTS_CONFIG_DIR}/cloud-secret.yml"
deploy_operator
Expand Down
1 change: 1 addition & 0 deletions e2e-tests/tests/gr-haproxy/00-deploy-operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ commands:
set -o xtrace

source ../../functions
init_temp_dir # do this only in the first TestStep

deploy_operator
deploy_non_tls_cluster_secrets
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ commands:
set -o xtrace

source ../../functions
init_temp_dir # do this only in the first TestStep

deploy_operator
deploy_client
1 change: 1 addition & 0 deletions e2e-tests/tests/gr-init-deploy/00-deploy-operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ commands:
set -o xtrace

source ../../functions
init_temp_dir # do this only in the first TestStep

deploy_operator
deploy_non_tls_cluster_secrets
Expand Down
1 change: 1 addition & 0 deletions e2e-tests/tests/gr-one-pod/00-deploy-operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ commands:
set -o xtrace

source ../../functions
init_temp_dir # do this only in the first TestStep

apply_s3_storage_secrets
deploy_operator
Expand Down
1 change: 1 addition & 0 deletions e2e-tests/tests/gr-recreate/00-deploy-operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ commands:
set -o xtrace

source ../../functions
init_temp_dir # do this only in the first TestStep

deploy_operator
deploy_non_tls_cluster_secrets
Expand Down
1 change: 1 addition & 0 deletions e2e-tests/tests/gr-scaling/00-deploy-operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ commands:
set -o xtrace

source ../../functions
init_temp_dir # do this only in the first TestStep

deploy_operator
deploy_non_tls_cluster_secrets
Expand Down
1 change: 1 addition & 0 deletions e2e-tests/tests/gr-self-healing/00-deploy-operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ commands:
set -o xtrace

source ../../functions
init_temp_dir # do this only in the first TestStep

deploy_operator
deploy_non_tls_cluster_secrets
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ commands:
set -o xtrace

source ../../functions
init_temp_dir # do this only in the first TestStep

deploy_cert_manager

1 change: 1 addition & 0 deletions e2e-tests/tests/gr-users/00-deploy-operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ commands:
set -o xtrace

source ../../functions
init_temp_dir # do this only in the first TestStep

deploy_operator
deploy_non_tls_cluster_secrets
Expand Down
1 change: 1 addition & 0 deletions e2e-tests/tests/haproxy/00-deploy-operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ commands:
set -o xtrace

source ../../functions
init_temp_dir # do this only in the first TestStep

deploy_operator
deploy_non_tls_cluster_secrets
Expand Down
1 change: 1 addition & 0 deletions e2e-tests/tests/init-deploy/00-deploy-operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ commands:
set -o xtrace

source ../../functions
init_temp_dir # do this only in the first TestStep

deploy_operator
deploy_non_tls_cluster_secrets
Expand Down
1 change: 1 addition & 0 deletions e2e-tests/tests/limits/00-deploy-operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ commands:
set -o xtrace

source ../../functions
init_temp_dir # do this only in the first TestStep

deploy_operator
deploy_non_tls_cluster_secrets
Expand Down
1 change: 1 addition & 0 deletions e2e-tests/tests/monitoring/00-deploy-operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ commands:
set -o xtrace

source ../../functions
init_temp_dir # do this only in the first TestStep

deploy_operator
deploy_non_tls_cluster_secrets
Expand Down
1 change: 1 addition & 0 deletions e2e-tests/tests/one-pod/00-deploy-operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ commands:
set -o xtrace

source ../../functions
init_temp_dir # do this only in the first TestStep

apply_s3_storage_secrets
deploy_operator
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ commands:
set -o xtrace

source ../../functions
init_temp_dir # do this only in the first TestStep

deploy_operator
deploy_non_tls_cluster_secrets
Expand Down
1 change: 1 addition & 0 deletions e2e-tests/tests/recreate/00-deploy-operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ commands:
set -o xtrace

source ../../functions
init_temp_dir # do this only in the first TestStep

deploy_operator
deploy_non_tls_cluster_secrets
Expand Down
1 change: 1 addition & 0 deletions e2e-tests/tests/scaling/00-deploy-operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ commands:
set -o xtrace

source ../../functions
init_temp_dir # do this only in the first TestStep

deploy_operator
deploy_non_tls_cluster_secrets
Expand Down
1 change: 1 addition & 0 deletions e2e-tests/tests/service-per-pod/00-deploy-operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ commands:
set -o xtrace

source ../../functions
init_temp_dir # do this only in the first TestStep

deploy_operator
deploy_non_tls_cluster_secrets
Expand Down
3 changes: 2 additions & 1 deletion e2e-tests/tests/sidecars/00-deploy-operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ commands:
set -o xtrace

source ../../functions
init_temp_dir # do this only in the first TestStep

deploy_operator
deploy_non_tls_cluster_secrets
deploy_tls_cluster_secrets


1 change: 1 addition & 0 deletions e2e-tests/tests/smart-update/00-deploy-operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ commands:
set -o xtrace

source ../../functions
init_temp_dir # do this only in the first TestStep

deploy_operator
deploy_non_tls_cluster_secrets
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ commands:
set -o xtrace

source ../../functions
init_temp_dir # do this only in the first TestStep

deploy_cert_manager

1 change: 1 addition & 0 deletions e2e-tests/tests/users/00-deploy-operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ commands:
set -o xtrace

source ../../functions
init_temp_dir # do this only in the first TestStep

deploy_operator
deploy_non_tls_cluster_secrets
Expand Down
1 change: 1 addition & 0 deletions e2e-tests/tests/version-service/00-deploy-operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ commands:
set -o xtrace

source ../../functions
init_temp_dir # do this only in the first TestStep

deploy_operator
deploy_non_tls_cluster_secrets
Expand Down
2 changes: 1 addition & 1 deletion e2e-tests/vars.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
export DEPLOY_DIR="${DEPLOY_DIR:-${ROOT_REPO}/deploy}"
export TESTS_DIR="${TESTS_DIR:-${ROOT_REPO}/e2e-tests}"
export TESTS_CONFIG_DIR="${TESTS_CONFIG_DIR:-${TESTS_DIR}/conf}"
export TEMP_DIR=$(mktemp -d)
export TEMP_DIR="/tmp/kuttl/ps/${test_name}"

Check warning on line 8 in e2e-tests/vars.sh

View workflow job for this annotation

GitHub Actions / shellcheck

[shellcheck] e2e-tests/vars.sh#L8 <ShellCheck.SC2154>

test_name is referenced but not assigned.
Raw output
./e2e-tests/vars.sh:8:32: warning: test_name is referenced but not assigned. (ShellCheck.SC2154)

export GIT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
export VERSION=${VERSION:-$(echo "${GIT_BRANCH}" | sed -e 's^/^-^g; s^[.]^-^g;' | tr '[:upper:]' '[:lower:]')}
Expand All @@ -21,7 +21,7 @@
export IMAGE_PMM_CLIENT=${IMAGE_PMM_CLIENT:-"perconalab/pmm-client:dev-latest"}
export IMAGE_PMM_SERVER=${IMAGE_PMM_SERVER:-"perconalab/pmm-server:dev-latest"}

date=$(which gdate || which date)

Check warning on line 24 in e2e-tests/vars.sh

View workflow job for this annotation

GitHub Actions / shellcheck

[shellcheck] e2e-tests/vars.sh#L24 <ShellCheck.SC2034>

date appears unused. Verify use (or export if used externally).
Raw output
./e2e-tests/vars.sh:24:1: warning: date appears unused. Verify use (or export if used externally). (ShellCheck.SC2034)

if command -v oc &> /dev/null; then
if oc get projects; then
Expand Down
Loading