You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Jiabao-Sun (via GitHub)" <gi...@apache.org> on 2023/09/04 08:57:11 UTC

[GitHub] [flink] Jiabao-Sun opened a new pull request, #23349: [FLINK-33023][table-planner][JUnit5 Migration] Module: flink-table-planner (TableTestBase)

Jiabao-Sun opened a new pull request, #23349:
URL: https://github.com/apache/flink/pull/23349

   <!--
   *Thank you very much for contributing to Apache Flink - we are happy that you want to help us improve Flink. To help the community review your contribution in the best possible way, please go through the checklist below, which will get the contribution into a shape in which it can be best reviewed.*
   
   *Please understand that we do not do this to make contributions to Flink a hassle. In order to uphold a high standard of quality for code contributions, while at the same time managing a large number of contributions, we need contributors to prepare the contributions well, and give reviewers enough contextual information for the review. Please also understand that contributions that do not follow this guide will take longer to review and thus typically be picked up with lower priority by the community.*
   
   ## Contribution Checklist
   
     - Make sure that the pull request corresponds to a [JIRA issue](https://issues.apache.org/jira/projects/FLINK/issues). Exceptions are made for typos in JavaDoc or documentation files, which need no JIRA issue.
     
     - Name the pull request in the form "[FLINK-XXXX] [component] Title of the pull request", where *FLINK-XXXX* should be replaced by the actual issue number. Skip *component* if you are unsure about which is the best component.
     Typo fixes that have no associated JIRA issue should be named following this pattern: `[hotfix] [docs] Fix typo in event time introduction` or `[hotfix] [javadocs] Expand JavaDoc for PuncuatedWatermarkGenerator`.
   
     - Fill out the template below to describe the changes contributed by the pull request. That will give reviewers the context they need to do the review.
     
     - Make sure that the change passes the automated tests, i.e., `mvn clean verify` passes. You can set up Azure Pipelines CI to do that following [this guide](https://cwiki.apache.org/confluence/display/FLINK/Azure+Pipelines#AzurePipelines-Tutorial:SettingupAzurePipelinesforaforkoftheFlinkrepository).
   
     - Each pull request should address only one issue, not mix up code from multiple issues.
     
     - Each commit in the pull request has a meaningful commit message (including the JIRA id)
   
     - Once all items of the checklist are addressed, remove the above text and this checklist, leaving only the filled out template below.
   
   
   **(The sections below can be removed for hotfixes of typos)**
   -->
   
   ## What is the purpose of the change
   
   [table-planner][JUnit5 Migration] Module: flink-table-planner (TableTestBase)
   ## Brief change log
   
   [table-planner][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:
   
     - Dependencies (does it add or upgrade a dependency): no
     - The public API, i.e., is any changed class annotated with `@Public(Evolving)`: no
     - The serializers: no
     - The runtime per-record code paths (performance sensitive): no
     - Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn, ZooKeeper: no
     - The S3 file system connector: no
   
   ## Documentation
   
     - Does this pull request introduce a new feature? no
     - If yes, how is the feature documented? not applicable
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [flink] flinkbot commented on pull request #23349: [FLINK-33023][table-planner][JUnit5 Migration] Module: flink-table-planner (TableTestBase)

Posted by "flinkbot (via GitHub)" <gi...@apache.org>.
flinkbot commented on PR #23349:
URL: https://github.com/apache/flink/pull/23349#issuecomment-1704882413

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "594e1f319ea5d39ba6f15ac4bd956b26028f0f52",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "594e1f319ea5d39ba6f15ac4bd956b26028f0f52",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 594e1f319ea5d39ba6f15ac4bd956b26028f0f52 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [FLINK-33023][table-planner][JUnit5 Migration] Module: flink-table-planner (TableTestBase) [flink]

Posted by "leonardBang (via GitHub)" <gi...@apache.org>.
leonardBang commented on PR #23349:
URL: https://github.com/apache/flink/pull/23349#issuecomment-1790034505

   @xuyangzhong Would you like to help review this PR?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [flink] Jiabao-Sun commented on pull request #23349: [FLINK-33023][table-planner][JUnit5 Migration] Module: flink-table-planner (TableTestBase)

Posted by "Jiabao-Sun (via GitHub)" <gi...@apache.org>.
Jiabao-Sun commented on PR #23349:
URL: https://github.com/apache/flink/pull/23349#issuecomment-1705496284

   Hi @leonardBang.
   Would you mind to help review this PR when you have time?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [FLINK-33023][table-planner][JUnit5 Migration] Module: flink-table-planner (TableTestBase) [flink]

Posted by "xuyangzhong (via GitHub)" <gi...@apache.org>.
xuyangzhong commented on PR #23349:
URL: https://github.com/apache/flink/pull/23349#issuecomment-1803283116

   LGTM. cc @leonardBang for the final check.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [flink] Jiabao-Sun commented on pull request #23349: [FLINK-33023][table-planner][JUnit5 Migration] Module: flink-table-planner (TableTestBase)

Posted by "Jiabao-Sun (via GitHub)" <gi...@apache.org>.
Jiabao-Sun commented on PR #23349:
URL: https://github.com/apache/flink/pull/23349#issuecomment-1722919065

   @flinkbot run azure


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [FLINK-33023][table-planner][JUnit5 Migration] Module: flink-table-planner (TableTestBase) [flink]

Posted by "leonardBang (via GitHub)" <gi...@apache.org>.
leonardBang merged PR #23349:
URL: https://github.com/apache/flink/pull/23349


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [FLINK-33023][table-planner][JUnit5 Migration] Module: flink-table-planner (TableTestBase) [flink]

Posted by "xuyangzhong (via GitHub)" <gi...@apache.org>.
xuyangzhong commented on code in PR #23349:
URL: https://github.com/apache/flink/pull/23349#discussion_r1384671836


##########
flink-table/flink-table-planner/src/test/scala/org/apache/flink/table/planner/utils/TableTestBase.scala:
##########
@@ -126,10 +118,35 @@ abstract class TableTestBase {
   def verifyTableEquals(expected: Table, actual: Table): Unit = {
     val expectedString = FlinkRelOptUtil.toString(TableTestUtil.toRelNode(expected))
     val actualString = FlinkRelOptUtil.toString(TableTestUtil.toRelNode(actual))
-    assertEquals(
-      "Logical plans do not match",
-      LogicalPlanFormatUtils.formatTempTableId(expectedString),
-      LogicalPlanFormatUtils.formatTempTableId(actualString))
+    assertThat(LogicalPlanFormatUtils.formatTempTableId(actualString))

Review Comment:
   The error message seems to be lost. What about using `org.junit.jupiter.api.Assertions#assertEquals`?
   



##########
flink-table/flink-table-planner/src/test/java/org/apache/flink/table/planner/plan/rules/logical/PushFilterIntoTableSourceScanRuleTest.java:
##########
@@ -30,15 +30,14 @@
 import org.apache.calcite.plan.hep.HepMatchOrder;
 import org.apache.calcite.rel.rules.CoreRules;
 import org.apache.calcite.tools.RuleSets;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
 
 /** Test for {@link PushFilterIntoTableSourceScanRule}. */
-public class PushFilterIntoTableSourceScanRuleTest
-        extends PushFilterIntoTableSourceScanRuleTestBase {
+class PushFilterIntoTableSourceScanRuleTest extends PushFilterIntoTableSourceScanRuleTestBase {

Review Comment:
   ditto, this class only has some unresolved test cases where the 'public' need to be removed.



##########
flink-table/flink-table-planner/src/test/java/org/apache/flink/table/planner/plan/nodes/exec/stream/CorrelateJsonPlanTest.java:
##########
@@ -103,7 +103,7 @@ public void testCrossJoinOverrideParameters() {
     }
 
     @Test
-    public void testLeftOuterJoinWithLiteralTrue() {
+    void testLeftOuterJoinWithLiteralTrue() {
         String sinkTableDdl =
                 "CREATE TABLE MySink (\n"
                         + "  a varchar,\n"

Review Comment:
   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.



##########
flink-table/flink-table-planner/src/test/scala/org/apache/flink/table/planner/utils/TableTestBase.scala:
##########
@@ -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 =

Review Comment:
   nit, revert this unnecessary changes.



##########
flink-table/flink-table-planner/src/test/scala/org/apache/flink/table/planner/utils/TableTestBase.scala:
##########
@@ -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

Review Comment:
   nit, use `assertTrue(file.createNewFile())` since you have intruduced `org.junit.jupiter.api.Assertions.assertTrue` with junit5.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [FLINK-33023][table-planner][JUnit5 Migration] Module: flink-table-planner (TableTestBase) [flink]

Posted by "Jiabao-Sun (via GitHub)" <gi...@apache.org>.
Jiabao-Sun commented on PR #23349:
URL: https://github.com/apache/flink/pull/23349#issuecomment-1803143808

   > 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.
   > 
   > 1. Is it a good time to remove the dependency in module `table-planner` to avoid other contributor continuing using junit4?
   > 2. 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)
   
   Thanks @xuyangzhong for the hard review.
   1. Currently we can't remove junit4 dependencies from table-planner, because there are still some tests using Junit4 and have not been migrated to complete. After all the tests are migrated by Junit5, we can do this.
   2. I think we can add this check to ARCH Tests, but it may still need to wait until Junit5 is fully migrated.
   
   Please help check it again when you have time.
   Thanks again.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org