Repository navigation
Flink: Create CatalogTestBase for migration to JUnit5 - #9364
Conversation
| import org.junit.jupiter.api.io.TempDir; | ||
|
|
||
| @ExtendWith(ParameterizedTestExtension.class) | ||
| public abstract class FlinkCatalogTestBaseJU5 extends TestBase { |
There was a problem hiding this comment.
we can just call this CatalogTestBase
|
can you also please convert |
|
I tested this implementation with couple of subclasses and it seems to be working fine. The difference that I observed here as compared to junit4 in terms of test execution. First test is triggered with all the supplied parameters in serial order then only it proceeds to next test in the sequence. |
ack |
Can you include the subclasses you tested in this PR and convert them to JUnit5 in a separate commit? |
…atalogTestBaseJU5 to CatalogTestBase
|
Thanks for the review, @nastra I have added following changes
|
|
Addressed Following review comments
|
nastra
left a comment
There was a problem hiding this comment.
I've left a few minor comments, can you also please convert TestMetadataTableReadableMetrics and include it in this PR? In a follow-up PR we should then include all the other tests that currently extent FlinkCatalogTestBase and convert them to use CatalogTestBase.
| protected boolean isHadoopCatalog; | ||
|
|
||
| @Parameters(name = "catalogName={0} baseNamespace={1}") | ||
| static List<Object[]> parametrs() { |
There was a problem hiding this comment.
| static List<Object[]> parametrs() { | |
| protected static List<Object[]> parameters() { |
…dataTableReadableMetrics and TestFlinkCatalogTablePartitions
|
|
| assertThat(validationNamespaceCatalog.namespaceExists(icebergNamespace)) | ||
| .as("Namespace should exist") | ||
| .isTrue(); | ||
| assertThat(sql("SHOW TABLES").size()).as("Should not list any tables").isEqualTo(0); |
There was a problem hiding this comment.
| assertThat(sql("SHOW TABLES").size()).as("Should not list any tables").isEqualTo(0); | |
| assertThat(sql("SHOW TABLES")).isEmpty(); |
| } | ||
|
|
||
| @Rule public TemporaryFolder temp = new TemporaryFolder(); | ||
| @TempDir Path temp; |
There was a problem hiding this comment.
this can be private (unless there's a subclass that might use this)
|
|
||
| DataFile dataFile = | ||
| FileHelpers.writeDataFile(table, Files.localOutput(temp.newFile()), records); | ||
| DataFile dataFile = FileHelpers.writeDataFile(table, Files.localOutput(temp.toFile()), records); |
There was a problem hiding this comment.
this should be doing File.createTempFile("junit", null, temp.toFile()) instead of temp.toFile(), similar to how it was done in #9341. The same needs to be done in L151
|
@vinitpatni just a few minor things, but should be ready to go once those are addressed |
|
|
@nastra Thanks for merging my changes. I have also completed Junit 5 conversion and AssertJ style for TestFlinkCatalogTable and TestFlinkMetadataTable. Should I created Separate PR or follow up on this one ? |
|
Just create a new PR |
…se for migration to JUnit5
…se for migration to JUnit5
…se for migration to JUnit5
…se for migration to JUnit5 (apache#9601)
…se for migration to JUnit5 (apache#9601)
Base class creation of FlinkCatalogTestBase for the migration to JUnit5 in regards to #9079