This is an automated email from the ASF dual-hosted git repository.

pnowojski pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/flink.git

commit 007536169be09b0ae7cd0d2921f507958fff78cb
Author: Aleksey Pak <[email protected]>
AuthorDate: Thu Jun 6 12:09:42 2019 +0200

    [FLINK-12143][e2e] Introduce plugins helper function and test cleanup
---
 flink-end-to-end-tests/test-scripts/common.sh | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/flink-end-to-end-tests/test-scripts/common.sh 
b/flink-end-to-end-tests/test-scripts/common.sh
index 1a277e7..361e49a 100644
--- a/flink-end-to-end-tests/test-scripts/common.sh
+++ b/flink-end-to-end-tests/test-scripts/common.sh
@@ -99,6 +99,9 @@ function revert_flink_dir() {
 
     rm -r "${TEST_DATA_DIR}/tmp/backup"
 
+    # By default, the plugins dir doesn't exist. Some tests may have created 
it.
+    rm -r "${FLINK_DIR}/plugins"
+
     REST_PROTOCOL="http"
     CURL_SSL_ARGS=""
 }
@@ -108,6 +111,18 @@ function add_optional_lib() {
     cp "$FLINK_DIR/opt/flink-${lib_name}"*".jar" "$FLINK_DIR/lib"
 }
 
+function add_optional_plugin() {
+    # This is similar to add_optional_lib, but the jar would be copied to
+    # Flink's plugins dir (the nested folder name does not matter).
+    # Note: this may not work with some jars, as not all of them implement 
plugin api.
+    # Please check the corresponding code of the jar.
+    local plugin="$1"
+    local plugin_dir="$FLINK_DIR/plugins/$plugin"
+
+    mkdir -p "$plugin_dir"
+    cp "$FLINK_DIR/opt/flink-$plugin"*".jar" "$plugin_dir"
+}
+
 function delete_config_key() {
     local config_key=$1
     sed -i -e "/^${config_key}: /d" ${FLINK_DIR}/conf/flink-conf.yaml

Reply via email to