legendtkl commented on code in PR #1742:
URL:
https://github.com/apache/incubator-seatunnel/pull/1742#discussion_r857666959
##########
seatunnel-core/seatunnel-core-flink/src/test/java/org/apache/seatunnel/FlinkStarterTest.java:
##########
@@ -31,6 +31,23 @@ public void buildCommands() {
Assert.assertTrue(flinkExecuteCommand.contains("--config test.conf"));
Assert.assertTrue(flinkExecuteCommand.contains("-m yarn-cluster"));
Assert.assertTrue(flinkExecuteCommand.contains("-Dkey1=value1"));
+
Assert.assertTrue(flinkExecuteCommand.contains("${FLINK_HOME}/bin/flink run"));
+
+ String[] args1 = {"--config", "test.conf", "-m", "yarn-cluster", "-i",
"key1=value1", "-i", "key2=value2", "--run-mode", "run-application"};
+ flinkExecuteCommand = String.join(" ", new
FlinkStarter(args1).buildCommands());
+
Assert.assertTrue(flinkExecuteCommand.contains("${FLINK_HOME}/bin/flink
run-application"));
+
+ String[] args2 = {"--config", "test.conf", "-m", "yarn-cluster", "-i",
"key1=value1", "-i", "key2=value2", "--run-mode", "run"};
+ flinkExecuteCommand = String.join(" ", new
FlinkStarter(args2).buildCommands());
+
Assert.assertTrue(flinkExecuteCommand.contains("${FLINK_HOME}/bin/flink run"));
+
+ try {
+ String[] args3 = {"--config", "test.conf", "-m", "yarn-cluster",
"-i", "key1=value1", "-i", "key2=value2", "--run-mode", "run123"};
+ new FlinkStarter(args3);
+ } catch (Exception e) {
+ Assert.assertTrue(e instanceof IllegalArgumentException);
+ Assert.assertEquals("Run mode run123 not supported",
e.getMessage());
+ }
Review Comment:
Yes, for this case without the `--run-mode`, we can reuse the test logic of
line 27~34
And without the `--run-mode`, we set it to default value `run`. What do you
think?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]