You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by gy...@apache.org on 2022/10/09 15:17:47 UTC
[flink-kubernetes-operator] branch main updated: [FLINK-29507] Make e2e tests independent of the current directory
This is an automated email from the ASF dual-hosted git repository.
gyfora pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/flink-kubernetes-operator.git
The following commit(s) were added to refs/heads/main by this push:
new 39a275f4 [FLINK-29507] Make e2e tests independent of the current directory
39a275f4 is described below
commit 39a275f4f4c306061d37991644f81e4625737e93
Author: Gabor Somogyi <ga...@apple.com>
AuthorDate: Wed Oct 5 10:17:10 2022 +0200
[FLINK-29507] Make e2e tests independent of the current directory
---
e2e-tests/test_application_kubernetes_ha.sh | 7 ++++---
e2e-tests/test_application_operations.sh | 7 ++++---
e2e-tests/test_multi_sessionjob.sh | 7 ++++---
e2e-tests/test_sessionjob_kubernetes_ha.sh | 7 ++++---
e2e-tests/test_sessionjob_operations.sh | 7 ++++---
5 files changed, 20 insertions(+), 15 deletions(-)
diff --git a/e2e-tests/test_application_kubernetes_ha.sh b/e2e-tests/test_application_kubernetes_ha.sh
index db32e00e..1797b29a 100755
--- a/e2e-tests/test_application_kubernetes_ha.sh
+++ b/e2e-tests/test_application_kubernetes_ha.sh
@@ -17,13 +17,14 @@
# limitations under the License.
################################################################################
-source "$(dirname "$0")"/utils.sh
+SCRIPT_DIR=$(dirname "$(readlink -f "$0")")
+source "${SCRIPT_DIR}/utils.sh"
CLUSTER_ID="flink-example-statemachine"
-APPLICATION_YAML="e2e-tests/data/flinkdep-cr.yaml"
+APPLICATION_YAML="${SCRIPT_DIR}/data/flinkdep-cr.yaml"
TIMEOUT=300
-on_exit cleanup_and_exit $APPLICATION_YAML $TIMEOUT $CLUSTER_ID
+on_exit cleanup_and_exit "$APPLICATION_YAML" $TIMEOUT $CLUSTER_ID
retry_times 5 30 "kubectl apply -f $APPLICATION_YAML" || exit 1
diff --git a/e2e-tests/test_application_operations.sh b/e2e-tests/test_application_operations.sh
index f8f6284e..c9d3565e 100755
--- a/e2e-tests/test_application_operations.sh
+++ b/e2e-tests/test_application_operations.sh
@@ -20,14 +20,15 @@
# This script tests the application job operations:
# 1. Trigger savepoint
# 2. last state mode upgrade
-source "$(dirname "$0")"/utils.sh
+SCRIPT_DIR=$(dirname "$(readlink -f "$0")")
+source "${SCRIPT_DIR}/utils.sh"
CLUSTER_ID="flink-example-statemachine"
-APPLICATION_YAML="e2e-tests/data/flinkdep-cr.yaml"
+APPLICATION_YAML="${SCRIPT_DIR}/data/flinkdep-cr.yaml"
APPLICATION_IDENTIFIER="flinkdep/$CLUSTER_ID"
TIMEOUT=300
-on_exit cleanup_and_exit $APPLICATION_YAML $TIMEOUT $CLUSTER_ID
+on_exit cleanup_and_exit "$APPLICATION_YAML" $TIMEOUT $CLUSTER_ID
retry_times 5 30 "kubectl apply -f $APPLICATION_YAML" || exit 1
diff --git a/e2e-tests/test_multi_sessionjob.sh b/e2e-tests/test_multi_sessionjob.sh
index 1484e684..59990870 100755
--- a/e2e-tests/test_multi_sessionjob.sh
+++ b/e2e-tests/test_multi_sessionjob.sh
@@ -16,15 +16,16 @@
# limitations under the License.
#
-source "$(dirname "$0")"/utils.sh
+SCRIPT_DIR=$(dirname "$(readlink -f "$0")")
+source "${SCRIPT_DIR}/utils.sh"
CLUSTER_ID="session-cluster-1"
-APPLICATION_YAML="e2e-tests/data/multi-sessionjob.yaml"
+APPLICATION_YAML="${SCRIPT_DIR}/data/multi-sessionjob.yaml"
TIMEOUT=300
SESSION_CLUSTER_IDENTIFIER="flinkdep/session-cluster-1"
SESSION_JOB_IDENTIFIER="sessionjob/flink-example-statemachine"
-on_exit cleanup_and_exit $APPLICATION_YAML $TIMEOUT $CLUSTER_ID
+on_exit cleanup_and_exit "$APPLICATION_YAML" $TIMEOUT $CLUSTER_ID
create_namespace flink
retry_times 5 30 "kubectl apply -f $APPLICATION_YAML" || exit 1
diff --git a/e2e-tests/test_sessionjob_kubernetes_ha.sh b/e2e-tests/test_sessionjob_kubernetes_ha.sh
index f0fbe588..0ad55b12 100755
--- a/e2e-tests/test_sessionjob_kubernetes_ha.sh
+++ b/e2e-tests/test_sessionjob_kubernetes_ha.sh
@@ -16,15 +16,16 @@
# limitations under the License.
#
-source "$(dirname "$0")"/utils.sh
+SCRIPT_DIR=$(dirname "$(readlink -f "$0")")
+source "${SCRIPT_DIR}/utils.sh"
CLUSTER_ID="session-cluster-1"
-APPLICATION_YAML="e2e-tests/data/sessionjob-cr.yaml"
+APPLICATION_YAML="${SCRIPT_DIR}/data/sessionjob-cr.yaml"
TIMEOUT=300
SESSION_CLUSTER_IDENTIFIER="flinkdep/session-cluster-1"
SESSION_JOB_IDENTIFIER="sessionjob/flink-example-statemachine"
-on_exit cleanup_and_exit $APPLICATION_YAML $TIMEOUT $CLUSTER_ID
+on_exit cleanup_and_exit "$APPLICATION_YAML" $TIMEOUT $CLUSTER_ID
retry_times 5 30 "kubectl apply -f $APPLICATION_YAML" || exit 1
diff --git a/e2e-tests/test_sessionjob_operations.sh b/e2e-tests/test_sessionjob_operations.sh
index a4bbad77..638f3522 100755
--- a/e2e-tests/test_sessionjob_operations.sh
+++ b/e2e-tests/test_sessionjob_operations.sh
@@ -20,17 +20,18 @@
# This script tests the session job operations:
# 1. Trigger savepoint
# 2. savepoint mode upgrade
-source "$(dirname "$0")"/utils.sh
+SCRIPT_DIR=$(dirname "$(readlink -f "$0")")
+source "${SCRIPT_DIR}/utils.sh"
CLUSTER_ID="session-cluster-1"
-APPLICATION_YAML="e2e-tests/data/sessionjob-cr.yaml"
+APPLICATION_YAML="${SCRIPT_DIR}/data/sessionjob-cr.yaml"
TIMEOUT=300
SESSION_CLUSTER_IDENTIFIER="flinkdep/$CLUSTER_ID"
SESSION_JOB_NAME="flink-example-statemachine"
SESSION_JOB_IDENTIFIER="sessionjob/$SESSION_JOB_NAME"
OPERATOR_POD_LABEL="app.kubernetes.io/name=flink-kubernetes-operator"
-on_exit cleanup_and_exit $APPLICATION_YAML $TIMEOUT $CLUSTER_ID
+on_exit cleanup_and_exit "$APPLICATION_YAML" $TIMEOUT $CLUSTER_ID
retry_times 5 30 "kubectl apply -f $APPLICATION_YAML" || exit 1