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/05/04 15:23:58 UTC

[GitHub] [flink] snuyanzin opened a new pull request, #19638: [FLINK-27490][table][tests] Migrate test to JUnit5 for flink-table-co…

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

   ## What is the purpose of the change
   
   [JUnit5 Migration] Module: flink-table-code-splitter
   
   
   ## Brief change log
   
   [JUnit5 Migration] Module: flink-table-code-splitter
   
   ## 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] snuyanzin commented on pull request #19638: [FLINK-27490][table][tests] Migrate test to JUnit5 for flink-table-co…

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

   
   @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


[GitHub] [flink] zentol commented on a diff in pull request #19638: [FLINK-27490][table][tests] Migrate test to JUnit5 for flink-table-co…

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


##########
flink-table/flink-table-code-splitter/src/test/java/org/apache/flink/table/codesplit/JavaCodeSplitterTest.java:
##########
@@ -20,28 +20,28 @@
 import org.apache.flink.core.testutils.FlinkMatchers;
 import org.apache.flink.util.FileUtils;
 
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 import java.io.File;
 
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.HamcrestCondition.matching;
 
 /** Tests for {@link JavaCodeSplitter}. */
-public class JavaCodeSplitterTest {
+class JavaCodeSplitterTest {
 
     @Test
-    public void testSplitJavaCode() {
+    void testSplitJavaCode() {
         runTest("TestSplitJavaCode", 100, 3);
     }
 
     @Test
-    public void testNotSplitJavaCode() {
+    void testNotSplitJavaCode() {
         runTest("TestNotSplitJavaCode", 4000, 10000);
     }
 
     @Test
-    public void testInvalidJavaCode() {
+    void testInvalidJavaCode() {
         try {
             JavaCodeSplitter.split("public class InvalidClass { return 1; }", 4000, 10000);

Review Comment:
   @snuyanzin Can you revert the changes to the ReturnValueRewriter? I'm not confident in making that change on my own.
   
   We'll rewrite `testInvalidJavaCode()` as originally planned, but disable it and file a ticket.



-- 
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] zentol commented on a diff in pull request #19638: [FLINK-27490][table][tests] Migrate test to JUnit5 for flink-table-co…

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


##########
flink-table/flink-table-code-splitter/src/test/java/org/apache/flink/table/codesplit/JavaCodeSplitterTest.java:
##########
@@ -20,28 +20,28 @@
 import org.apache.flink.core.testutils.FlinkMatchers;
 import org.apache.flink.util.FileUtils;
 
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 import java.io.File;
 
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.HamcrestCondition.matching;
 
 /** Tests for {@link JavaCodeSplitter}. */
-public class JavaCodeSplitterTest {
+class JavaCodeSplitterTest {
 
     @Test
-    public void testSplitJavaCode() {
+    void testSplitJavaCode() {
         runTest("TestSplitJavaCode", 100, 3);
     }
 
     @Test
-    public void testNotSplitJavaCode() {
+    void testNotSplitJavaCode() {
         runTest("TestNotSplitJavaCode", 4000, 10000);
     }
 
     @Test
-    public void testInvalidJavaCode() {
+    void testInvalidJavaCode() {
         try {
             JavaCodeSplitter.split("public class InvalidClass { return 1; }", 4000, 10000);

Review Comment:
   @snuyanzin Can you revert the changes to the ReturnValueRewriter?
   
   We'll rewrite `testInvalidJavaCode()` as originally planned, but disable it and file a ticket.



-- 
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] zentol commented on a diff in pull request #19638: [FLINK-27490][table][tests] Migrate test to JUnit5 for flink-table-co…

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


##########
flink-table/flink-table-code-splitter/src/test/java/org/apache/flink/table/codesplit/JavaCodeSplitterTest.java:
##########
@@ -20,28 +20,28 @@
 import org.apache.flink.core.testutils.FlinkMatchers;
 import org.apache.flink.util.FileUtils;
 
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 import java.io.File;
 
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.HamcrestCondition.matching;
 
 /** Tests for {@link JavaCodeSplitter}. */
-public class JavaCodeSplitterTest {
+class JavaCodeSplitterTest {
 
     @Test
-    public void testSplitJavaCode() {
+    void testSplitJavaCode() {
         runTest("TestSplitJavaCode", 100, 3);
     }
 
     @Test
-    public void testNotSplitJavaCode() {
+    void testNotSplitJavaCode() {
         runTest("TestNotSplitJavaCode", 4000, 10000);
     }
 
     @Test
-    public void testInvalidJavaCode() {
+    void testInvalidJavaCode() {
         try {
             JavaCodeSplitter.split("public class InvalidClass { return 1; }", 4000, 10000);

Review Comment:
   @tsreaper ping



-- 
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 #19638: [FLINK-27490][table][tests] Migrate test to JUnit5 for flink-table-co…

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

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "95082f85d0395e376618a75607709b0706fb3896",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "95082f85d0395e376618a75607709b0706fb3896",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 95082f85d0395e376618a75607709b0706fb3896 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] zentol commented on a diff in pull request #19638: [FLINK-27490][table][tests] Migrate test to JUnit5 for flink-table-co…

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


##########
flink-table/flink-table-code-splitter/src/test/java/org/apache/flink/table/codesplit/JavaCodeSplitterTest.java:
##########
@@ -20,28 +20,28 @@
 import org.apache.flink.core.testutils.FlinkMatchers;
 import org.apache.flink.util.FileUtils;
 
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 import java.io.File;
 
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.HamcrestCondition.matching;
 
 /** Tests for {@link JavaCodeSplitter}. */
-public class JavaCodeSplitterTest {
+class JavaCodeSplitterTest {
 
     @Test
-    public void testSplitJavaCode() {
+    void testSplitJavaCode() {
         runTest("TestSplitJavaCode", 100, 3);
     }
 
     @Test
-    public void testNotSplitJavaCode() {
+    void testNotSplitJavaCode() {
         runTest("TestNotSplitJavaCode", 4000, 10000);
     }
 
     @Test
-    public void testInvalidJavaCode() {
+    void testInvalidJavaCode() {
         try {
             JavaCodeSplitter.split("public class InvalidClass { return 1; }", 4000, 10000);

Review Comment:
   assertThatThrownBy



-- 
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] zentol merged pull request #19638: [FLINK-27490][table][tests] Migrate test to JUnit5 for flink-table-co…

Posted by GitBox <gi...@apache.org>.
zentol merged PR #19638:
URL: https://github.com/apache/flink/pull/19638


-- 
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] zentol commented on a diff in pull request #19638: [FLINK-27490][table][tests] Migrate test to JUnit5 for flink-table-co…

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


##########
flink-table/flink-table-code-splitter/src/test/java/org/apache/flink/table/codesplit/JavaCodeSplitterTest.java:
##########
@@ -20,28 +20,28 @@
 import org.apache.flink.core.testutils.FlinkMatchers;
 import org.apache.flink.util.FileUtils;
 
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 import java.io.File;
 
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.HamcrestCondition.matching;
 
 /** Tests for {@link JavaCodeSplitter}. */
-public class JavaCodeSplitterTest {
+class JavaCodeSplitterTest {
 
     @Test
-    public void testSplitJavaCode() {
+    void testSplitJavaCode() {
         runTest("TestSplitJavaCode", 100, 3);
     }
 
     @Test
-    public void testNotSplitJavaCode() {
+    void testNotSplitJavaCode() {
         runTest("TestNotSplitJavaCode", 4000, 10000);
     }
 
     @Test
-    public void testInvalidJavaCode() {
+    void testInvalidJavaCode() {
         try {
             JavaCodeSplitter.split("public class InvalidClass { return 1; }", 4000, 10000);

Review Comment:
   (the current test is in fact incorrect since it still passes if no exception is thrown)



-- 
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] snuyanzin commented on a diff in pull request #19638: [FLINK-27490][table][tests] Migrate test to JUnit5 for flink-table-co…

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


##########
flink-table/flink-table-code-splitter/src/test/java/org/apache/flink/table/codesplit/JavaCodeSplitterTest.java:
##########
@@ -20,28 +20,28 @@
 import org.apache.flink.core.testutils.FlinkMatchers;
 import org.apache.flink.util.FileUtils;
 
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 import java.io.File;
 
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.HamcrestCondition.matching;
 
 /** Tests for {@link JavaCodeSplitter}. */
-public class JavaCodeSplitterTest {
+class JavaCodeSplitterTest {
 
     @Test
-    public void testSplitJavaCode() {
+    void testSplitJavaCode() {
         runTest("TestSplitJavaCode", 100, 3);
     }
 
     @Test
-    public void testNotSplitJavaCode() {
+    void testNotSplitJavaCode() {
         runTest("TestNotSplitJavaCode", 4000, 10000);
     }
 
     @Test
-    public void testInvalidJavaCode() {
+    void testInvalidJavaCode() {
         try {
             JavaCodeSplitter.split("public class InvalidClass { return 1; }", 4000, 10000);

Review Comment:
   Yes, thanks.
   Agree. I noticed that the code throws nothing in case of syntax errors. I added this throwing.
   And another point: it looks the code does not check anything if the code length is less or equal than the specified max method length... Currently left it as it is



-- 
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] zentol commented on a diff in pull request #19638: [FLINK-27490][table][tests] Migrate test to JUnit5 for flink-table-co…

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


##########
flink-table/flink-table-code-splitter/src/test/java/org/apache/flink/table/codesplit/JavaCodeSplitterTest.java:
##########
@@ -20,28 +20,28 @@
 import org.apache.flink.core.testutils.FlinkMatchers;
 import org.apache.flink.util.FileUtils;
 
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 import java.io.File;
 
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.HamcrestCondition.matching;
 
 /** Tests for {@link JavaCodeSplitter}. */
-public class JavaCodeSplitterTest {
+class JavaCodeSplitterTest {
 
     @Test
-    public void testSplitJavaCode() {
+    void testSplitJavaCode() {
         runTest("TestSplitJavaCode", 100, 3);
     }
 
     @Test
-    public void testNotSplitJavaCode() {
+    void testNotSplitJavaCode() {
         runTest("TestNotSplitJavaCode", 4000, 10000);
     }
 
     @Test
-    public void testInvalidJavaCode() {
+    void testInvalidJavaCode() {
         try {
             JavaCodeSplitter.split("public class InvalidClass { return 1; }", 4000, 10000);

Review Comment:
   @tsreaper can you weigh in on this?



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