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

*: support generate the test coverage file and using it in ci #7991

Merged
merged 3 commits into from
May 17, 2024

Conversation

HuSharp
Copy link
Member

@HuSharp HuSharp commented Mar 27, 2024

What problem does this PR solve?

Issue Number: Ref #7969

need merge https://github.com/ti-community-infra/configs/pull/1048/files firstly

What is changed and how does it work?

add coverprofile for pd-ut

$ ./bin/pd-ut run pkg/audit --coverprofile xxx
2024/03/27 17:37:18 maxprocs: Leaving GOMAXPROCS=8: CPU quota undefined
building task finish, parallelism=16, count=3, takes=2.976902167s
run all tasks takes 1.032669083s
support_coverprofile* $ cat xxx
mode: set
github.com/tikv/pd/pkg/audit/audit.go:44.58,45.37 1 1
github.com/tikv/pd/pkg/audit/audit.go:45.37,46.29 1 1
github.com/tikv/pd/pkg/audit/audit.go:46.29,48.4 1 1
github.com/tikv/pd/pkg/audit/audit.go:50.2,50.14 1 1
github.com/tikv/pd/pkg/audit/audit.go:59.48,61.2 1 0
github.com/tikv/pd/pkg/audit/audit.go:83.96,89.2 1 1
github.com/tikv/pd/pkg/audit/audit.go:92.81,94.9 2 1
github.com/tikv/pd/pkg/audit/audit.go:94.9,96.3 1 0
github.com/tikv/pd/pkg/audit/audit.go:97.2,98.9 2 1
github.com/tikv/pd/pkg/audit/audit.go:98.9,100.3 1 1
github.com/tikv/pd/pkg/audit/audit.go:101.2,102.13 2 1
github.com/tikv/pd/pkg/audit/audit.go:113.46,118.2 1 1
github.com/tikv/pd/pkg/audit/audit.go:121.68,123.9 2 1
github.com/tikv/pd/pkg/audit/audit.go:123.9,125.3 1 1
github.com/tikv/pd/pkg/audit/audit.go:126.2,127.13 2 1
support_coverprofile* $ go tool cover --func=xxx
github.com/tikv/pd/pkg/audit/audit.go:44:       Match                           100.0%
github.com/tikv/pd/pkg/audit/audit.go:59:       ProcessBeforeHandler            0.0%
github.com/tikv/pd/pkg/audit/audit.go:83:       NewPrometheusHistogramBackend   100.0%
github.com/tikv/pd/pkg/audit/audit.go:92:       ProcessHTTPRequest              87.5%
github.com/tikv/pd/pkg/audit/audit.go:113:      NewLocalLogBackend              100.0%
github.com/tikv/pd/pkg/audit/audit.go:121:      ProcessHTTPRequest              100.0%
total:                                          (statements)                    90.0%

integrate ci unit tests job

advantage:

  • now: run 2 chunks each 5min
  • before: run 10 chunks each 5min

now
image

before
image

Check List

Tests

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

Release note

None.

Copy link
Contributor

ti-chi-bot bot commented Mar 27, 2024

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • nolouch

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.

Copy link
Contributor

ti-chi-bot bot commented Mar 27, 2024

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@ti-chi-bot ti-chi-bot bot added release-note-none Denotes a PR that doesn't merit a release note. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Mar 27, 2024
@ti-chi-bot ti-chi-bot bot requested review from JmPotato and rleungx March 27, 2024 09:02
@HuSharp HuSharp force-pushed the support_coverprofile branch 2 times, most recently from 678e18e to e2580be Compare March 27, 2024 09:20
Copy link

codecov bot commented Mar 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 77.42%. Comparing base (644e904) to head (689f323).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7991      +/-   ##
==========================================
+ Coverage   77.40%   77.42%   +0.01%     
==========================================
  Files         471      471              
  Lines       61387    61387              
==========================================
+ Hits        47516    47526      +10     
+ Misses      10309    10305       -4     
+ Partials     3562     3556       -6     
Flag Coverage Δ
unittests 77.42% <ø> (+0.01%) ⬆️

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

@HuSharp HuSharp force-pushed the support_coverprofile branch 2 times, most recently from 7320033 to d4c26cb Compare March 27, 2024 09:27
@HuSharp HuSharp mentioned this pull request Mar 27, 2024
@HuSharp HuSharp force-pushed the support_coverprofile branch 15 times, most recently from 2c16f62 to f666fdc Compare April 3, 2024 08:58
@ti-chi-bot ti-chi-bot bot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Apr 17, 2024
@ti-chi-bot ti-chi-bot bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels May 14, 2024
Signed-off-by: husharp <[email protected]>
@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 May 14, 2024
Signed-off-by: husharp <[email protected]>
Copy link
Contributor

@nolouch nolouch left a comment

Choose a reason for hiding this comment

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

lgtm

@ti-chi-bot ti-chi-bot bot added the status/LGT1 Indicates that a PR has LGTM 1. label May 17, 2024
@nolouch nolouch added the require-LGT1 Indicates that the PR requires an LGTM. label May 17, 2024
@HuSharp
Copy link
Member Author

HuSharp commented May 17, 2024

/hold

@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 May 17, 2024
@HuSharp
Copy link
Member Author

HuSharp commented May 17, 2024

need to merge ti-community-infra/configs#1048 firstly

@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 May 17, 2024
@HuSharp
Copy link
Member Author

HuSharp commented May 17, 2024

/hold
wait for bot update, about 30 minutes

@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 May 17, 2024
@HuSharp
Copy link
Member Author

HuSharp commented May 17, 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 May 17, 2024
@HuSharp
Copy link
Member Author

HuSharp commented May 17, 2024

/merge

Copy link
Contributor

ti-chi-bot bot commented May 17, 2024

@HuSharp: 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.

Copy link
Contributor

ti-chi-bot bot commented May 17, 2024

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

Commit hash: 689f323

@ti-chi-bot ti-chi-bot bot added the status/can-merge Indicates a PR has been approved by a committer. label May 17, 2024
@ti-chi-bot ti-chi-bot bot merged commit 4477285 into tikv:master May 17, 2024
19 checks passed
@HuSharp HuSharp deleted the support_coverprofile branch May 17, 2024 08:17
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. require-LGT1 Indicates that the PR requires an LGTM. 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/LGT1 Indicates that a PR has LGTM 1.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants