Copilot commented on code in PR #8167:
URL: https://github.com/apache/hbase/pull/8167#discussion_r3162619096
##########
hbase-server/src/test/java/org/apache/hadoop/hbase/wal/TestCompressedWAL.java:
##########
@@ -18,18 +18,20 @@
package org.apache.hadoop.hbase.wal;
import java.util.stream.Stream;
-import org.apache.hadoop.hbase.HBaseParameterizedTestTemplate;
import org.apache.hadoop.hbase.HConstants;
import org.apache.hadoop.hbase.testclassification.MediumTests;
import org.apache.hadoop.hbase.testclassification.RegionServerTests;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Tag;
+import org.junit.jupiter.params.ParameterizedClass;
import org.junit.jupiter.params.provider.Arguments;
+import org.junit.jupiter.params.provider.MethodSource;
@Tag(RegionServerTests.TAG)
@Tag(MediumTests.TAG)
-@HBaseParameterizedTestTemplate(name = "{index}: provider={0}")
+@ParameterizedClass(name = "{index}: provider={0}")
+@MethodSource("parameters")
public class TestCompressedWAL extends CompressedWALTestBase {
Review Comment:
`org.junit.jupiter.params.ParameterizedClass` and a type-level
`@MethodSource` are not part of standard JUnit Jupiter parameterized tests (as
of JUnit 5.10.x/5.11.x), and `@MethodSource` is normally only applicable to
parameterized *methods*. This is likely to fail compilation or silently not
parameterize execution. Consider converting to method-level
`@ParameterizedTest` + `@MethodSource` (passing the parameter into each test
method), or keep using `@TestTemplate` with the existing HBase parameterized
template/extension if class-level parameterization is required.
##########
hbase-compression/hbase-compression-zstd/src/test/java/org/apache/hadoop/hbase/io/compress/zstd/TestHFileCompressionZstd.java:
##########
@@ -86,7 +81,6 @@ public void testReconfLevels() throws Exception {
long len_2 = FS.getFileStatus(path_2).getLen();
LOG.info("Level 1 len {}", len_1);
LOG.info("Level 22 len {}", len_2);
- assertTrue("Reconfiguraton with ZSTD_LEVEL_KEY did not seem to work",
len_1 > len_2);
+ assertTrue(len_1 > len_2, "Reconfiguraton with ZSTD_LEVEL_KEY did not seem
to work");
Review Comment:
Typo in assertion message: `Reconfiguraton` should be `Reconfiguration`.
##########
hbase-server/src/test/java/org/apache/hadoop/hbase/wal/CompressedWALTestBase.java:
##########
@@ -71,12 +68,12 @@ public abstract class CompressedWALTestBase {
Arrays.fill(VALUE, off, (off += 1597), (byte) 'Q');
}
- @TestTemplate
+ @Test
public void test() throws Exception {
testForSize(1000);
}
- @TestTemplate
+ @Test
public void testLarge() throws Exception {
testForSize(1024 * 1024);
}
Review Comment:
Replacing `@TestTemplate` with `@Test` changes execution semantics: these
methods will run once per test class instance instead of once per template
invocation. If the intended behavior is to execute these tests once per
compression/provider parameter set, this will likely reduce coverage (or break
the parameterization model). A more robust approach is to either (1) keep
`@TestTemplate` and register the corresponding invocation context
provider/extension, or (2) implement method-level `@ParameterizedTest` methods
that accept the parameter and then call `testForSize(...)`.
--
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]