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

operator: migrate test framework to testify #5229

Merged
merged 6 commits into from
Jun 28, 2022
Merged

Conversation

lhy1024
Copy link
Contributor

@lhy1024 lhy1024 commented Jun 24, 2022

Signed-off-by: lhy1024 [email protected]

What problem does this PR solve?

Issue Number: Ref #4813.

Solve the remaining problems of #5206 and #5191

What is changed and how does it work?

Check List

Tests

  • Unit test

Release note

None.

@lhy1024 lhy1024 requested review from JmPotato and rleungx June 24, 2022 08:35
@ti-chi-bot
Copy link
Member

ti-chi-bot commented Jun 24, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • JmPotato
  • rleungx

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 ti-chi-bot added the release-note-none Denotes a PR that doesn't merit a release note. label Jun 24, 2022
@codecov
Copy link

codecov bot commented Jun 24, 2022

Codecov Report

Merging #5229 (27f35b8) into master (f031dc4) will increase coverage by 0.00%.
The diff coverage is n/a.

❗ Current head 27f35b8 differs from pull request most recent head 4d94162. Consider uploading reports for the commit 4d94162 to get more accurate results

@@           Coverage Diff           @@
##           master    #5229   +/-   ##
=======================================
  Coverage   75.60%   75.61%           
=======================================
  Files         310      310           
  Lines       30708    30682   -26     
=======================================
- Hits        23218    23201   -17     
+ Misses       5495     5485   -10     
- Partials     1995     1996    +1     
Flag Coverage Δ
unittests 75.61% <ø> (+<0.01%) ⬆️

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

Impacted Files Coverage Δ
server/storage/kv/etcd_kv.go 79.71% <0.00%> (-5.80%) ⬇️
server/region_syncer/server.go 83.15% <0.00%> (-4.35%) ⬇️
pkg/etcdutil/etcdutil.go 84.88% <0.00%> (-3.49%) ⬇️
client/base_client.go 79.38% <0.00%> (-2.58%) ⬇️
tools/pd-ctl/pdctl/command/operator.go 66.66% <0.00%> (-1.15%) ⬇️
server/cluster/coordinator.go 70.45% <0.00%> (-0.98%) ⬇️
server/cluster/cluster.go 83.54% <0.00%> (-0.92%) ⬇️
server/handler.go 52.58% <0.00%> (-0.39%) ⬇️
server/schedulers/hot_region.go 83.52% <0.00%> (-0.29%) ⬇️
client/client.go 68.51% <0.00%> (-0.11%) ⬇️
... and 11 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f031dc4...4d94162. Read the comment docs.

Signed-off-by: lhy1024 <[email protected]>
server/schedule/operator/create_operator_test.go Outdated Show resolved Hide resolved
server/schedule/operator/create_operator_test.go Outdated Show resolved Hide resolved
server/schedule/operator/create_operator_test.go Outdated Show resolved Hide resolved
server/schedule/operator/create_operator_test.go Outdated Show resolved Hide resolved
lhy1024 added 2 commits June 24, 2022 17:49
Signed-off-by: lhy1024 <[email protected]>
@lhy1024 lhy1024 requested review from JmPotato and rleungx June 24, 2022 10:01
Copy link
Member

@rleungx rleungx left a comment

Choose a reason for hiding this comment

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

The rest LGTM.

suite.NoError(err)
suite.Len(ops, 2)
suite.Equal(testCase.kind, ops[0].kind)
suite.Equal(len(testCase.prepareSteps)+1, ops[0].Len())
Copy link
Member

Choose a reason for hiding this comment

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

use suite.Len?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think it's unnecessary

Copy link
Member

Choose a reason for hiding this comment

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

What about:

Suggested change
suite.Equal(len(testCase.prepareSteps)+1, ops[0].Len())
suite.Len(testCase.prepareSteps, ops[0].Len()-1)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is it reasonable to call Len for expected value?

Copy link
Member

Choose a reason for hiding this comment

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

OK. You're right.

server/schedule/region_scatterer_test.go Outdated Show resolved Hide resolved
server/schedule/operator/operator_test.go Outdated Show resolved Hide resolved
server/schedule/operator/operator_test.go Outdated Show resolved Hide resolved
@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Jun 27, 2022
Signed-off-by: lhy1024 <[email protected]>
@ti-chi-bot ti-chi-bot added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Jun 28, 2022
@rleungx
Copy link
Member

rleungx commented Jun 28, 2022

/merge

@ti-chi-bot
Copy link
Member

@rleungx: It seems you want to merge this PR, I will help you trigger all the tests:

/run-all-tests

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
Copy link
Member

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

Commit hash: 27f35b8

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Jun 28, 2022
@ti-chi-bot
Copy link
Member

@lhy1024: Your PR was out of date, I have automatically updated it for you.

At the same time I will also trigger all tests for you:

/run-all-tests

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.

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 ti-chi-bot merged commit 6db8815 into tikv:master Jun 28, 2022
CabinfeverB pushed a commit to CabinfeverB/pd that referenced this pull request Jul 14, 2022
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. status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants