tikv / pd

Placement driver for TiKV
Apache License 2.0
1.03k stars 714 forks source link

test: add test for clone unmarshal #8308

Closed HuSharp closed 1 week ago

HuSharp commented 1 week ago

What problem does this PR solve?

Issue Number: Ref #4399

What is changed and how does it work?

issue relies on https://github.com/tikv/pd/pull/8301/commits/76b49327ff7842027631642ad1d3746c5b14a02a#diff-5cf563058fdae91ee59093d5721fde21b45888669570a5fdfd54bbe502ce3e03L93-L95

We have this logic for clone https://github.com/tikv/pd/blob/13174b5d4cab4d958f0b4ea2718ea7bb74992bc7/client/http/types.go#L366-L373

This is because startKey is json:"-" which means cannot be Unmarshal from json, We need to take care of Clone method. https://github.com/tikv/pd/blob/13174b5d4cab4d958f0b4ea2718ea7bb74992bc7/client/http/types.go#L346-L349

Check List

Tests

Release note

None.
HuSharp commented 1 week ago

@okJiang PTAL, thx!

codecov[bot] commented 1 week ago

Codecov Report

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

Project coverage is 77.28%. Comparing base (cb28ca8) to head (9f8de24).

:exclamation: Current head 9f8de24 differs from pull request most recent head 6f56dbc

Please upload reports for the commit 6f56dbc to get more accurate results.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #8308 +/- ## ========================================== - Coverage 77.41% 77.28% -0.14% ========================================== Files 470 470 Lines 61324 61392 +68 ========================================== - Hits 47473 47445 -28 - Misses 10287 10387 +100 + Partials 3564 3560 -4 ``` | [Flag](https://app.codecov.io/gh/tikv/pd/pull/8308/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=tikv) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/tikv/pd/pull/8308/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=tikv) | `77.28% <ø> (-0.14%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=tikv#carryforward-flags-in-the-pull-request-comment) to find out more.
ti-chi-bot[bot] commented 1 week ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: JmPotato, 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: - ~~[OWNERS](https://github.com/tikv/pd/blob/master/OWNERS)~~ [JmPotato,rleungx] 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[bot] commented 1 week ago

[LGTM Timeline notifier]

Timeline:

ti-chi-bot[bot] commented 1 week ago

@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
pull-integration-realcluster-test 6f56dbcab4e1c96e1c6ebbc5014eb4996e7e5b2c link false /test pull-integration-realcluster-test

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).