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
I have searched in the issues and found no similar issues.
What would you like to be improved?
Remove JUnit 4 (org.junit.*) from the entire repository so the parent POM can drop junit:junit and junit-vintage-engine. Currently ~246 test files still depend on JUnit 4, including ~89 @RunWith(Parameterized.class) classes.
This issue tracks the umbrella effort across all modules. The original #3974 was scoped only to amoro-common, but the shared test bases there (TestAms, TestHMS, AmoroCatalogTestBase, TestAmoroCatalogBase, TestServerTableDescriptor, AmoroRunListener) are extended or used as @Rule/@ClassRule/RunListener by tests in many other modules. Migrating those bases in isolation breaks downstream modules — that is what blocked #4004 and #4059. So the migration has to happen across all modules in coordinated steps and needs a single umbrella ticket to track ordering.
How should we improve?
Strategy: leaves first, root last — migrate concrete test classes module by module, keeping the shared amoro-common helpers on JUnit 4 until every consumer is gone. CI stays green at every step. Each step is a separate PR with body Closes part of #THIS_ISSUE.
Step 3 — amoro-format-iceberg (~55 files; first time exercising the @RunWith(Parameterized.class) → @ParameterizedTest @MethodSource rewrite, plus iceberg-side consumers of TestAmoroCatalogBase/TestServerTableDescriptor) ([AMORO-4203][format-iceberg] Migrate tests from JUnit 4 to JUnit 5 #4205)
Step 9 — Closing PR: convert the 6 amoro-common helpers (TestAms, TestHMS, AmoroCatalogTestBase, TestAmoroCatalogBase, TestServerTableDescriptor, AmoroRunListener) to JUnit 5 Extensions / plain classes, then remove junit:junit and junit-vintage-engine from the parent POM. Also closes [Improvement]: Replacing JUnit 4 dependencies with JUnit 5 in amoro-common #3974.
Notes on the Parameterized rewrite
Subclasses such as TestIcebergAmoroCatalog, TestMixedIcebergFormatCatalog, and TestPaimonAmoroCatalog currently use @RunWith(Parameterized.class) with constructor injection of AmoroCatalogTestHelper. JUnit 5 has no equivalent of constructor parameter injection without a custom ParameterResolver. Per @czy006's preference expressed on #4004, these will be refactored to @ParameterizedTest + @MethodSource rather than registering a ParameterResolver — the latter would be carry-over tech debt.
Search before asking
What would you like to be improved?
Remove JUnit 4 (
org.junit.*) from the entire repository so the parent POM can dropjunit:junitandjunit-vintage-engine. Currently ~246 test files still depend on JUnit 4, including ~89@RunWith(Parameterized.class)classes.This issue tracks the umbrella effort across all modules. The original #3974 was scoped only to
amoro-common, but the shared test bases there (TestAms,TestHMS,AmoroCatalogTestBase,TestAmoroCatalogBase,TestServerTableDescriptor,AmoroRunListener) are extended or used as@Rule/@ClassRule/RunListenerby tests in many other modules. Migrating those bases in isolation breaks downstream modules — that is what blocked #4004 and #4059. So the migration has to happen across all modules in coordinated steps and needs a single umbrella ticket to track ordering.How should we improve?
Strategy: leaves first, root last — migrate concrete test classes module by module, keeping the shared
amoro-commonhelpers on JUnit 4 until every consumer is gone. CI stays green at every step. Each step is a separate PR with bodyCloses part of #THIS_ISSUE.amoro-commonself-contained tests ([AMORO-3974][common] Migrate self-contained tests from JUnit 4 to JUnit 5 #4199)amoro-optimizer-common(5 files, smallest leaf, validates the pattern with reviewers) ([AMORO-4203][optimizer-common] Migrate tests from JUnit 4 to JUnit 5 #4204)amoro-format-iceberg(~55 files; first time exercising the@RunWith(Parameterized.class)→@ParameterizedTest @MethodSourcerewrite, plus iceberg-side consumers ofTestAmoroCatalogBase/TestServerTableDescriptor) ([AMORO-4203][format-iceberg] Migrate tests from JUnit 4 to JUnit 5 #4205)amoro-format-mixed-hive(~23 files)amoro-format-mixed-spark3.3 / 3.4 / 3.5 (~13 files)amoro-format-mixed-flink-common(~52 files; converts theAmoroRunListenersurefire wiring to a JUnit 5TestExecutionListenerat the same time) ([AMORO-4203][mixed-flink-common] Migrate tests from JUnit 4 to JUnit 5 #4206)amoro-format-paimon+amoro-mixed-trino+amoro-openapi-sdk+amoro-mixed-spark-3-common(~8 files)amoro-ams(~81 files, largest)amoro-commonhelpers (TestAms,TestHMS,AmoroCatalogTestBase,TestAmoroCatalogBase,TestServerTableDescriptor,AmoroRunListener) to JUnit 5 Extensions / plain classes, then removejunit:junitandjunit-vintage-enginefrom the parent POM. Also closes [Improvement]: Replacing JUnit 4 dependencies with JUnit 5 in amoro-common #3974.Notes on the
ParameterizedrewriteSubclasses such as
TestIcebergAmoroCatalog,TestMixedIcebergFormatCatalog, andTestPaimonAmoroCatalogcurrently use@RunWith(Parameterized.class)with constructor injection ofAmoroCatalogTestHelper. JUnit 5 has no equivalent of constructor parameter injection without a customParameterResolver. Per @czy006's preference expressed on #4004, these will be refactored to@ParameterizedTest+@MethodSourcerather than registering aParameterResolver— the latter would be carry-over tech debt.Are you willing to submit PR?
Code of Conduct