test: migrate histogram extension tests to JUnit 5 - #19879
Conversation
FrankChen021
left a comment
There was a problem hiding this comment.
I have reviewed the code for correctness, edge cases, concurrency, and integration risks; no issues found.
Reviewed 26 of 26 changed files.
This is an automated review by Codex GPT-5.6-Sol
FrankChen021
left a comment
There was a problem hiding this comment.
I have reviewed the updated code for correctness, edge cases, concurrency, and integration risks; no issues found.
Reviewed 26 of 26 changed files. The shared temporary-folder helper update preserves both legacy and Jupiter callers.
This is an automated review by Codex GPT-5.6-Sol
There was a problem hiding this comment.
Pull request overview
This PR continues the extensions-core JUnit 4 → JUnit 5 migration by converting the extensions-core/histogram test suite to Jupiter, while updating the shared AggregationTestHelper (in processing test fixtures) to support JUnit 5 @TempDir-style temp directories in addition to the existing JUnit 4 TemporaryFolder API.
Changes:
- Update
AggregationTestHelperto abstract temp-directory creation behind a provider and add JUnit 5-friendlyWithTempDirfactory methods. - Migrate histogram extension tests from JUnit 4 annotations/rules/assertions to JUnit 5 (Jupiter) equivalents, including parameterized test conversions.
- Remove the JUnit Vintage engine dependency from the histogram module.
Reviewed changes
Copilot reviewed 26 out of 26 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| processing/src/test/java/org/apache/druid/query/aggregation/AggregationTestHelper.java | Introduces a temp-folder provider abstraction and adds JUnit 5 @TempDir-compatible helper factory methods. |
| extensions-core/histogram/src/test/java/org/apache/druid/query/aggregation/histogram/QuantilesTest.java | Switches to Jupiter assertions and updates Hamcrest usage. |
| extensions-core/histogram/src/test/java/org/apache/druid/query/aggregation/histogram/QuantilesPostAggregatorTest.java | Migrates assertions and expected-exception rule to Jupiter assertThrows. |
| extensions-core/histogram/src/test/java/org/apache/druid/query/aggregation/histogram/QuantilePostAggregatorTest.java | Migrates to Jupiter assertions. |
| extensions-core/histogram/src/test/java/org/apache/druid/query/aggregation/histogram/MinPostAggregatorTest.java | Migrates to Jupiter assertions. |
| extensions-core/histogram/src/test/java/org/apache/druid/query/aggregation/histogram/MaxPostAggregatorTest.java | Migrates to Jupiter assertions. |
| extensions-core/histogram/src/test/java/org/apache/druid/query/aggregation/histogram/FixedBucketsHistogramVectorAggregatorTest.java | Migrates lifecycle annotations to Jupiter and replaces JUnit 4 asserts. |
| extensions-core/histogram/src/test/java/org/apache/druid/query/aggregation/histogram/FixedBucketsHistogramTopNQueryTest.java | Converts from JUnit4 Parameterized runner to Jupiter parameterized tests. |
| extensions-core/histogram/src/test/java/org/apache/druid/query/aggregation/histogram/FixedBucketsHistogramTest.java | Migrates to Jupiter assertions. |
| extensions-core/histogram/src/test/java/org/apache/druid/query/aggregation/histogram/FixedBucketsHistogramGroupByQueryTest.java | Converts from JUnit4 Parameterized runner and expected-exception style to Jupiter parameterized tests + assertThrows. |
| extensions-core/histogram/src/test/java/org/apache/druid/query/aggregation/histogram/FixedBucketsHistogramBufferAggregatorTest.java | Migrates to Jupiter assertions and modernizes assertion message placement. |
| extensions-core/histogram/src/test/java/org/apache/druid/query/aggregation/histogram/FixedBucketsHistogramAggregationTest.java | Moves temp-dir handling from TemporaryFolder rule to Jupiter @TempDir with updated helper factory. |
| extensions-core/histogram/src/test/java/org/apache/druid/query/aggregation/histogram/EqualBucketsPostAggregatorTest.java | Migrates to Jupiter assertions. |
| extensions-core/histogram/src/test/java/org/apache/druid/query/aggregation/histogram/CustomBucketsPostAggregatorTest.java | Migrates to Jupiter assertions. |
| extensions-core/histogram/src/test/java/org/apache/druid/query/aggregation/histogram/BucketsPostAggregatorTest.java | Migrates to Jupiter assertions. |
| extensions-core/histogram/src/test/java/org/apache/druid/query/aggregation/histogram/ArrayUtilsTest.java | Migrates to Jupiter assertions. |
| extensions-core/histogram/src/test/java/org/apache/druid/query/aggregation/histogram/ApproximateHistogramVectorAggregatorTest.java | Migrates lifecycle annotations to Jupiter and replaces JUnit 4 asserts. |
| extensions-core/histogram/src/test/java/org/apache/druid/query/aggregation/histogram/ApproximateHistogramTopNQueryTest.java | Converts from JUnit4 Parameterized runner to Jupiter parameterized tests. |
| extensions-core/histogram/src/test/java/org/apache/druid/query/aggregation/histogram/ApproximateHistogramTest.java | Migrates to Jupiter assertions and converts @Ignore to @Disabled. |
| extensions-core/histogram/src/test/java/org/apache/druid/query/aggregation/histogram/ApproximateHistogramPostAggregatorTest.java | Migrates to Jupiter assertions. |
| extensions-core/histogram/src/test/java/org/apache/druid/query/aggregation/histogram/ApproximateHistogramGroupByQueryTest.java | Converts from JUnit4 Parameterized runner and expected-exception style to Jupiter parameterized tests + assertThrows. |
| extensions-core/histogram/src/test/java/org/apache/druid/query/aggregation/histogram/ApproximateHistogramFoldingVectorAggregatorTest.java | Migrates lifecycle annotations to Jupiter and replaces JUnit 4 asserts. |
| extensions-core/histogram/src/test/java/org/apache/druid/query/aggregation/histogram/ApproximateHistogramFoldingSerdeTest.java | Migrates to Jupiter assertions and updates assertion message placement. |
| extensions-core/histogram/src/test/java/org/apache/druid/query/aggregation/histogram/ApproximateHistogramAggregatorTest.java | Migrates to Jupiter assertions and updates assertion message placement. |
| extensions-core/histogram/src/test/java/org/apache/druid/query/aggregation/histogram/ApproximateHistogramAggregationTest.java | Moves temp-dir handling from TemporaryFolder rule to Jupiter @TempDir with updated helper factory. |
| extensions-core/histogram/pom.xml | Removes the JUnit Vintage engine dependency for the module. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| private QueryRunner runner; | ||
|
|
||
| public FixedBucketsHistogramTopNQueryTest( | ||
| public void initFixedBucketsHistogramTopNQueryTest( | ||
| QueryRunner runner | ||
| ) |
There was a problem hiding this comment.
Thanks for flagging this. This was actionable and is already addressed by commit 1eb26ec9d8: the redundant runner field and initFixedBucketsHistogramTopNQueryTest method were removed, and the parameterized test uses its runner argument directly. The four affected histogram test classes passed (80 tests, 0 failures), with Checkstyle and SpotBugs reporting 0 violations/errors.
| private QueryRunner runner; | ||
|
|
||
| public ApproximateHistogramTopNQueryTest( | ||
| public void initApproximateHistogramTopNQueryTest( | ||
| QueryRunner runner | ||
| ) |
There was a problem hiding this comment.
Thanks for flagging this. This was actionable and is already addressed by commit 1eb26ec9d8: the redundant runner field and initApproximateHistogramTopNQueryTest method were removed, and the parameterized test uses its runner argument directly. The four affected histogram test classes passed (80 tests, 0 failures), with Checkstyle and SpotBugs reporting 0 violations/errors.
| private QueryRunner<ResultRow> runner; | ||
| private GroupByQueryRunnerFactory factory; | ||
|
|
There was a problem hiding this comment.
Thanks for flagging this. This was actionable and is already addressed by commit 1eb26ec9d8: the unused instance factory/runner fields and initFixedBucketsHistogramGroupByQueryTest method were removed. The parameterized method still receives the feeder values and uses the runner argument; SerDe registration is now performed directly in each test body. The four affected histogram test classes passed (80 tests, 0 failures), with Checkstyle and SpotBugs reporting 0 violations/errors.
| private QueryRunner<ResultRow> runner; | ||
| private GroupByQueryRunnerFactory factory; | ||
|
|
There was a problem hiding this comment.
Thanks for flagging this. This was actionable and is already addressed by commit 1eb26ec9d8: the unused instance factory/runner fields and initApproximateHistogramGroupByQueryTest method were removed. The parameterized method still receives the feeder values and uses the runner argument; SerDe registration is now performed directly in each test body. The four affected histogram test classes passed (80 tests, 0 failures), with Checkstyle and SpotBugs reporting 0 violations/errors.
| @MethodSource("constructorFeeder") | ||
| @ParameterizedTest(name = "{0}") | ||
| public void testGroupByWithApproximateHistogramAgg( | ||
| String testName, |
| @MethodSource("constructorFeeder") | ||
| @ParameterizedTest(name = "{0}") | ||
| public void testGroupByWithSameNameComplexPostAgg( | ||
| String testName, |
| @MethodSource("constructorFeeder") | ||
| @ParameterizedTest(name = "{0}") | ||
| public void testGroupByWithFixedHistogramAgg( | ||
| String testName, |
| @MethodSource("constructorFeeder") | ||
| @ParameterizedTest(name = "{0}") | ||
| public void testGroupByWithSameNameComplexPostAgg( | ||
| String testName, |
FrankChen021
left a comment
There was a problem hiding this comment.
I have reviewed the updated code for correctness, edge cases, concurrency, and integration risks; no issues found.
Reviewed 26 of 26 changed files. The incremental cleanup preserves method-source argument shapes and test setup, with test-annotation counts unchanged.
This is an automated review by Codex GPT-5.6-Sol
Description
Migrates the
extensions-core/histogramtest suite from JUnit 4 to JUnit 5.This is Batch 5 of the extensions-core migration and is part of #13948.
Depends on the earlier migration batches in #19875, #19876, #19877, and #19878.
The shared
AggregationTestHelpernow also accepts a JUnit 5@TempDirdirectory while retaining the existing JUnit 4-compatible API for remaining migration batches.Tests
Result: 211 tests passed; 0 failures, errors, or skips.