-
Notifications
You must be signed in to change notification settings - Fork 13.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FLINK-33023][table-planner][JUnit5 Migration] Module: flink-table-planner (TableTestBase) #23349
Conversation
Hi @leonardBang. |
594e1f3
to
4542bbc
Compare
19b263b
to
c4202ee
Compare
@flinkbot run azure |
c4202ee
to
332905c
Compare
fa07af0
to
c59b139
Compare
@xuyangzhong Would you like to help review this PR? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank for your huge contribution about replacing junit4 with junit5 in table-planner module. The whole pr looks good to me. I mainly have two confusion.
- Is it a good time to remove the dependency in module
table-planner
to avoid other contributor continuing using junit4? - I found that you spent some time to remove
public
for each test functions. But it is a weak constraint for contributor to following this implicit rule. How to make this rule more visible for contributor? (maybe using custom check style or something else)
"Logical plans do not match", | ||
LogicalPlanFormatUtils.formatTempTableId(expectedString), | ||
LogicalPlanFormatUtils.formatTempTableId(actualString)) | ||
assertThat(LogicalPlanFormatUtils.formatTempTableId(actualString)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The error message seems to be lost. What about using org.junit.jupiter.api.Assertions#assertEquals
?
@@ -621,8 +638,9 @@ abstract class TableTestUtilBase(test: TableTestBase, isStreamingMode: Boolean) | |||
val optimizedRel = getPlanner.optimize(relNode) | |||
val optimizedPlan = getOptimizedRelPlan(Array(optimizedRel), Array.empty, withRowType = false) | |||
val result = notExpected.forall(!optimizedPlan.contains(_)) | |||
val message = s"\nactual plan:\n$optimizedPlan\nnot expected:\n${notExpected.mkString(", ")}" | |||
assertTrue(message, result) | |||
val message: String = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit, revert this unnecessary changes.
@@ -835,28 +848,26 @@ abstract class TableTestUtilBase(test: TableTestBase, isStreamingMode: Boolean) | |||
if (!file.exists() || "true".equalsIgnoreCase(System.getenv(PLAN_TEST_FORCE_OVERWRITE))) { | |||
Files.deleteIfExists(path) | |||
file.getParentFile.mkdirs() | |||
assertTrue(file.createNewFile()) | |||
assertThat(file.createNewFile()).isTrue |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit, use assertTrue(file.createNewFile())
since you have intruduced org.junit.jupiter.api.Assertions.assertTrue
with junit5.
@@ -103,7 +103,7 @@ public void testCrossJoinOverrideParameters() { | |||
} | |||
|
|||
@Test | |||
public void testLeftOuterJoinWithLiteralTrue() { | |||
void testLeftOuterJoinWithLiteralTrue() { | |||
String sinkTableDdl = | |||
"CREATE TABLE MySink (\n" | |||
+ " a varchar,\n" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit, also remove the public
in function testJoinWithFilter()
below.
BTW, maybe we need to consider how to make the weak constraint about removing public
in test functions more conspicuous.
|
||
/** Test for {@link PushFilterIntoTableSourceScanRule}. */ | ||
public class PushFilterIntoTableSourceScanRuleTest | ||
extends PushFilterIntoTableSourceScanRuleTestBase { | ||
class PushFilterIntoTableSourceScanRuleTest extends PushFilterIntoTableSourceScanRuleTestBase { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto, this class only has some unresolved test cases where the 'public' need to be removed.
c59b139
to
244c104
Compare
Thanks @xuyangzhong for the hard review.
Please help check it again when you have time. |
LGTM. cc @leonardBang for the final check. |
244c104
to
7da0d9b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @Jiabao-Sun for the contribution and @xuyangzhong for the review work, LGTM
…anner/planner/utils (TableTestBase)
…anner/api (TableTestBase)
…rs/flink-connector-hive (TableTestBase)
…anner/connector (TableTestBase)
…anner/planner/alias (TableTestBase)
…anner/planner/analyze (TableTestBase)
…anner/planner/catalog,expressions,runtime (TableTestBase)
…anner/planner/plan (TableTestBase)
7da0d9b
to
8972348
Compare
What is the purpose of the change
[FLINK-33023][table-planner][JUnit5 Migration] Module: flink-table-planner (TableTestBase)
Brief change log
JUnit5 Migration Module: flink-table-planner (TableTestBase)
Verifying this change
This change is already covered by existing tests
Does this pull request potentially affect one of the following parts:
@Public(Evolving)
: noDocumentation