[
https://issues.apache.org/jira/browse/FLINK-8985?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16480298#comment-16480298
]
ASF GitHub Bot commented on FLINK-8985:
---------------------------------------
Github user tzulitai commented on a diff in the pull request:
https://github.com/apache/flink/pull/5863#discussion_r189185232
--- Diff: flink-end-to-end-tests/test-scripts/test_cli_api.sh ---
@@ -0,0 +1,155 @@
+#!/usr/bin/env bash
+################################################################################
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+################################################################################
+
+source "$(dirname "$0")"/common.sh
+
+start_cluster
+$FLINK_DIR/bin/taskmanager.sh start
+$FLINK_DIR/bin/taskmanager.sh start
+$FLINK_DIR/bin/taskmanager.sh start
+
+# Test for CLI commands.
+# verify only the return code the content correctness of the API results.
+PERIODIC_JOB_JAR=$TEST_INFRA_DIR/../../flink-end-to-end-tests/flink-api-test/target/PeriodicStreamingJob.jar
+JOB_ID_REGEX_EXTRACTOR=".*JobID ([0-9,a-f]*)"
+SAVE_POINT_REGEX_EXTRACTOR=".*Savepoint stored in (.*)\\."
+
+EXIT_CODE=0
+
+function extract_job_id_from_job_submission_return() {
+ if [[ $1 =~ $JOB_ID_REGEX_EXTRACTOR ]];
+ then
+ JOB_ID="${BASH_REMATCH[1]}";
+ else
+ JOB_ID=""
+ fi
+ echo "$JOB_ID"
+}
+
+function extract_savepoint_path_from_savepoint_return() {
+ if [[ $1 =~ $SAVE_POINT_REGEX_EXTRACTOR ]];
+ then
+ SAVEPOINT_PATH="${BASH_REMATCH[1]}";
+ else
+ SAVEPOINT_PATH=""
+ fi
+ echo "$SAVEPOINT_PATH"
+}
+
+function cleanup_cli_test() {
+ stop_cluster
+ $FLINK_DIR/bin/taskmanager.sh stop-all
+
+ cleanup
+}
+
+printf
"\n==============================================================================\n"
+printf "Test default job launch with non-detach mode\n"
+printf
"==============================================================================\n"
+if [ $EXIT_CODE == 0 ]; then
+ eval "$FLINK_DIR/bin/flink run $FLINK_DIR/examples/batch/WordCount.jar"
+ EXIT_CODE=$?
+fi
+
+printf
"\n==============================================================================\n"
+printf "Test run with complex parameter set\n"
+printf
"==============================================================================\n"
+if [ $EXIT_CODE == 0 ]; then
+ eval "$FLINK_DIR/bin/flink run -m localhost:8081 -p 4 -q -d \
+ -c org.apache.flink.examples.java.wordcount.WordCount \
+ $FLINK_DIR/examples/batch/WordCount.jar \
+ --input file:///$FLINK_DIR/README.txt \
+ --output file:///${TEST_DATA_DIR}/out/result"
+ EXIT_CODE=$?
+fi
+
+printf
"\n==============================================================================\n"
+printf "Test information APIs\n"
+printf
"==============================================================================\n"
+if [ $EXIT_CODE == 0 ]; then
+ eval "$FLINK_DIR/bin/flink info
$FLINK_DIR/examples/batch/WordCount.jar"
--- End diff --
Should we verify the output of `info`?
> End-to-end test: CLI
> --------------------
>
> Key: FLINK-8985
> URL: https://issues.apache.org/jira/browse/FLINK-8985
> Project: Flink
> Issue Type: Sub-task
> Components: Client, Tests
> Affects Versions: 1.5.0
> Reporter: Till Rohrmann
> Assignee: Rong Rong
> Priority: Major
>
> We should an end-to-end test which verifies that all client commands are
> working correctly.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)