pd icon indicating copy to clipboard operation
pd copied to clipboard

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

Open HuSharp opened this issue 10 months ago • 3 comments

Signed-off-by: husharp [email protected]<!--

Thank you for working on PD! Please read PD's CONTRIBUTING document BEFORE filing this PR.

PR Title Format:

  1. pkg [, pkg2, pkg3]: what's changed
  2. *: what's changed

-->

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?

$ ./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%

Check List

Tests

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

Release note

None.

HuSharp avatar Mar 27 '24 09:03 HuSharp

[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.

ti-chi-bot[bot] avatar Mar 27 '24 09:03 ti-chi-bot[bot]

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[bot] avatar Mar 27 '24 09:03 ti-chi-bot[bot]

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

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%) :arrow_up:

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

codecov[bot] avatar Mar 27 '24 09:03 codecov[bot]

/hold

HuSharp avatar May 17 '24 06:05 HuSharp

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

HuSharp avatar May 17 '24 06:05 HuSharp

/hold wait for bot update, about 30 minutes

HuSharp avatar May 17 '24 06:05 HuSharp

/unhold

HuSharp avatar May 17 '24 07:05 HuSharp

/merge

HuSharp avatar May 17 '24 07:05 HuSharp

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

ti-chi-bot[bot] avatar May 17 '24 07:05 ti-chi-bot[bot]

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

Commit hash: 689f323de6347b7e018e54a9430c1c2d07ed6619

ti-chi-bot[bot] avatar May 17 '24 07:05 ti-chi-bot[bot]