-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
executor/cte_test.go: migrate test-infra to testify #27103
Conversation
Signed-off-by: unconsolable <[email protected]>
Signed-off-by: unconsolable <[email protected]>
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
Signed-off-by: unconsolable <[email protected]>
…oDisk Signed-off-by: unconsolable <[email protected]>
Signed-off-by: unconsolable <[email protected]>
/run-all-tests |
/cc @tisonkun PTAL |
@unconsolable: GitHub didn't allow me to request PR reviews from the following users: PTAL. Note that only pingcap members and repo collaborators can review this PR, and authors cannot review their own PRs. In response to this:
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/test-infra repository. |
/run-check_release_note |
/build |
/uncc @tisonkun |
@unconsolable: GitHub didn't allow me to request PR reviews from the following users: mmyj. Note that only pingcap members and repo collaborators can review this PR, and authors cannot review their own PRs. In response to this:
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/test-infra repository. |
Signed-off-by: unconsolable <[email protected]>
executor/cte_test.go
Outdated
|
||
"github.com/pingcap/tidb/domain" | ||
"github.com/pingcap/tidb/kv" | ||
"github.com/pingcap/tidb/session" | ||
"github.com/pingcap/tidb/sessionctx" | ||
"github.com/stretchr/testify/require" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove this empty line and format the imports.
executor/cte_test.go
Outdated
cteTestSuite = SetUpSuite(t) | ||
defer cteTestSuite.close() | ||
|
||
t.Run("TestBasicCTE", BasicCTE) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO, we don't need the global variable cteTestSuite
and all subtests can be paralleled, e.g.
func TestBasicCTE(t *testing.T) {
t.Parallel()
cteTestSuite := SetUpSuite(t)
defer cteTestSuite.close()
tk := testkit.NewTestKit(t, cteTestSuite.store)
tk.MustExec("use test")
...
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In #26712 , it is pointed out that
In the past, one test suite create one store/domain.
If after the refactor, each test case create one store/domain, the operation is heavier than before...
session.BootstrapSession is not cheap.
So it might be better to create the suite only once, but a global variable is introduced.
If you think it is unnecessary, I will remove it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So it might be better to create the suite only once
seems reasonable.
I think remove the global variable is better, we can create cteTestSuite
once and pass it to subtest as an argument.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed. Could you please take a look ?
/merge |
This pull request has been accepted and is ready to merge. Commit hash: a9e298f
|
/run-check_dev_2 |
/run-check_dev_2 |
/hold |
/merge cancel |
@zhouqiang-cl: In response to this:
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. |
/run-check_dev_2 |
/unhold |
/hold |
/run-unit-test |
/run-check_dev_2 |
/unhold |
What problem does this PR solve?
Issue Number: close #27097
Problem Summary:
What is changed and how it works?
What's Changed:
executor/cte_test.go
Release note