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.go: replace path with filepath #55122

Merged
merged 3 commits into from
Aug 8, 2024

Conversation

HuSharp
Copy link
Contributor

@HuSharp HuSharp commented Aug 1, 2024

What problem does this PR solve?

filepath.Join is platform dependent and joins paths based on the operating system's path separator (e.g., \ on Windows and / on Unix).
path.Join is platform-independent and always uses / as the path separator.

Issue Number: Ref #30822

Problem Summary:

What changed and how does it work?

Check List

Tests

  • Unit test

Release note

Please refer to Release Notes Language Style Guide to write a quality release note.

None

Signed-off-by: husharp <jinhao.hu@pingcap.com>
@ti-chi-bot ti-chi-bot bot added release-note-none Denotes a PR that doesn't merit a release note. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Aug 1, 2024
Copy link

tiprow bot commented Aug 1, 2024

Hi @HuSharp. Thanks for your PR.

PRs from untrusted users cannot be marked as trusted with /ok-to-test in this repo meaning untrusted PR authors can never trigger tests themselves. Collaborators can still trigger tests on the PR using /test all.

I understand the commands that are listed here.

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-sigs/prow repository.

@HuSharp
Copy link
Contributor Author

HuSharp commented Aug 1, 2024

@Defined2014 @tangenta PTAL, thx!

@@ -902,7 +901,7 @@ func generateBuildCache() error {
cmd := exec.Command("go", "test", "-tags=intest", "-exec=true", "-vet=off")
goCompileWithoutLink := fmt.Sprintf("-toolexec=%s/tools/check/go-compile-without-link.sh", workDir)
cmd.Args = append(cmd.Args, goCompileWithoutLink)
cmd.Dir = path.Join(workDir, "cmd/tidb-server")
cmd.Dir = filepath.Join(workDir, "cmd/tidb-server")
Copy link
Contributor

Choose a reason for hiding this comment

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

If we consider different operating systems, dose cmd/tidb-server also need to be changed?

tools/check/ut.go Outdated Show resolved Hide resolved
Copy link

codecov bot commented Aug 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 75.0517%. Comparing base (b5555c3) to head (286d680).
Report is 60 commits behind head on master.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #55122        +/-   ##
================================================
+ Coverage   74.7109%   75.0517%   +0.3408%     
================================================
  Files          1563       1572         +9     
  Lines        364517     454986     +90469     
================================================
+ Hits         272334     341475     +69141     
- Misses        72402      92704     +20302     
- Partials      19781      20807      +1026     
Flag Coverage Δ
integration 49.4814% <ø> (?)
unit 71.7435% <ø> (-1.8420%) ⬇️

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

Components Coverage Δ
dumpling 52.9567% <ø> (-2.2327%) ⬇️
parser ∅ <ø> (∅)
br 51.8045% <ø> (+4.0978%) ⬆️

Signed-off-by: husharp <ihusharp@gmail.com>
@ti-chi-bot ti-chi-bot bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Aug 6, 2024
@ti-chi-bot ti-chi-bot bot added approved needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Aug 6, 2024
Signed-off-by: husharp <ihusharp@gmail.com>
Copy link

ti-chi-bot bot commented Aug 8, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Defined2014, tangenta

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:
  • OWNERS [Defined2014,tangenta]

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

@ti-chi-bot ti-chi-bot bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Aug 8, 2024
Copy link

ti-chi-bot bot commented Aug 8, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-08-06 10:00:17.260806337 +0000 UTC m=+346147.127905420: ☑️ agreed by Defined2014.
  • 2024-08-08 07:34:31.06779817 +0000 UTC m=+510200.934897258: ☑️ agreed by tangenta.

Copy link

tiprow bot commented Aug 8, 2024

@HuSharp: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
fast_test_tiprow 286d680 link true /test fast_test_tiprow

Full PR test history. Your PR dashboard.

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-sigs/prow repository. I understand the commands that are listed here.

@ti-chi-bot ti-chi-bot bot merged commit 4cfc182 into pingcap:master Aug 8, 2024
22 of 23 checks passed
@HuSharp HuSharp deleted the replace-path branch August 8, 2024 08:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm release-note-none Denotes a PR that doesn't merit a release note. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants