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

meta/autoid: migrate test-infra to testify #26774

Closed
wants to merge 6 commits into from

Conversation

unconsolable
Copy link
Contributor

Signed-off-by: unconsolable chenzhipeng2012@gmail.com

What problem does this PR solve?

Issue Number: close #26741

Release note

None

Signed-off-by: unconsolable <chenzhipeng2012@gmail.com>
@ti-chi-bot
Copy link
Member

[REVIEW NOTIFICATION]

This pull request has not been approved.

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 release-note-none Denotes a PR that doesn't merit a release note. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Aug 1, 2021
@unconsolable
Copy link
Contributor Author

/cc @tisonkun

@tisonkun
Copy link
Contributor

tisonkun commented Aug 2, 2021

/run-check_dev_2

@tisonkun
Copy link
Contributor

tisonkun commented Aug 2, 2021

Thanks for your contribution @unconsolable ! I'll review this PR tomorrow.

When I first come to autoid, I think it is somehow too large to understand. Is it possible to spilt tests into smaller set (file)?

By the way, you may take a look at the implementation of autoid which handle almost all id generation logic. There is a long lasting PR #20708 about this module. I don't ask for your extra working but suggest you can dig into TiDB in this direction.

@unconsolable
Copy link
Contributor Author

When I first come to autoid, I think it is somehow too large to understand. Is it possible to spilt tests into smaller set (file)?

I think it may split in three parts: rowid tests, bench tests, sequence id tests, but there are about 600 lines about rowid tests, maybe it is still quite large.

There is a long lasting PR #20708 about this module. I don't ask for your extra working but suggest you can dig into TiDB in this direction.

If I try to do that, should I need to refer to TiDB Source Code Reading Series & some database courses such as 15-445?

Copy link
Contributor

@tisonkun tisonkun left a comment

Choose a reason for hiding this comment

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

Comments inline. autoid_test.go looks too large.

"github.com/pingcap/tidb/meta/autoid"
"github.com/pingcap/tidb/store/mockstore"
"github.com/pingcap/tidb/types"
Copy link
Contributor

Choose a reason for hiding this comment

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

why change this import?

Copy link
Contributor Author

@unconsolable unconsolable Aug 3, 2021

Choose a reason for hiding this comment

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

This error may be related to vscode package matching, I will fix it.

"github.com/pingcap/errors"
"github.com/pingcap/failpoint"
"github.com/pingcap/parser/model"
"github.com/pingcap/tidb/kv"
"github.com/pingcap/tidb/meta"
"github.com/pingcap/tidb/meta/autoid"
"github.com/pingcap/tidb/store/mockstore"
"github.com/stretchr/testify/require"
)

func TestT(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

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

You should find a better name instead of TestT. And may try to separate tests as small as possible, may in different files.

@ti-chi-bot
Copy link
Member

@tisonkun: Request changes is only allowed for the reviewers in list.

In response to this:

Comments inline. autoid_test.go looks too large.

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.

@tisonkun
Copy link
Contributor

tisonkun commented Aug 3, 2021

There is a long lasting PR #20708 about this module. I don't ask for your extra working but suggest you can dig into TiDB in this direction.

If I try to do that, should I need to refer to TiDB Source Code Reading Series & some database courses such as 15-445?

You can but it may be too far to the real issue. I suggest you contact with @tangenta in the PR to see what you can supersede.

@unconsolable
Copy link
Contributor Author

/run-check_dev_2

Copy link
Contributor

@tisonkun tisonkun left a comment

Choose a reason for hiding this comment

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

CI failed. Please take a look

@unconsolable
Copy link
Contributor Author

/run-check_dev_2

@tisonkun
Copy link
Contributor

tisonkun commented Aug 3, 2021

/run-check_dev_2

You may first comment the cause of failure in the PR and analyze, rather than just rerun...

@unconsolable
Copy link
Contributor Author

You may first comment the cause of failure in the PR and analyze, rather than just rerun...

But ci fails at other tests instead of meta/autoid.... I guess this is related to the file split, I remove the split and it pass, then I try another split method....

@tisonkun
Copy link
Contributor

tisonkun commented Aug 3, 2021

I'd suggest you test locally first, and try to split tests in a well formatted commit #26771 (comment).

In current form of this PR it is still thousands of lines to review.

Here is an example how to break diff into meaningful commits that helps on reviewing. https://github.com/apache/flink/pull/9832/commits

@unconsolable
Copy link
Contributor Author

I'd suggest you test locally first, and try to split tests in a well formatted commit #26771 (comment).

In current form of this PR it is still thousands of lines to review.

Here is an example how to break diff into meaningful commits that helps on reviewing. https://github.com/apache/flink/pull/9832/commits

Got it, I will close this PR and switch to this way, thank you.

@unconsolable unconsolable deleted the issue-26741 branch August 3, 2021 09:52
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. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

migrate test-infra to testify for meta/autoid pkg
3 participants