-
Notifications
You must be signed in to change notification settings - Fork 411
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
Refine function test framework #4861
Refine function test framework #4861
Conversation
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
0c6e6a4
to
5c7eeb6
Compare
/run-all-tests |
1 similar comment
/run-all-tests |
Coverage for changed files
Coverage summary
full coverage report (for internal network access only) |
/run-all-tests |
Coverage for changed files
Coverage summary
full coverage report (for internal network access only) |
3f9f33a
to
c66539b
Compare
There are many changes to the gtest case. |
Ok, add the main changes of unit test in issue description. |
how about making raw_function_test be true by default and just fix |
Signed-off-by: xufei <[email protected]>
…r/tiflash into refine_function_test_framework
Co-authored-by: SeaRise <[email protected]>
Signed-off-by: xufei <[email protected]>
…r/tiflash into refine_function_test_framework
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.
other LGTM
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.
LGTM
Co-authored-by: SeaRise <[email protected]>
Co-authored-by: SeaRise <[email protected]>
/merge |
@windtalker: It seems you want to merge this PR, I will help you trigger all the tests: /run-all-tests You only need to trigger If you have any questions about the PR merge process, please refer to pr process. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository. |
This pull request has been accepted and is ready to merge. Commit hash: 1b0239d
|
Signed-off-by: xufei <[email protected]>
…r/tiflash into refine_function_test_framework
/merge |
@windtalker: It seems you want to merge this PR, I will help you trigger all the tests: /run-all-tests You only need to trigger If you have any questions about the PR merge process, please refer to pr process. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository. |
This pull request has been accepted and is ready to merge. Commit hash: 5e81690
|
Coverage for changed files
Coverage summary
full coverage report (for internal network access only) |
What problem does this PR solve?
Issue Number: close #4830
Problem Summary:
We have a function test framework used by unit test of functions, however, the current implementation of the test framework use the following code to test the function:
This is not the same in the real world when we executing functions, in the real world, we first build the function:
Then execute the function later. When building the function, we may rewrite functions, take
ifNull(col1, col2)
for example, we rewrite it tomultiIf(isNull(col1), col2, assumeNotNull(col1))
Current function test framework does not take this rewrite into account, it will either testing
ifNull(col1, col2)
by executingifNull(col1, col2)
directly, or rewrite it manually. Both solutions can't guarantee the testing logic is the same as the real world executing logic, which makes function unit test meaningless for functions that will be rewritten duringbuildFunction
.(#4829 is an example that we already add ut forifNull
, but not catch the real world bug)What is changed and how it works?
raw_function_test
inFunctionTest::executeFunction
, and ifraw_function_test == true
, will use the original way to test function, otherwise, will convert columns into TiPB expr first, then test the function afterDAGExpressionAnalyzerHelper::buildFunction
,raw_function_test
is true by defaultCheck List
Tests
Side effects
Documentation
Release note