zhuzhurk commented on code in PR #19651:
URL: https://github.com/apache/flink/pull/19651#discussion_r870927910
##########
flink-clients/src/test/java/org/apache/flink/client/cli/CliFrontendRunTest.java:
##########
@@ -208,6 +209,31 @@ public void testParallelismWithOverflow() throws Exception
{
testFrontend.run(parameters);
}
+ @Test(expected = CliArgsException.class)
+ public void testParallelismWithInvalidValue() throws Exception {
+ String[] parameters = {"-v", "-p", "-2", getTestJarPath()};
+ Configuration configuration = new Configuration();
+ CliFrontend testFrontend =
+ new CliFrontend(configuration,
Collections.singletonList(getCli()));
+ testFrontend.run(parameters);
+ }
+
+ @Test
+ public void testParallelismWithNegativeOne() throws Exception {
+ final Configuration configuration = getConfiguration();
+ String[] parameters = {"-v", "-p", "-1", getTestJarPath()};
+ verifyCliFrontend(configuration, getCli(), parameters, -1, false);
+ }
+
+ @Test
+ public void testParallelismWithNegativeOneAndConfig() throws Exception {
Review Comment:
maybe "testParallelismWithNegativeOneAndConfig" ->
"testDefaultParallelismOptionOverridesConfiguration"
##########
flink-clients/src/test/java/org/apache/flink/client/cli/CliFrontendRunTest.java:
##########
@@ -208,6 +209,31 @@ public void testParallelismWithOverflow() throws Exception
{
testFrontend.run(parameters);
}
+ @Test(expected = CliArgsException.class)
+ public void testParallelismWithInvalidValue() throws Exception {
+ String[] parameters = {"-v", "-p", "-2", getTestJarPath()};
+ Configuration configuration = new Configuration();
+ CliFrontend testFrontend =
+ new CliFrontend(configuration,
Collections.singletonList(getCli()));
+ testFrontend.run(parameters);
+ }
+
+ @Test
+ public void testParallelismWithNegativeOne() throws Exception {
Review Comment:
maybe "testParallelismWithNegativeOne" -> "testDefaultParallelismOption"
##########
flink-clients/src/test/java/org/apache/flink/client/cli/CliFrontendRunTest.java:
##########
@@ -208,6 +209,31 @@ public void testParallelismWithOverflow() throws Exception
{
testFrontend.run(parameters);
}
+ @Test(expected = CliArgsException.class)
+ public void testParallelismWithInvalidValue() throws Exception {
+ String[] parameters = {"-v", "-p", "-2", getTestJarPath()};
Review Comment:
Looks to me option "v" is deprecated and is nod needed by the test.
##########
flink-clients/src/test/java/org/apache/flink/client/cli/CliFrontendRunTest.java:
##########
@@ -208,6 +209,31 @@ public void testParallelismWithOverflow() throws Exception
{
testFrontend.run(parameters);
}
+ @Test(expected = CliArgsException.class)
+ public void testParallelismWithInvalidValue() throws Exception {
+ String[] parameters = {"-v", "-p", "-2", getTestJarPath()};
+ Configuration configuration = new Configuration();
+ CliFrontend testFrontend =
+ new CliFrontend(configuration,
Collections.singletonList(getCli()));
+ testFrontend.run(parameters);
+ }
+
+ @Test
+ public void testParallelismWithNegativeOne() throws Exception {
+ final Configuration configuration = getConfiguration();
+ String[] parameters = {"-v", "-p", "-1", getTestJarPath()};
Review Comment:
I think it's better to replace -1 with ExecutionConfig.PARALLELISM_DEFAULT.
This also applies to other -1
##########
flink-clients/src/test/java/org/apache/flink/client/cli/CliFrontendRunTest.java:
##########
@@ -208,6 +209,31 @@ public void testParallelismWithOverflow() throws Exception
{
testFrontend.run(parameters);
}
+ @Test(expected = CliArgsException.class)
+ public void testParallelismWithInvalidValue() throws Exception {
Review Comment:
maybe "testParallelismWithInvalidValue" ->
"testInvalidNegativeParallelismOption"
because there is already a "testInvalidParallelismOption" test.
--
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]