[jira] [Commented] (FLINK-8985) End-to-end test: CLI
[ https://issues.apache.org/jira/browse/FLINK-8985?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16676976#comment-16676976 ] ASF GitHub Bot commented on FLINK-8985: --- asfgit closed pull request #5863: [FLINK-8985][e2etest] initial support for End-to-end CLI test, excluding YARN test URL: https://github.com/apache/flink/pull/5863 This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/flink-end-to-end-tests/flink-api-test/pom.xml b/flink-end-to-end-tests/flink-api-test/pom.xml new file mode 100644 index 000..24a85e02bef --- /dev/null +++ b/flink-end-to-end-tests/flink-api-test/pom.xml @@ -0,0 +1,105 @@ + + +http://maven.apache.org/POM/4.0.0; +xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance; +xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd;> + + + flink-end-to-end-tests + org.apache.flink + 1.6-SNAPSHOT + .. + + + 4.0.0 + + flink-api-test + flink-api-test + jar + + + + org.apache.flink + flink-core + ${project.version} + + + org.apache.flink + flink-streaming-java_${scala.binary.version} + ${project.version} + + + org.apache.flink + flink-connector-filesystem_${scala.binary.version} + ${project.version} + + + org.apache.flink + flink-runtime-web_${scala.binary.version} + ${project.version} + test-jar + + + + + + + org.apache.maven.plugins + maven-shade-plugin + 3.0.0 + + + package + + shade + + + PeriodicStreamingJob + + + com.google.code.findbugs:jsr305 + org.slf4j:* + log4j:* + + + + + *:* + + META-INF/*.SF + META-INF/*.DSA + META-INF/*.RSA + + + + + + org.apache.flink.runtime.tests.PeriodicStreamingJob + + + + + + + + + + + diff --git a/flink-end-to-end-tests/flink-api-test/src/main/java/org/apache/flink/runtime/tests/PeriodicStreamingJob.java b/flink-end-to-end-tests/flink-api-test/src/main/java/org/apache/flink/runtime/tests/PeriodicStreamingJob.java new file mode 100644 index 000..ee8a49b8583 --- /dev/null +++ b/flink-end-to-end-tests/flink-api-test/src/main/java/org/apache/flink/runtime/tests/PeriodicStreamingJob.java
[jira] [Commented] (FLINK-8985) End-to-end test: CLI
[ https://issues.apache.org/jira/browse/FLINK-8985?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16676906#comment-16676906 ] ASF GitHub Bot commented on FLINK-8985: --- twalthr commented on issue #5863: [FLINK-8985][e2etest] initial support for End-to-end CLI test, excluding YARN test URL: https://github.com/apache/flink/pull/5863#issuecomment-436296096 Thanks for the PR @walterddr. I think the test looks good to merge. I will add some additional safety checks and rebase this code to the current master. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > 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 > Labels: pull-request-available > > We should add end-to-end test which verifies that all client commands are > working correctly. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (FLINK-8985) End-to-end test: CLI
[ https://issues.apache.org/jira/browse/FLINK-8985?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16547269#comment-16547269 ] Rong Rong commented on FLINK-8985: -- Yeah I agree, I would put more thought on this in a follow-up JIRA if that's ok with you? In the meantime could you kindly take a look at the PR? I created some very basic tests for verification on a periodic running streaming job; there are some test cases I deliberately removed because it was tested specifically in other E2E suites (thanks to [~tzulitai]'s comment) > 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)
[jira] [Commented] (FLINK-8985) End-to-end test: CLI
[ https://issues.apache.org/jira/browse/FLINK-8985?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16539646#comment-16539646 ] Chesnay Schepler commented on FLINK-8985: - Let's not over-complicate this thing from the get-go. If we've covered the basic commands, and have a system that we can extend in the future that's a really good start. I doubt we can do this as nicely as we do for the REST API, since that is mostly GET requests with very limited parameter options. In contrast, the client relies on a number of semantically important flags that I'm not so sure we can automate. For this case a more reasonable approach is to parse the {{--help}} output, derive a list of commands to test, and only check whether all these are covered. However I would really delay this for now, > 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)
[jira] [Commented] (FLINK-8985) End-to-end test: CLI
[ https://issues.apache.org/jira/browse/FLINK-8985?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16539256#comment-16539256 ] Rong Rong commented on FLINK-8985: -- Thanks [~florianschmidt] for the exhausted listing for all CLI. Currently I only implemented for some of the key code paths and components. I found out that there are situations where we need some specific combination of the option flags in order to trigger different code path, which makes it even more messy. I was actually thinking of something similar to FLINK-8986, and having some sort of auto-generated collection of CLI option flags for e2e testing. [~till.rohrmann] [~Zentol] what do you guys think? > 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)
[jira] [Commented] (FLINK-8985) End-to-end test: CLI
[ https://issues.apache.org/jira/browse/FLINK-8985?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16538863#comment-16538863 ] Florian Schmidt commented on FLINK-8985: Hey, I was playing around with the CLI a little bit as well and I made the following checklist for all commands that the CLI currently supports (according to --help). Do you think we could use this? Maybe we should even split this up into multiple subtasks, I guess some of them might be significantly easier to verify than others? {noformat} # bin/flink run ## "run" action options - [ ] -c - [ ] --class - [ ] -C - [ ] --classpath - [ ] -d - [ ] --detached - [ ] -n - [ ] --allowNonRestoredState - [ ] -p - [ ] --parallelism - [ ] -q - [ ] --sysoutLogging - [ ] -s - [ ] --fromSavepoint ## options for yarn cluster mode - [ ] -d - [ ] --detached - [ ] -m - [ ] --jobmanager - [ ] -yD - [ ] -yd - [ ] --yarndetached - [ ] -yh - [ ] --yarnhelp - [ ] -yid - [ ] --yarnapplicationId - [ ] -yj - [ ] --yarnjar - [ ] -yjm - [ ] --yarnjobManagerMemory - [ ] -yn - [ ] --yarncontainer - [ ] -ynl - [ ] --yarnnodeLabel - [ ] -ynm - [ ] --yarnname - [ ] -yq - [ ] --yarnquery - [ ] -yqu - [ ] --yarnqueue - [ ] -ys - [ ] --yarnslots - [ ] -yst - [ ] --yarnstreaming - [ ] -yt - [ ] --yarnship - [ ] -ytm - [ ] --yarntaskManagerMemory - [ ] -yz - [ ] --yarnzookeeperNamespace - [ ] -z - [ ] --zookeeperNamespace ## options for default mode - [ ] -m - [ ] --jobmanager - [ ] -z - [ ] --zookeeperNamespace # bin/flink info - [ ] -c - [ ] --class - [ ] -p - [ ] --parallelism # bin/flink list - [ ] -r - [ ] --running - [ ] -s - [ ] --scheduled ## options for yarn cluster mode - [ ] -m - [ ] --jobmanager - [ ] -yid - [ ] --yarnapplicationId - [ ] -z - [ ] --zookeeperNamespace ## options for default mode - [ ] -m - [ ] --jobmanager - [ ] -z - [ ] --zookeeperNamespace # bin/flink stop ## options for yarn cluster mode - [ ] -m - [ ] --jobmanager - [ ] -yid - [ ] --yarnapplicationId - [ ] -z - [ ] --zookeeperNamespace ## options for default mode - [ ] -m - [ ] --jobmanager - [ ] -z - [ ] --zookeeperNamespace # bin/flink cancel - [ ] -s - [ ] --withSavepoint ## options for yarn cluster mode - [ ] -m - [ ] --jobmanager - [ ] -yid - [ ] --yarnapplicationId - [ ] -z - [ ] --zookeeperNamespace ## options for default mode - [ ] -m - [ ] --jobmanager - [ ] -z - [ ] --zookeeperNamespace # bin/flink savepoint - [ ] -d - [ ] --dispose - [ ] -j - [ ] --jarfile ## options for yarn cluster mode - [ ] -m - [ ] --jobmanager - [ ] -yid - [ ] --yarnapplicationId - [ ] -z - [ ] --zookeeperNamespace - [ ] sub-paths ## options for default mode - [ ] -m - [ ] --jobmanager - [ ] -z - [ ] --zookeeperNamespace # bin/flink help - [ ] -h - [ ] --help - [ ] -p - [ ] --parallelism - [ ] -v - [ ] --verbose ## options for yarn cluster mode - [ ] -m - [ ] --jobmanager - [ ] -yid - [ ] --yarnapplicationId - [ ] -z - [ ] --zookeeperNamespace - [ ] sub-paths ## options for default mode - [ ] -m - [ ] --jobmanager - [ ] -z - [ ] --zookeeperNamespace {noformat} > 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)
[jira] [Commented] (FLINK-8985) End-to-end test: CLI
[ https://issues.apache.org/jira/browse/FLINK-8985?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16490212#comment-16490212 ] ASF GitHub Bot commented on FLINK-8985: --- Github user walterddr commented on a diff in the pull request: https://github.com/apache/flink/pull/5863#discussion_r190788353 --- Diff: flink-end-to-end-tests/test-scripts/test_cli_api.sh --- @@ -0,0 +1,196 @@ +#!/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 + +# 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 (.*)\\." +JOB_INFO_PACT_DATA_SOURCE_REGEX_EXTRACTOR="\"pact\": \"(Data Source)\"" +JOB_INFO_PACT_DATA_SINK_REGEX_EXTRACTOR="\"pact\": \"(Data Sink)\"" +JOB_LIST_REGEX_EXTRACTOR_BY_STATUS="([0-9,a-f]*) :" + +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 extract_valid_pact_from_job_info_return() { +PACT_MATCH=0 +if [[ $1 =~ $JOB_INFO_PACT_DATA_SOURCE_REGEX_EXTRACTOR ]]; +then +PACT_MATCH=$PACT_MATCH +else +PACT_MATCH=-1 +fi +if [[ $1 =~ $JOB_INFO_PACT_DATA_SINK_REGEX_EXTRACTOR ]]; +then +PACT_MATCH=$PACT_MATCH +else +PACT_MATCH=-1 +fi +echo ${PACT_MATCH} +} + +function extract_valid_job_list_by_type_from_job_list_return() { +JOB_LIST_MATCH=0 +JOB_LIST_REGEX_EXTRACTOR="$JOB_LIST_REGEX_EXTRACTOR_BY_STATUS $2 $3" +if [[ $1 =~ $JOB_LIST_REGEX_EXTRACTOR ]]; +then +JOB_LIST_MATCH=$JOB_LIST_MATCH +else +JOB_LIST_MATCH=-1 +fi +echo ${JOB_LIST_MATCH} +} + +function cleanup_cli_test() { + stop_cluster + $FLINK_DIR/bin/taskmanager.sh stop-all --- End diff -- checking the clean up code seems like it doesn't explicitly call stopping all tm (similar to `start-cluster.sh`, I need to explicitly call `taskmanager start`). I should remove only the `stop-cluster` actually. > 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)
[jira] [Commented] (FLINK-8985) End-to-end test: CLI
[ https://issues.apache.org/jira/browse/FLINK-8985?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16488225#comment-16488225 ] ASF GitHub Bot commented on FLINK-8985: --- Github user walterddr commented on a diff in the pull request: https://github.com/apache/flink/pull/5863#discussion_r190433925 --- 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 \ --- End diff -- good point. I will add the check > 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)
[jira] [Commented] (FLINK-8985) End-to-end test: CLI
[ https://issues.apache.org/jira/browse/FLINK-8985?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16486848#comment-16486848 ] 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_r190146869 --- Diff: flink-end-to-end-tests/test-scripts/test_cli_api.sh --- @@ -0,0 +1,196 @@ +#!/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 + +# 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 (.*)\\." +JOB_INFO_PACT_DATA_SOURCE_REGEX_EXTRACTOR="\"pact\": \"(Data Source)\"" +JOB_INFO_PACT_DATA_SINK_REGEX_EXTRACTOR="\"pact\": \"(Data Sink)\"" +JOB_LIST_REGEX_EXTRACTOR_BY_STATUS="([0-9,a-f]*) :" + +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 extract_valid_pact_from_job_info_return() { +PACT_MATCH=0 +if [[ $1 =~ $JOB_INFO_PACT_DATA_SOURCE_REGEX_EXTRACTOR ]]; +then +PACT_MATCH=$PACT_MATCH +else +PACT_MATCH=-1 +fi +if [[ $1 =~ $JOB_INFO_PACT_DATA_SINK_REGEX_EXTRACTOR ]]; +then +PACT_MATCH=$PACT_MATCH +else +PACT_MATCH=-1 +fi +echo ${PACT_MATCH} +} + +function extract_valid_job_list_by_type_from_job_list_return() { +JOB_LIST_MATCH=0 +JOB_LIST_REGEX_EXTRACTOR="$JOB_LIST_REGEX_EXTRACTOR_BY_STATUS $2 $3" +if [[ $1 =~ $JOB_LIST_REGEX_EXTRACTOR ]]; +then +JOB_LIST_MATCH=$JOB_LIST_MATCH +else +JOB_LIST_MATCH=-1 +fi +echo ${JOB_LIST_MATCH} +} + +function cleanup_cli_test() { + stop_cluster + $FLINK_DIR/bin/taskmanager.sh stop-all --- End diff -- I don't think we need to explicitly shutdown the cluster and TMs here; that is already part of the `cleanup` call > 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)
[jira] [Commented] (FLINK-8985) End-to-end test: CLI
[ https://issues.apache.org/jira/browse/FLINK-8985?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16486843#comment-16486843 ] 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_r190145819 --- 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 \ --- End diff -- Well, we can have a completely normal exit code from the `run` execution, but the `-p` option completely ignored if we change the CLI to simply not recognize the option. This is an extreme case, though. > 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)
[jira] [Commented] (FLINK-8985) End-to-end test: CLI
[ https://issues.apache.org/jira/browse/FLINK-8985?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16482863#comment-16482863 ] ASF GitHub Bot commented on FLINK-8985: --- Github user walterddr commented on a diff in the pull request: https://github.com/apache/flink/pull/5863#discussion_r189673647 --- 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 \ --- End diff -- Changed to use `-p 1`. I think the part that "parallelism should be taken by the CLI command" is verified by the exit code from the `run` execution. is that correct? > 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)
[jira] [Commented] (FLINK-8985) End-to-end test: CLI
[ https://issues.apache.org/jira/browse/FLINK-8985?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16480664#comment-16480664 ] ASF GitHub Bot commented on FLINK-8985: --- Github user walterddr commented on the issue: https://github.com/apache/flink/pull/5863 Thanks @tzulitai for the review. I will update asap. I am not 100% sure whether I should verify the CLI return but I would definitely add them. > 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)
[jira] [Commented] (FLINK-8985) End-to-end test: CLI
[ https://issues.apache.org/jira/browse/FLINK-8985?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16480299#comment-16480299 ] 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_r189185689 --- 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" +EXIT_CODE=$? +fi +if [ $EXIT_CODE == 0 ]; then +eval "$FLINK_DIR/bin/flink list" +EXIT_CODE=$? +fi +if [ $EXIT_CODE == 0 ]; then +eval "$FLINK_DIR/bin/flink list -s" +EXIT_CODE=$? +fi +if [ $EXIT_CODE == 0 ]; then +eval "$FLINK_DIR/bin/flink list -r" +EXIT_CODE=$? +fi + +printf "\n==\n" +printf "Test operation on running streaming jobs\n" +printf "==\n" +if [ $EXIT_CODE == 0 ]; then +RETURN=`$FLINK_DIR/bin/flink run -d \ +$PERIODIC_JOB_JAR --outputPath file:///${TEST_DATA_DIR}/out/result` +echo "job submission returns: $RETURN" +
[jira] [Commented] (FLINK-8985) End-to-end test: CLI
[ https://issues.apache.org/jira/browse/FLINK-8985?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16480297#comment-16480297 ] 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_r189185253 --- 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" +EXIT_CODE=$? +fi +if [ $EXIT_CODE == 0 ]; then +eval "$FLINK_DIR/bin/flink list" --- End diff -- Should we verify the output of `list`? > 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)
[jira] [Commented] (FLINK-8985) End-to-end test: CLI
[ https://issues.apache.org/jira/browse/FLINK-8985?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16480300#comment-16480300 ] 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_r189185140 --- 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 \ --- End diff -- Since this is a detached execution, we probably want to wait until this job completes before continuing? > 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)
[jira] [Commented] (FLINK-8985) End-to-end test: CLI
[ https://issues.apache.org/jira/browse/FLINK-8985?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16480301#comment-16480301 ] 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_r189185047 --- 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 \ --- End diff -- There probably should be some verification that the job actually runs with DOP=4 > 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)
[jira] [Commented] (FLINK-8985) End-to-end test: CLI
[ https://issues.apache.org/jira/browse/FLINK-8985?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=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)
[jira] [Commented] (FLINK-8985) End-to-end test: CLI
[ https://issues.apache.org/jira/browse/FLINK-8985?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16441481#comment-16441481 ] ASF GitHub Bot commented on FLINK-8985: --- GitHub user walterddr opened a pull request: https://github.com/apache/flink/pull/5863 [FLINK-8985][e2etest] initial support for End-to-end CLI test, excluding YARN test ## What is the purpose of the change Adding end to end test for CLI APIs. ## Brief change log Added test_cli_api.sh script to test combinations of CLI commands listed in the doc section of Flink. Including: - Start up command sets (run) - Operational command sets (list/info/cancel) - Savepoint command sets (savepoint) ## Verifying this change This is a test ## Does this pull request potentially affect one of the following parts: No ## Documentation No You can merge this pull request into a Git repository by running: $ git pull https://github.com/walterddr/flink FLINK-8985 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/flink/pull/5863.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #5863 commit 5f36ee5d4dcbb60a29a413fd29cfaaa69f7e8a47 Author: Rong RongDate: 2018-04-17T20:45:23Z initial commit to support CLI test, excluding YARN test > 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)
[jira] [Commented] (FLINK-8985) End-to-end test: CLI
[ https://issues.apache.org/jira/browse/FLINK-8985?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16419202#comment-16419202 ] Rong Rong commented on FLINK-8985: -- Thanks [~till.rohrmann] for the confirmation. Yes, I saw you already have the PR up for FLINK-9109. Will start working and incorporate changes accordingly. > 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)
[jira] [Commented] (FLINK-8985) End-to-end test: CLI
[ https://issues.apache.org/jira/browse/FLINK-8985?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16418795#comment-16418795 ] Till Rohrmann commented on FLINK-8985: -- Hi [~walterddr], yes starting with these commands is a good idea. The only other command we have introduced is {{flink modify -p }}. > 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)
[jira] [Commented] (FLINK-8985) End-to-end test: CLI
[ https://issues.apache.org/jira/browse/FLINK-8985?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16411952#comment-16411952 ] Rong Rong commented on FLINK-8985: -- Hi [~till.rohrmann]. I can help contributing to the REST & CLI e2e testing. Looking at some of the current scripts in `flink-end-to-end-test` module there are already some CLI/REST utilized. do you think starting with the list of commands in official docs: https://ci.apache.org/projects/flink/flink-docs-release-1.4/ops/cli.html is a good idea? > 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 >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)