You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Migrate the existing SQL and Quidem JUnit 4 tests to JUnit 5.
Integrate the validated MSQ JUnit 5 migration from adac0cc117 and 1869c51f68, restricted to multi-stage-query/**.
Make this PR own the combined SQL + Quidem + MSQ test migration boundary; no embedded-tests/** paths are included.
Remove MSQ's direct JUnit 4, Vintage, migration-support, JUnitParams, and Hamcrest test dependencies, and replace remaining MSQ exception assertions with Jupiter-backed DruidExceptionAssertions and local MSQ matchers.
Keep SQL's DruidExceptionAssertions API non-Hamcrest; MSQ now consumes that API directly.
Include the current-master temp-directory fixes in the SQL schema fixtures: temporaryFolder.newFolder() is replaced by the shared newTempFolder() helper backed by FileUtils.createTempDirInLocation.
Root cause
Run 31129350780 exposed the dependency boundary after the SQL migration: unchanged MSQ tests still passed SQL DruidExceptionAssertions/legacy exception matchers through Hamcrest APIs, producing errors such as DruidExceptionAssertions cannot be converted to org.hamcrest.Matcher<Throwable>. The same unresolved MSQ consumer caused the QTest shards, validate-dist, static/packaging checks, and CodeQL jobs to fail.
This PR integrates the MSQ migration without restoring JUnit 4 or Hamcrest compatibility. It intentionally does not modify embedded-tests/** or shared fixture modules outside the requested scope.
SQL and all MSQ sources compile through the MSQ test-compile boundary until the current master's shared indexing-service test fixture: MSQCompactionTaskRunTest still invokes TaskActionTestKit.before(), whose inherited org.junit.rules.ExternalResource is supplied by the separate shared-fixture migration. No JUnit 4 dependency was added to work around that out-of-scope prerequisite.
MSQ Checkstyle: passed, 0 violations.
MSQ SpotBugs: passed, 0 BugInstances and 0 errors.
Effective MSQ test dependency tree: no junit:junit, Vintage, JUnit migration-support, or Hamcrest artifacts.
Scoped source audit: no JUnit 4/Hamcrest imports/usages, no .newFolder()/.newFile() calls, and no embedded-tests paths.
Root cause: run 31129350780 failed because the SQL JUnit 5 migration removed the Hamcrest-returning exception API while unchanged MSQ tests still consumed it as Matcher<Throwable>. That dependency boundary caused the QTest shards plus validate-dist, static/packaging, and CodeQL failures.
Fixed in 038fbef729 by integrating the validated MSQ migration from adac0cc117 and 1869c51f68 under multi-stage-query/** only, removing MSQ's legacy JUnit/Hamcrest dependencies, and converting remaining MSQ exception assertions to Jupiter-backed helpers. The SQL schema temp-dir fixes are also present via newTempFolder(); the 24 focused SQL tests pass. MSQ Checkstyle and SpotBugs pass, and scoped audits find no JUnit 4/Hamcrest source imports or .newFolder()/.newFile() calls. The only local MSQ test-compile limitation is the separate shared indexing fixture's JUnit 4 TaskActionTestKit superclass, which is outside this PR's permitted paths and was not reintroduced as a compatibility dependency.
Validation evidence for the MSQ processing-helper follow-up:
Replaced all three MSQ-owned GroupByQueryRunnerTest consumers with the JUnit 5-safe GroupByQueryRunnerTestHelper.makeQueryRunnerFactory(objectMapper, config, buffers) API.
Audited multi-stage-query Java sources: no GroupByQueryRunnerTest façade references remain.
On a disposable combined validation tree containing PR test: migrate extensions-core and processing tests to JUnit 5 #19875's processing helper and the related sibling migration changes, mvn -pl multi-stage-query test-compile -DskipTests -Pskip-static-checks -Dweb.console.skip=true -T1C passed.
MSQCompactionTaskRunTest reaches test setup but is currently blocked before test bodies by the shared TaskActionTestKit.before() initialization (IllegalStateException at MSQCompactionTaskRunTest.setup:217), with the existing teardown NPE because the executor was never created. No helper compilation or API errors occur.
git diff --check passed; the commit changes only the three MSQ test files.
Failure evidence from the original PR head 738ffbba9fc2e513eb1347d1fa793fedb791b0f7:
The QTest CI run, job 92730410803, failed druid-multi-stage-query test compilation with the exact missing API:
MSQTestBase.java:[513,71] cannot find symbol
symbol: method makeQueryRunnerFactory(ObjectMapper, GroupByQueryConfig, TestGroupByBuffers)
location: class GroupByQueryRunnerTestHelper
MSQCompactionTaskRunTest.java:[248,65] cannot find symbol
symbol: method makeQueryRunnerFactory(ObjectMapper, GroupByQueryConfig, TestGroupByBuffers)
MSQTaskQueryMakerTest.java:[197,50] cannot find symbol
symbol: method makeQueryRunnerFactory(ObjectMapper, GroupByQueryConfig, TestGroupByBuffers)
The same CI compilation also reported MSQCompactionTaskRunTest.java:[217,22] cannot access org.junit.rules.ExternalResource. This is the separate shared indexing-service fixture boundary: CompactionTaskRunBase still exposes JUnit 4 TaskActionTestKit.
Added the minimal JUnit 5-safe GroupByQueryRunnerTestHelper.makeQueryRunnerFactory(ObjectMapper, GroupByQueryConfig, TestGroupByBuffers) API and its test configuration constants to the existing processing test helper, following the isolated helper change from PR #19875.
Updated TestGroupByBuffers.createDefault() to use that helper's processing config, so the migrated consumers do not load the JUnit 4 GroupByQueryRunnerTest class.
No processing production changes, SQL/MSQ/Quidem POM changes, JUnit 4 or Hamcrest compatibility dependencies, or consumer refactors were added.
Validation:
Before the fix, mvn -ntp -pl multi-stage-query -am test-compile -DskipTests -Pskip-static-checks -Dweb.console.skip=true -T1C reproduced all three missing-method diagnostics above plus the ExternalResource diagnostic.
After the fix, the same command removed all three missing-method diagnostics; processing test compilation completed, and only the separate ExternalResource diagnostic at MSQCompactionTaskRunTest.java:[217,22] remains.
Checkstyle, PMD, SpotBugs (0 bugs/0 errors), Enforcer, dev/validate-junit5-usage, and git diff --check passed for the scoped modules. SQL/Quidem/MSQ source audits found no non-Jupiter JUnit or Hamcrest references. The only matching POM entries are pre-existing transitive-dependency exclusions; the effective dependency audit resolved none of the forbidden JUnit 4/Vintage/migration-support/Hamcrest artifacts. Processing forbidden-API test scanning reported 0 errors; the MSQ forbidden-API scan could not complete because the remaining compile blocker left the test output incomplete.
The remaining ExternalResource failure is owned by the shared indexing migration tracked in PR #19910, not by the GroupBy helper API. I left it untouched to preserve #19909's no-JUnit4/no-Hamcrest scope. This fix addresses the self-contained portion of issue #13948.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
adac0cc117and1869c51f68, restricted tomulti-stage-query/**.embedded-tests/**paths are included.DruidExceptionAssertionsand local MSQ matchers.DruidExceptionAssertionsAPI non-Hamcrest; MSQ now consumes that API directly.temporaryFolder.newFolder()is replaced by the sharednewTempFolder()helper backed byFileUtils.createTempDirInLocation.Root cause
Run 31129350780 exposed the dependency boundary after the SQL migration: unchanged MSQ tests still passed SQL
DruidExceptionAssertions/legacy exception matchers through Hamcrest APIs, producing errors such asDruidExceptionAssertions cannot be converted to org.hamcrest.Matcher<Throwable>. The same unresolved MSQ consumer caused the QTest shards, validate-dist, static/packaging checks, and CodeQL jobs to fail.This PR integrates the MSQ migration without restoring JUnit 4 or Hamcrest compatibility. It intentionally does not modify
embedded-tests/**or shared fixture modules outside the requested scope.Validation
indexing-servicetest fixture:MSQCompactionTaskRunTeststill invokesTaskActionTestKit.before(), whose inheritedorg.junit.rules.ExternalResourceis supplied by the separate shared-fixture migration. No JUnit 4 dependency was added to work around that out-of-scope prerequisite.junit:junit, Vintage, JUnit migration-support, or Hamcrest artifacts..newFolder()/.newFile()calls, and no embedded-tests paths.git diff --check: passed.Part of #13948.