Skip to content

Commit

Permalink
[FLINK-25128][e2e] Update tests to replace the planner jars whenever …
Browse files Browse the repository at this point in the history
…necessary to check both planners

This closes #18134.
  • Loading branch information
slinkydeveloper authored and twalthr committed Dec 30, 2021
1 parent 749bb77 commit fdc53e7
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
3 changes: 2 additions & 1 deletion flink-end-to-end-tests/run-nightly-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,8 @@ function run_group_2 {

run_test "DataSet allround end-to-end test" "$END_TO_END_DIR/test-scripts/test_batch_allround.sh"
run_test "Batch SQL end-to-end test" "$END_TO_END_DIR/test-scripts/test_batch_sql.sh"
run_test "Streaming SQL end-to-end test" "$END_TO_END_DIR/test-scripts/test_streaming_sql.sh" "skip_check_exceptions"
run_test "Streaming SQL end-to-end test using planner loader" "$END_TO_END_DIR/test-scripts/test_streaming_sql.sh" "skip_check_exceptions"
run_test "Streaming SQL end-to-end test using planner with Scala version" "$END_TO_END_DIR/test-scripts/test_streaming_sql.sh scala-planner" "skip_check_exceptions"

if [[ ${PROFILE} != *"enable-adaptive-scheduler"* ]]; then # FLINK-21400
run_test "Streaming File Sink end-to-end test" "$END_TO_END_DIR/test-scripts/test_file_sink.sh local StreamingFileSink" "skip_check_exceptions"
Expand Down
10 changes: 10 additions & 0 deletions flink-end-to-end-tests/test-scripts/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,16 @@ function add_optional_plugin() {
cp "$FLINK_DIR/opt/flink-$plugin"*".jar" "$plugin_dir"
}

function swap_planner_loader_with_planner_scala() {
mv "$FLINK_DIR/lib/flink-table-planner-loader"*".jar" "$FLINK_DIR/opt"
mv "$FLINK_DIR/opt/flink-table-planner_"*".jar" "$FLINK_DIR/lib"
}

function swap_planner_scala_with_planner_loader() {
mv "$FLINK_DIR/opt/flink-table-planner-loader"*".jar" "$FLINK_DIR/lib"
mv "$FLINK_DIR/lib/flink-table-planner_"*".jar" "$FLINK_DIR/opt"
}

function delete_config_key() {
local config_key=$1
sed -i -e "/^${config_key}: /d" ${FLINK_DIR}/conf/flink-conf.yaml
Expand Down
6 changes: 6 additions & 0 deletions flink-end-to-end-tests/test-scripts/test_streaming_sql.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@

source "$(dirname "$0")"/common.sh

PLANNER=$1
if [ "$PLANNER" = "scala-planner" ]; then
swap_planner_loader_with_planner_scala
on_exit swap_planner_scala_with_planner_loader
fi

TEST_PROGRAM_JAR=${END_TO_END_DIR}/flink-stream-sql-test/target/StreamSQLTestProgram.jar

start_cluster
Expand Down

0 comments on commit fdc53e7

Please sign in to comment.