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

tools/ut: accelerate the build process and scatter test #8342

Merged
merged 4 commits into from
Jul 2, 2024

Conversation

HuSharp
Copy link
Member

@HuSharp HuSharp commented Jun 27, 2024

What problem does this PR solve?

accelerate pd-ut, for now all tests can be executed in 5min

Issue Number: Ref #7969

What is changed and how does it work?

  • enable race
  • divide unit test/tests/tso integration test into 2 parts respectively
  • accelerate the build process by concurrency
  • add junitfile in ci to indicate test time
image

check junitfile

image

Check List

Tests

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

Release note

None.

@ti-chi-bot ti-chi-bot bot added release-note-none Denotes a PR that doesn't merit a release note. dco-signoff: yes Indicates the PR's author has signed the dco. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Jun 27, 2024
@HuSharp
Copy link
Member Author

HuSharp commented Jun 27, 2024

/hold

@ti-chi-bot ti-chi-bot bot added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Jun 27, 2024
@HuSharp HuSharp changed the title tools/ut: add race for multiple build tools/ut: add one more unit test in ci Jun 27, 2024
@ti-chi-bot ti-chi-bot bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jun 27, 2024
@HuSharp HuSharp force-pushed the fix_run_race branch 6 times, most recently from d4483c3 to 033c789 Compare June 28, 2024 00:12
Signed-off-by: husharp <[email protected]>
@HuSharp
Copy link
Member Author

HuSharp commented Jun 28, 2024

/unhold

@ti-chi-bot ti-chi-bot bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 28, 2024
@HuSharp HuSharp changed the title tools/ut: add one more unit test in ci tools/ut: accelerate the build process and scatter test Jun 28, 2024
@HuSharp HuSharp requested review from lhy1024 and rleungx June 28, 2024 02:17
.github/workflows/pd-tests.yaml Outdated Show resolved Hide resolved
tests/testutil.go Outdated Show resolved Hide resolved
Signed-off-by: husharp <[email protected]>
# unit tests ignore `tests`
./bin/pd-ut run --race --ignore tests --coverprofile $ROOT_PATH_COV || exit 1
# unit tests ignore `tests`, `server`, `schedule`,`utils` and `encryption`
./bin/pd-ut run --ignore tests,server,pkg/schedule,pkg/utils,pkg/encryption --race --coverprofile $ROOT_PATH_COV --junitfile $ROOT_PATH_JUNITFILE || exit 1
Copy link
Member

Choose a reason for hiding this comment

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

What if these packages are deleted or renamed?

Copy link
Member Author

Choose a reason for hiding this comment

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

It may be necessary to manually change the code,when noticing abnormal test time/test codecov

Copy link
Member Author

Choose a reason for hiding this comment

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

  • codev can reveal missing tests
  • Redundant tests can be reacted to at test time

@ti-chi-bot ti-chi-bot bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Jun 28, 2024
@ti-chi-bot ti-chi-bot bot added the approved label Jun 28, 2024
Signed-off-by: husharp <[email protected]>
Copy link

codecov bot commented Jun 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 77.20%. Comparing base (49f9b11) to head (326091d).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #8342   +/-   ##
=======================================
  Coverage   77.20%   77.20%           
=======================================
  Files         470      470           
  Lines       61645    61651    +6     
=======================================
+ Hits        47590    47597    +7     
+ Misses      10474    10470    -4     
- Partials     3581     3584    +3     
Flag Coverage Δ
unittests 77.20% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

@wuhuizuo
Copy link
Contributor

wuhuizuo commented Jul 1, 2024

/hold
/assign @purelind
Please hold the merging with the CI updates.

ref: ti-community-infra/configs#1083

@ti-chi-bot ti-chi-bot bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 1, 2024
@ti-chi-bot ti-chi-bot bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Jul 2, 2024
Copy link
Contributor

ti-chi-bot bot commented Jul 2, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-06-28 06:31:36.79024004 +0000 UTC m=+960423.275728870: ☑️ agreed by rleungx.
  • 2024-07-02 06:57:30.950202015 +0000 UTC m=+1307577.435690842: ☑️ agreed by lhy1024.

Copy link
Contributor

@purelind purelind left a comment

Choose a reason for hiding this comment

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

/lgtm

Copy link
Contributor

ti-chi-bot bot commented Jul 2, 2024

@purelind: adding LGTM is restricted to approvers and reviewers in OWNERS files.

In response to this:

/lgtm

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 kubernetes/test-infra repository.

Copy link
Contributor

ti-chi-bot bot commented Jul 2, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: lhy1024, purelind, rleungx

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

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@HuSharp
Copy link
Member Author

HuSharp commented Jul 2, 2024

/unhold

@ti-chi-bot ti-chi-bot bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 2, 2024
@ti-chi-bot ti-chi-bot bot merged commit f9c2366 into tikv:master Jul 2, 2024
25 checks passed
@HuSharp HuSharp deleted the fix_run_race branch July 2, 2024 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved dco-signoff: yes Indicates the PR's author has signed the dco. lgtm 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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants