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

Test: RandomGenColumns #5743

Merged
merged 8 commits into from
Sep 2, 2022
Merged

Test: RandomGenColumns #5743

merged 8 commits into from
Sep 2, 2022

Conversation

ywqzzy
Copy link
Contributor

@ywqzzy ywqzzy commented Aug 31, 2022

What problem does this PR solve?

Issue Number: ref #4609

Problem Summary:

What is changed and how it works?

Generate different type of columns with different size, can be used in further micro bench of compute engine.

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Documentation

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Changes MySQL compatibility

Release note

None

@ti-chi-bot
Copy link
Member

ti-chi-bot commented Aug 31, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • Lloyd-Pottiger
  • SeaRise

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

The full list of commands accepted by this bot can be found here.

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@ti-chi-bot ti-chi-bot added do-not-merge/needs-linked-issue do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. release-note-none Denotes a PR that doesn't merit a release note. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Aug 31, 2022
dbms/src/TestUtils/ColumnGenerator.h Outdated Show resolved Hide resolved
dbms/src/TestUtils/ColumnGenerator.cpp Outdated Show resolved Hide resolved
dbms/src/TestUtils/ColumnGenerator.cpp Show resolved Hide resolved
@ywqzzy ywqzzy marked this pull request as ready for review August 31, 2022 09:39
@ti-chi-bot ti-chi-bot removed do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. do-not-merge/needs-linked-issue labels Aug 31, 2022
@ywqzzy ywqzzy changed the title [DNM] Test: RandomGenColumns Test: RandomGenColumns Aug 31, 2022
@ywqzzy
Copy link
Contributor Author

ywqzzy commented Aug 31, 2022

/rebuild

@ywqzzy
Copy link
Contributor Author

ywqzzy commented Aug 31, 2022

/run-all-tests

@sre-bot
Copy link
Collaborator

sre-bot commented Aug 31, 2022

Coverage for changed files

Filename                             Regions    Missed Regions     Cover   Functions  Missed Functions  Executed       Lines      Missed Lines     Cover    Branches   Missed Branches     Cover
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
ColumnGenerator.cpp                       71                 2    97.18%          17                 0   100.00%         117                 7    94.02%          42                 3    92.86%
tests/gtest_column_generator.cpp          13                 7    46.15%           1                 0   100.00%          10                 0   100.00%           8                 4    50.00%
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                                     84                 9    89.29%          18                 0   100.00%         127                 7    94.49%          50                 7    86.00%

Coverage summary

Functions  MissedFunctions  Executed  Lines   MissedLines  Cover
18493      8319             55.02%    213856  85895        59.84%

full coverage report (for internal network access only)

@ywqzzy
Copy link
Contributor Author

ywqzzy commented Sep 1, 2022

/run-all-tests

@sre-bot
Copy link
Collaborator

sre-bot commented Sep 1, 2022

Coverage for changed files

Filename                             Regions    Missed Regions     Cover   Functions  Missed Functions  Executed       Lines      Missed Lines     Cover    Branches   Missed Branches     Cover
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
ColumnGenerator.cpp                       89                 2    97.75%          17                 0   100.00%         133                 7    94.74%          54                 3    94.44%
tests/gtest_column_generator.cpp          13                 7    46.15%           1                 0   100.00%          10                 0   100.00%           8                 4    50.00%
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                                    102                 9    91.18%          18                 0   100.00%         143                 7    95.10%          62                 7    88.71%

Coverage summary

Functions  MissedFunctions  Executed  Lines   MissedLines  Cover
18551      8327             55.11%    214400  85922        59.92%

full coverage report (for internal network access only)

dbms/src/TestUtils/ColumnGenerator.cpp Show resolved Hide resolved
namespace tests
{

TEST(TestColumnGenerator, run)
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 there is no need to test

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think there is no need to test

Maybe it will be used in the future. The code is not used in the project, so I just use the test to ensure that the function will not crash

Copy link
Contributor

Choose a reason for hiding this comment

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

There is no need to consider a lot for "future". The logical of this case is simple, local test is enough. Unit test give pressure to ci.

@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Sep 1, 2022
@Lloyd-Pottiger Lloyd-Pottiger removed the status/LGT1 Indicates that a PR has LGTM 1. label Sep 1, 2022
@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Sep 1, 2022
@Lloyd-Pottiger Lloyd-Pottiger removed the status/LGT1 Indicates that a PR has LGTM 1. label Sep 1, 2022
@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Sep 1, 2022
Comment on lines 32 to 66
if (family_name == "Int8" || family_name == "Int16" || family_name == "Int32" || family_name == "Int64")
{
for (size_t i = 0; i < opts.size; ++i)
genInt(col);
}
else if (family_name == "UInt8" || family_name == "UInt16" || family_name == "UInt32" || family_name == "UInt64")
{
for (size_t i = 0; i < opts.size; ++i)
genUInt(col);
}
else if (family_name == "Float32" || family_name == "Float64")
{
for (size_t i = 0; i < opts.size; ++i)
genFloat(col);
}
else if (family_name == "String")
{
for (size_t i = 0; i < opts.size; ++i)
genString(col);
}
else if (family_name == "MyDateTime")
{
for (size_t i = 0; i < opts.size; ++i)
genDateTime(col);
}
else if (family_name == "MyDate")
{
for (size_t i = 0; i < opts.size; ++i)
genDate(col);
}
else if (family_name == "Decimal")
{
for (size_t i = 0; i < opts.size; ++i)
genDecimal(col, type);
}
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 use TypeIndex::xxxx

Comment on lines 77 to 78
res.column = std::move(col);
return res;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
res.column = std::move(col);
return res;
return {col, type};

@ti-chi-bot ti-chi-bot added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Sep 1, 2022
Copy link
Contributor

@xzhangxian1008 xzhangxian1008 left a comment

Choose a reason for hiding this comment

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

Other LGTM

dbms/src/TestUtils/ColumnGenerator.h Show resolved Hide resolved
@ywqzzy
Copy link
Contributor Author

ywqzzy commented Sep 2, 2022

/merge

@ti-chi-bot
Copy link
Member

@ywqzzy: It seems you want to merge this PR, I will help you trigger all the tests:

/run-all-tests

You only need to trigger /merge once, and if the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes.

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.

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

Commit hash: f11b35a

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Sep 2, 2022
@sre-bot
Copy link
Collaborator

sre-bot commented Sep 2, 2022

Coverage for changed files

Filename                                       Regions    Missed Regions     Cover   Functions  Missed Functions  Executed       Lines      Missed Lines     Cover    Branches   Missed Branches     Cover
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Core/ColumnWithTypeAndName.h                         4                 0   100.00%           4                 0   100.00%           4                 0   100.00%           0                 0         -
TestUtils/ColumnGenerator.cpp                       74                 3    95.95%          17                 0   100.00%         140                 9    93.57%          62                 4    93.55%
TestUtils/tests/gtest_column_generator.cpp          13                 7    46.15%           1                 0   100.00%          10                 0   100.00%           8                 4    50.00%
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                                               91                10    89.01%          22                 0   100.00%         154                 9    94.16%          70                 8    88.57%

Coverage summary

Functions  MissedFunctions  Executed  Lines   MissedLines  Cover
18588      8334             55.16%    214682  85866        60.00%

full coverage report (for internal network access only)

@ti-chi-bot ti-chi-bot merged commit ade4325 into pingcap:master Sep 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-note-none Denotes a PR that doesn't merit a release note. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants