Skip to content
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

A more friendly way to update the unit test cases in gtest_interpreter.cpp #6676

Closed
SeaRise opened this issue Jan 26, 2023 · 0 comments · Fixed by #6689
Closed

A more friendly way to update the unit test cases in gtest_interpreter.cpp #6676

SeaRise opened this issue Jan 26, 2023 · 0 comments · Fixed by #6689
Labels
type/enhancement The issue or PR belongs to an enhancement.

Comments

@SeaRise
Copy link
Contributor

SeaRise commented Jan 26, 2023

Enhancement

The expected results of the unit test cases in the gtest_interpreter are currently handwritten in the code.
Once the expected results have changed, we have to update them using the following steps

for (auto updated_case : all_cases)
{
    1. run unit test and fail
    2. update the new expect result
}

When there are many cases to be updated, the developer will spend more time updating the cases.
Here we should try to provide some ways to simplify the time it takes to update the case.
There are two options available

  • Move the input and output of the case from gtest_interpreter.cpp to gtest_interpreter.in and gtest_interpreter.out, then provide a command to a command to update and overwrite the contents of gtest_interpreter.out base on the input of gtest_interpreter.in. Just like tidb --record
  • Provide a command to batch compare all cases in A so that the steps to update a case can be simplified to the following
1. auto all_new_expect_results = compareAll();
2. update new expect results
@SeaRise SeaRise added the type/enhancement The issue or PR belongs to an enhancement. label Jan 26, 2023
ti-chi-bot pushed a commit that referenced this issue Jan 30, 2023
ywqzzy pushed a commit to ywqzzy/tiflash_1 that referenced this issue Feb 13, 2023
close pingcap#6676

Signed-off-by: ywqzzy <592838129@qq.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/enhancement The issue or PR belongs to an enhancement.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant