Skip to content

Conversation

walterddr
Copy link
Contributor

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

@walterddr walterddr force-pushed the FLINK-8985 branch 2 times, most recently from d65157f to ea12737 Compare April 27, 2018 00:29
Copy link
Contributor

@tzulitai tzulitai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank a lot for the PR @walterddr! And sorry for the long delay on the review.

Overall, this looks quite good. I have some comments to address before we merge this.

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 \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There probably should be some verification that the job actually runs with DOP=4

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is a detached execution, we probably want to wait until this job completes before continuing?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good point. I will add the check 👍

printf "Test information APIs\n"
printf "==============================================================================\n"
if [ $EXIT_CODE == 0 ]; then
eval "$FLINK_DIR/bin/flink info $FLINK_DIR/examples/batch/WordCount.jar"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we verify the output of info?

EXIT_CODE=$?
fi
if [ $EXIT_CODE == 0 ]; then
eval "$FLINK_DIR/bin/flink list"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we verify the output of list?

fi

printf "\n==============================================================================\n"
printf "Test savepoint for a running streaming jobs\n"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this part can be removed. The coverage is already subsumed by test_resume_savepoint.sh.
What do you think?

@walterddr
Copy link
Contributor Author

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.


function cleanup_cli_test() {
stop_cluster
$FLINK_DIR/bin/taskmanager.sh stop-all
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need to explicitly shutdown the cluster and TMs here; that is already part of the cleanup call

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

twalthr pushed a commit to twalthr/flink that referenced this pull request Nov 6, 2018
@twalthr
Copy link
Contributor

twalthr commented Nov 6, 2018

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.

@asfgit asfgit closed this in 44f2175 Nov 6, 2018
asfgit pushed a commit that referenced this pull request Nov 7, 2018
tisonkun pushed a commit to tisonkun/flink that referenced this pull request Jan 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants