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

checker: migrate test framework to testify #5174

Merged
merged 5 commits into from
Jun 20, 2022

Conversation

rleungx
Copy link
Member

@rleungx rleungx commented Jun 17, 2022

Signed-off-by: Ryan Leung rleungx@gmail.com

What problem does this PR solve?

Issue Number: Ref #4813.

What is changed and how does it work?

Check List

Tests

  • Unit test

Release note

None

@ti-chi-bot
Copy link
Member

ti-chi-bot commented Jun 17, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • JmPotato
  • 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 ti-chi-bot added the release-note-none Denotes a PR that doesn't merit a release note. label Jun 17, 2022
@rleungx rleungx mentioned this pull request Jun 17, 2022
85 tasks
@rleungx rleungx added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 17, 2022
Signed-off-by: Ryan Leung <rleungx@gmail.com>
@rleungx rleungx removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 17, 2022
@rleungx rleungx requested review from JmPotato and nolouch June 17, 2022 09:47
@codecov
Copy link

codecov bot commented Jun 17, 2022

Codecov Report

Merging #5174 (fe435a9) into master (cb23d6c) will increase coverage by 0.01%.
The diff coverage is 94.73%.

❗ Current head fe435a9 differs from pull request most recent head 351d380. Consider uploading reports for the commit 351d380 to get more accurate results

@@            Coverage Diff             @@
##           master    #5174      +/-   ##
==========================================
+ Coverage   75.71%   75.72%   +0.01%     
==========================================
  Files         310      310              
  Lines       30648    30686      +38     
==========================================
+ Hits        23204    23238      +34     
+ Misses       5449     5448       -1     
- Partials     1995     2000       +5     
Flag Coverage Δ
unittests 75.72% <94.73%> (+0.01%) ⬆️

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

Impacted Files Coverage Δ
pkg/testutil/operator_check.go 83.33% <94.73%> (-3.81%) ⬇️
pkg/errs/errs.go 75.00% <0.00%> (-25.00%) ⬇️
pkg/tempurl/tempurl.go 60.00% <0.00%> (-10.00%) ⬇️
...erver/config/service_middleware_persist_options.go 91.66% <0.00%> (-8.34%) ⬇️
server/tso/local_allocator.go 71.62% <0.00%> (-6.76%) ⬇️
server/election/leadership.go 75.25% <0.00%> (-3.10%) ⬇️
server/schedule/labeler/rules.go 87.50% <0.00%> (-2.28%) ⬇️
server/encryptionkm/key_manager.go 70.11% <0.00%> (-1.60%) ⬇️
server/member/member.go 62.10% <0.00%> (-1.58%) ⬇️
... and 16 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 eb2ed76...351d380. Read the comment docs.

Signed-off-by: Ryan Leung <rleungx@gmail.com>
Signed-off-by: Ryan Leung <rleungx@gmail.com>
func CheckSteps(re *require.Assertions, op *operator.Operator, steps []operator.OpStep) {
re.NotEqual(0, op.Kind()&operator.OpMerge)
re.NotNil(steps)
re.Equal(len(steps), op.Len())
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
re.Equal(len(steps), op.Len())
re.Len(steps, op.Len())


c.Assert(op.Len(), Equals, len(steps))
re.Equal(len(steps), op.Len())
Copy link
Member

Choose a reason for hiding this comment

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

Ditto.

ctx context.Context
cancel context.CancelFunc
cluster *mockcluster.Cluster
mc *MergeChecker
regions []*core.RegionInfo
}

func (s *testMergeCheckerSuite) SetUpSuite(c *C) {
s.ctx, s.cancel = context.WithCancel(context.Background())
func TestMergeCheckerSuite(t *testing.T) {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
func TestMergeCheckerSuite(t *testing.T) {
func TestMergeCheckerTestSuite(t *testing.T) {

Signed-off-by: Ryan Leung <rleungx@gmail.com>
@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Jun 20, 2022
@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 20, 2022
@nolouch
Copy link
Contributor

nolouch commented Jun 20, 2022

/merge

@ti-chi-bot
Copy link
Member

@nolouch: 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: fe435a9

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

@rleungx: 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 32bccb7 into tikv:master Jun 20, 2022
CabinfeverB pushed a commit to CabinfeverB/pd that referenced this pull request Jul 14, 2022
ref tikv#4813

Signed-off-by: Ryan Leung <rleungx@gmail.com>

Co-authored-by: Ti Chi Robot <ti-community-prow-bot@tidb.io>
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