You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2022/06/08 19:18:31 UTC

[GitHub] [flink] snuyanzin opened a new pull request, #19915: [FLINK-27938][tests] Migrate flink-connectors-hbase-base to JUnit5

snuyanzin opened a new pull request, #19915:
URL: https://github.com/apache/flink/pull/19915

   ## What is the purpose of the change
   
   Migrate flink-connectors-hbase-base module to AssertJ and JUnit 5 following the [JUnit 5 Migration Guide](https://docs.google.com/document/d/1514Wa_aNB9bJUen4xm5uiuXOooOJTtXqS_Jqk9KJitU/edit)
   
   
   ## Brief change log
   
   Use JUnit5 and AssertJ in tests instead of JUnit4 and Hamcrest
   
   
   ## Verifying this change
   
   This change is a code cleanup without any test coverage.
   
   ## 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 #19915: [FLINK-27938][tests] Migrate flink-connectors-hbase-base to JUnit5

Posted by GitBox <gi...@apache.org>.
flinkbot commented on PR #19915:
URL: https://github.com/apache/flink/pull/19915#issuecomment-1150306955

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "1226c45e39d741fccfa0957cc9e6fced9e0cc92c",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "1226c45e39d741fccfa0957cc9e6fced9e0cc92c",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 1226c45e39d741fccfa0957cc9e6fced9e0cc92c 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


[GitHub] [flink] XComp commented on a diff in pull request #19915: [FLINK-27938][tests] Migrate flink-connectors-hbase-base to JUnit5

Posted by GitBox <gi...@apache.org>.
XComp commented on code in PR #19915:
URL: https://github.com/apache/flink/pull/19915#discussion_r983658962


##########
flink-connectors/flink-connector-hbase-base/src/test/java/org/apache/flink/connector/hbase/util/HBaseConfigLoadingTest.java:
##########
@@ -64,13 +63,13 @@ public void loadFromEnvVariables() throws Exception {
         final String k4 = "which way?";
         final String v4 = "south, always south...";
 
-        final File hbaseConfDir = tempFolder.newFolder();
+        final File hbaseConfDir = tmpDir.toFile();
 
-        final File hbaseHome = tempFolder.newFolder();
+        final File hbaseHome = tmpDir.toFile();

Review Comment:
   See `TempDirUtils` for utility methods around `@TempDir`



-- 
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] XComp commented on a diff in pull request #19915: [FLINK-27938][tests] Migrate flink-connectors-hbase-base to JUnit5

Posted by GitBox <gi...@apache.org>.
XComp commented on code in PR #19915:
URL: https://github.com/apache/flink/pull/19915#discussion_r983556714


##########
flink-connectors/flink-connector-hbase-base/src/test/java/org/apache/flink/connector/hbase/util/HBaseSerdeTest.java:
##########
@@ -71,16 +69,15 @@ public void convertToNewRowTest() {
         }
 
         // this verifies RowData is not reused
-        assertFalse(resultRowDatas.get(0) == resultRowDatas.get(1));
-
-        List<String> expected = new ArrayList<>();
-        expected.add("+I(1,+I(10),+I(Hello-1,100),+I(1.01,false,Welt-1))");
-        expected.add("+I(2,+I(20),+I(Hello-2,200),+I(2.02,true,Welt-2))");
-        assertEquals(expected, resultRowDataStr);
+        assertThat(resultRowDatas.get(0)).isNotSameAs(resultRowDatas.get(1));

Review Comment:
   nit: I'm wondering whether we could make this part of the assert using the `as()` method. The documentation would be present still but also included in the assertion error output...



##########
flink-connectors/flink-connector-hbase-base/src/test/java/org/apache/flink/connector/hbase/util/HBaseConfigLoadingTest.java:
##########
@@ -64,13 +63,13 @@ public void loadFromEnvVariables() throws Exception {
         final String k4 = "which way?";
         final String v4 = "south, always south...";
 
-        final File hbaseConfDir = tempFolder.newFolder();
+        final File hbaseConfDir = tmpDir.toFile();
 
-        final File hbaseHome = tempFolder.newFolder();
+        final File hbaseHome = tmpDir.toFile();

Review Comment:
   Don't we change the semantics here? The previous version created two folders here. The new version uses the same folder for both files. :thinking: I guess it would be saver to stick to separate folder here.



##########
flink-connectors/flink-connector-hbase-base/src/test/java/org/apache/flink/connector/hbase/util/HBaseSerdeTest.java:
##########
@@ -71,16 +69,15 @@ public void convertToNewRowTest() {
         }
 
         // this verifies RowData is not reused
-        assertFalse(resultRowDatas.get(0) == resultRowDatas.get(1));
-
-        List<String> expected = new ArrayList<>();
-        expected.add("+I(1,+I(10),+I(Hello-1,100),+I(1.01,false,Welt-1))");
-        expected.add("+I(2,+I(20),+I(Hello-2,200),+I(2.02,true,Welt-2))");
-        assertEquals(expected, resultRowDataStr);
+        assertThat(resultRowDatas.get(0)).isNotSameAs(resultRowDatas.get(1));

Review Comment:
   same applies in the `convertToReusedRowTest` test (line 92)



-- 
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