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

executor_test: improve show full processlist tests #5222

Merged
merged 8 commits into from Nov 27, 2017
Merged

executor_test: improve show full processlist tests #5222

merged 8 commits into from Nov 27, 2017

Conversation

darren
Copy link
Contributor

@darren darren commented Nov 25, 2017

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

@sre-bot
Copy link
Contributor

sre-bot commented Nov 25, 2017

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.

@shenli
Copy link
Member

shenli commented Nov 26, 2017

@darren Thanks!

@shenli
Copy link
Member

shenli commented Nov 26, 2017

/ok-to-test

@shenli
Copy link
Member

shenli commented Nov 26, 2017

/run-all-tests

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

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))

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

func (res *Result) CheckAt(cols []int, expected [][]interface{}) {
var rows [][]string
for i := range res.rows {
var row []string
Copy link
Member

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))

@winoros winoros changed the title improve show full processlist tests executor_test: improve show full processlist tests Nov 27, 2017
@shenli
Copy link
Member

shenli commented Nov 27, 2017

LGTM

@winoros winoros added contribution This PR is from a community contributor. status/LGT1 Indicates that a PR has LGTM 1. labels Nov 27, 2017
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")
Copy link
Contributor

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 ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

@tiancaiamao
Copy link
Contributor

LGTM

@tiancaiamao tiancaiamao merged commit 4f91997 into pingcap:master Nov 27, 2017
@darren darren deleted the fix-show-test-id-dependency branch November 27, 2017 13:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contribution This PR is from a community contributor. status/LGT1 Indicates that a PR has LGTM 1.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants