Skip to content

Conversation

@sunjincheng121
Copy link
Member

@sunjincheng121 sunjincheng121 commented May 19, 2017

In this PR. I had make some changes as follows:

  1. Add all the tableAPI JAVA and SCALA logical plans consistent test.
  2. Add validation folder for steam which keep consistent with batch.
  3. Refactoring the test structure.
  • General

    • The pull request references the related JIRA issue ("[FLINK-6617][table] Improve JAVA and SCALA logical plans consistent test")
    • The pull request addresses only one issue
    • Each commit in the PR has a meaningful commit message (including the JIRA id)
  • Documentation

    • Documentation has been added for new functionality
    • Old documentation affected by the pull request has been updated
    • JavaDoc for public methods has been added
  • Tests & Build

    • Functionality added by the pull request is covered by tests
    • mvn clean verify has been executed successfully locally or a Travis build has passed

Copy link
Contributor

@twalthr twalthr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR @sunjincheng121. The changes look very good, I had only minor comments. The validation packages should only contain validation tests and not the regular tests. Would be great if you could split the tests.

  • stringexpr for Java == Scala
  • validation for testing wrong table programs
  • runtime for ITCases
  • remaining packages for unit tests

As a summary, right?

*/

package org.apache.flink.table.api.scala.stream.table
package org.apache.flink.table.api.scala.stream.table.validation
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think tests in validation packages should all test for a ValidationException. Can you split this class?

case class BatchTableTestUtil() extends TableTestUtil {

val javaEnv = mock(classOf[JExecutionEnvironment])
val javaTableEnv = TableEnvironment.getTableEnvironment(javaEnv)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can rename the Scala environment to tableEnv to be consistent.

import org.junit.Test

class UnionStringExpressionTest extends TableTestBase {
@Test
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add an empty line here.

@sunjincheng121
Copy link
Member Author

sunjincheng121 commented May 23, 2017

Hi @twalthr Thanks a lot for your reviewing. I completely agree with your suggestions. I petty want refactoring the test structure. I have updated the PR. according your comments.

Thanks,
SunJincheng

@sunjincheng121 sunjincheng121 force-pushed the FLINK-6617-PR branch 3 times, most recently from 2028b87 to 93d9e6d Compare May 29, 2017 23:40
@sunjincheng121 sunjincheng121 force-pushed the FLINK-6617-PR branch 3 times, most recently from a69c0b2 to 897034c Compare May 31, 2017 09:41
@sunjincheng121
Copy link
Member Author

sunjincheng121 commented May 31, 2017

I once again seriously consider the Refactoring work, according to the following principles updated the PR.

   First, the test type and purpose(4 types):

  • Unit Test: to ensure the correctness of the most granular features
  • StringExpression Test: Verify the consistency of java and scalaAPI
  • Validation Test: Check the API exception information
  • Integration Test: Integration testing, verifying runtime and end-to-end correctness

   Second, the directory structure(folders) and purpose:
  
  The TEST directory contains all the paths (folders) of the SRC directory - the functional tests included three type test case (Unit Test, StringExpression Test,Validation Test)
   Note: runtime directory contains both runtime (Unit Test, StringExpression Test,Validation Test), and All table API/SQL Integration Test.

   Third, the file name naming convention:

  • Unit Test -> functionName + Test
  • StringExpression Test -> functionName + StringExpressionTest
  • Validation Test -> functionName + ValidationTest
  • Integration Test -> FunctionName + ITCase

After the change of the directory structure, as shown below:

image

@twalthr @fhueske @wuchong The change is big, so I need your help to ensure that the direction of change is correct.

Best,
SunJincheng

@wuchong
Copy link
Member

wuchong commented May 31, 2017

Hi @sunjincheng121 , thanks for your great work. I like your proposal. The test structure refactoring looks good to me. I think it's good to put all the IT cases in one place.

@sunjincheng121 sunjincheng121 force-pushed the FLINK-6617-PR branch 2 times, most recently from f4ea048 to 30093e3 Compare June 1, 2017 04:51
@sunjincheng121
Copy link
Member Author

Hi @wuchong Thanks for your approval.
In addition to refactoring the test structure, I think that in addition to ITCast other tests should be unified use of batchTestUtil and streamTestUtil. What do you think? @wuchong @twalthr @fhueske

@sunjincheng121 sunjincheng121 force-pushed the FLINK-6617-PR branch 4 times, most recently from fc4ba3b to c09594a Compare June 4, 2017 23:50
@sunjincheng121
Copy link
Member Author

Rebase code...

@sunjincheng121
Copy link
Member Author

May be I need split this PR into a couple of small PRs. What do you think? or have any other suggestions @fhueske @wuchong @twalthr

@fhueske
Copy link
Contributor

fhueske commented Jun 21, 2017

I think that is a very good idea. A review of a +6k -4k LOC PR takes a lot of time and has a good chance to be interrupted by other issues. Several smaller PRs would be much easier to review and merge.
It would be great if you could do that @sunjincheng121.

Thank you very much!

@twalthr
Copy link
Contributor

twalthr commented Jun 26, 2017

@sunjincheng121 the structure looks very good. I would volunteer to go over the changes as a whole and merge this. If @fhueske @wuchong are fine with this? Can you rebase the PR a last time?

@wuchong
Copy link
Member

wuchong commented Jun 26, 2017

Thanks @twalthr , I'm fine with this ,a great +1!

@fhueske
Copy link
Contributor

fhueske commented Jun 26, 2017

@twalthr, sure! Thanks for taking care of this PR.

@sunjincheng121
Copy link
Member Author

@twalthr Extremely grateful If you can review and merge this PR after I rebase the PR.

@sunjincheng121
Copy link
Member Author

@twalthr I have rebase the PR. I appreciated if you can review it. And i'll quick updated it when you left comments.

Thanks,
SunJincheng

@sunjincheng121
Copy link
Member Author

Update again. Because the new merged code.

@twalthr
Copy link
Contributor

twalthr commented Jun 30, 2017

Thanks for the update @sunjincheng121. I will go over all changes and try to merge this.

@sunjincheng121
Copy link
Member Author

Thanks @twalthr ! I have rebased the code and updated the PR.

Thanks,
SunJincheng

@sunjincheng121
Copy link
Member Author

Rebase code according master.

@twalthr
Copy link
Contributor

twalthr commented Jul 11, 2017

@wuchong @sunjincheng121 @fhueske

I tried to simplify the package structure a little bit. I based my changes on top of this PRs commit.

My goals:

  • splitting a class like (ExpressionReductionTest) in 6 classes is not very helpful
  • tests are named like the operator or feature that they are testing e.g. Calc, Distinct etc. (we don't need CastingITCase, CalcITCase, ScalarFunctionITCase; CalcITCase covers everything)
  • all tests have the same name everywhere (OverWindowTest, OverWindowValidationTest, OverWindowITCase, OverWindowStringExpressionTest)
  • no packages with one class
  • org.apache.flink.table.api contains all tests that test the translation from batch/stream/table/sql APIs
  • org.apache.flink.table.plan contains all tests that modify the plan
  • org.apache.flink.table.runtime contains all ITCases and runtime relevant tests
  • all other package contain unit tests for the classes of the same package

You can find my branch here: master...twalthr:FLINK-6617

@fhueske
Copy link
Contributor

fhueske commented Jul 11, 2017

Hi @twalthr and @sunjincheng121, I looked over the package structure and naming of the tests and this looks good to me.

+1 to merge from my side.

@sunjincheng121
Copy link
Member Author

Hi @twalthr @fhueske thanks a lot for your review.
@twalthr your improve changes are make the structure of the package is clearer which make sense to me.

+1 to merge.

@twalthr
Copy link
Contributor

twalthr commented Jul 13, 2017

Merging...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants