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_test: improve show full processlist tests #5222
executor_test: improve show full processlist tests #5222
Conversation
Hi contributor, thanks for your PR. This patch needs to be approved by someone of admins. They should reply with "/ok-to-test" to accept this PR for running test automatically. |
@darren Thanks! |
/ok-to-test |
/run-all-tests |
util/testkit/testkit.go
Outdated
@@ -48,6 +48,21 @@ func (res *Result) Check(expected [][]interface{}) { | |||
res.c.Assert(got, check.Equals, need, res.comment) | |||
} | |||
|
|||
// CheckAt asserts the result of selected columns equals the expected results. | |||
func (res *Result) CheckAt(cols []int, expected [][]interface{}) { | |||
var rows [][]string |
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.
rows := make([][]string, 0, len(expected))
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.
done
util/testkit/testkit.go
Outdated
func (res *Result) CheckAt(cols []int, expected [][]interface{}) { | ||
var rows [][]string | ||
for i := range res.rows { | ||
var row []string |
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.
row := make([]string, 0, len(cols))
LGTM |
util/testkit/testkit.go
Outdated
func (res *Result) CheckAt(cols []int, expected [][]interface{}) { | ||
for _, e := range expected { | ||
if len(cols) != len(e) { | ||
panic("lens of cols and expected cols should be equal") |
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.
why use panic here but not res.c.Assert ?
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
LGTM |
test cases added in PR #4739 hardcoded query id, it brings some trouble that each time new test cases added like in #5158 and #5210 we have to modify the hardcoded query id.
This PR fixes this.
@shenli @mccxj