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. DetailsReviewer 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 filesCoverage summaryfull coverage report (for internal network access only) |
|
/run-all-tests |
Coverage for changed filesCoverage summaryfull 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 <xufeixw@mail.ustc.edu.cn>
…r/tiflash into refine_function_test_framework
Co-authored-by: SeaRise <hhssearise@foxmail.com>
Signed-off-by: xufei <xufeixw@mail.ustc.edu.cn>
…r/tiflash into refine_function_test_framework
Co-authored-by: SeaRise <hhssearise@foxmail.com>
Co-authored-by: SeaRise <hhssearise@foxmail.com>
|
/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. DetailsInstructions 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. DetailsCommit hash: 1b0239d |
Signed-off-by: xufei <xufeixw@mail.ustc.edu.cn>
…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. DetailsInstructions 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. DetailsCommit hash: 5e81690 |
Coverage for changed filesCoverage summaryfull 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_testinFunctionTest::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_testis true by defaultCheck List
Tests
Side effects
Documentation
Release note