You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "wzhallright (via GitHub)" <gi...@apache.org> on 2023/12/20 08:35:10 UTC

[PR] HDDS-9948. Compose annotation for tests parameterized with ContainerLayoutVersion [ozone]

wzhallright opened a new pull request, #5839:
URL: https://github.com/apache/ozone/pull/5839

   …ayoutVersion
   
   ## What changes were proposed in this pull request?
   
   - replace repeated @ParameterizedTest and @MethodSource
   
   - delete the local method used as source in the test class    
      
   https://issues.apache.org/jira/browse/HDDS-9948
   
   ## How was this patch tested?
   CI: 


-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


Re: [PR] HDDS-9948. Compose annotation for tests parameterized with ContainerLayoutVersion [ozone]

Posted by "adoroszlai (via GitHub)" <gi...@apache.org>.
adoroszlai merged PR #5839:
URL: https://github.com/apache/ozone/pull/5839


-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


Re: [PR] HDDS-9948. Compose annotation for tests parameterized with ContainerLayoutVersion [ozone]

Posted by "adoroszlai (via GitHub)" <gi...@apache.org>.
adoroszlai commented on code in PR #5839:
URL: https://github.com/apache/ozone/pull/5839#discussion_r1432453848


##########
hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/keyvalue/ContainerLayoutTestInfo.java:
##########
@@ -121,4 +127,15 @@ public static Iterable<Object[]> containerLayoutParameters() {
         .map(each -> new Object[] {each})
         .collect(toList());
   }
+
+  /**
+   * Composite annotation for tests parameterized with {@link  ContainerLayoutTestInfo}.
+   */
+  @Target(ElementType.METHOD)
+  @Retention(RetentionPolicy.RUNTIME)
+  @ParameterizedTest
+  @MethodSource("org.apache.hadoop.ozone.container.keyvalue.ContainerLayoutTestInfo#containerLayoutParameters")

Review Comment:
   We can completely remove the method `containerLayoutParameters`, which was necessary only for JUnit4.  But JUnit5 works with strongly typed parameters, so we can use `getAllVersions` directly.
   
   ```suggestion
     @MethodSource("org.apache.hadoop.ozone.container.common.impl.ContainerLayoutVersion#getAllVersions")
   ```



-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


Re: [PR] HDDS-9948. Compose annotation for tests parameterized with ContainerLayoutVersion [ozone]

Posted by "wzhallright (via GitHub)" <gi...@apache.org>.
wzhallright commented on code in PR #5839:
URL: https://github.com/apache/ozone/pull/5839#discussion_r1432583917


##########
hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/keyvalue/ContainerLayoutTestInfo.java:
##########
@@ -121,4 +127,15 @@ public static Iterable<Object[]> containerLayoutParameters() {
         .map(each -> new Object[] {each})
         .collect(toList());
   }
+
+  /**
+   * Composite annotation for tests parameterized with {@link  ContainerLayoutTestInfo}.
+   */
+  @Target(ElementType.METHOD)
+  @Retention(RetentionPolicy.RUNTIME)
+  @ParameterizedTest
+  @MethodSource("org.apache.hadoop.ozone.container.keyvalue.ContainerLayoutTestInfo#containerLayoutParameters")

Review Comment:
   Thanks a lot for review. The CI has not finished, PTAL after CI succed. Thanks again.



-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org