adoroszlai commented on code in PR #10494:
URL: https://github.com/apache/ozone/pull/10494#discussion_r3407472304


##########
hadoop-ozone/cli-admin/src/test/java/org/apache/hadoop/hdds/cli/TestGenericCliConfiguration.java:
##########
@@ -0,0 +1,78 @@
+/*
+ * 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.
+ */
+
+package org.apache.hadoop.hdds.cli;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+import java.io.IOException;
+import java.nio.charset.StandardCharsets;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import org.junit.jupiter.api.Test;
+
+/**
+ * Tests for {@link GenericCli} configuration option handling.
+ */
+public class TestGenericCliConfiguration {

Review Comment:
   9fc7064cfac11a8c873e6ef7019781264bb6f3fe moved `TestDeprecatedCliOption` 
instead of `TestGenericCliConfiguration` (as suggested).  While 
`TestDeprecatedCliOption` also exercises code in `hdds-cli-common` 
(`DeprecatedCliOption`), it used `ListPipelinesSubcommand`, so I thought we 
should keep it in `ozone-cli-admin`.  During the move `ListPipelinesSubcommand` 
was replaced with `TestCommand`, which has a simplified option structure: each 
option has both the deprecated and non-deprecated names.  I think that causes 
the test failure:
   
   ```
   Tests run: 3, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.160 s <<< 
FAILURE! -- in org.apache.hadoop.hdds.cli.TestDeprecatedCliOption
   org.apache.hadoop.hdds.cli.TestDeprecatedCliOption.doesNotWarnForLongOption 
-- Time elapsed: 0.012 s <<< FAILURE!
   java.lang.AssertionError: 
   
   Expecting empty but was: "WARNING: Option '-ffc' is deprecated. Use 
'--filter-by-factor' instead.
   "
        at 
org.apache.hadoop.hdds.cli.TestDeprecatedCliOption.doesNotWarnForLongOption(TestDeprecatedCliOption.java:85)
   ```
   
   Please restore `TestDeprecatedCliOption` to its previous state and move 
`TestGenericCliConfiguration` instead.



##########
hadoop-hdds/cli-common/pom.xml:
##########
@@ -51,6 +51,13 @@
       <groupId>org.slf4j</groupId>
       <artifactId>slf4j-api</artifactId>
     </dependency>
+
+    <!-- Test dependencies -->
+    <dependency>
+      <groupId>org.apache.ozone</groupId>
+      <artifactId>hdds-test-utils</artifactId>
+      <scope>test</scope>
+    </dependency>

Review Comment:
   This seems to be unnecessary.  Neither `TestGenericCliConfiguration` nor 
`TestDeprecatedCliOption` use code from `hdds-test-utils`.



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to