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

util/stringutil: migrate test-infra to testify #26549

Merged
merged 9 commits into from
Jul 26, 2021

Conversation

feitian124
Copy link
Contributor

@feitian124 feitian124 commented Jul 26, 2021

What problem does this PR solve?

Issue Number: close #26421

Release note

  • No release note

@CLAassistant
Copy link

CLAassistant commented Jul 26, 2021

CLA assistant check
All committers have signed the CLA.

@ti-chi-bot ti-chi-bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jul 26, 2021
@ti-chi-bot
Copy link
Member

Welcome @feitian124!

It looks like this is your first PR to pingcap/tidb 🎉.

I'm the bot to help you request reviewers, add labels and more, See available commands.

We want to make sure your contribution gets all the attention it needs!



Thank you, and welcome to pingcap/tidb. 😃

@ti-srebot
Copy link
Contributor

@feitian124
Copy link
Contributor Author

/rebuild

@feitian124
Copy link
Contributor Author

/cc @tisonkun

@ti-chi-bot ti-chi-bot requested a review from tisonkun July 26, 2021 06:22
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.

LGTM

@ti-chi-bot
Copy link
Member

@tisonkun: Thanks for your review. The bot only counts approvals from reviewers and higher roles in list, but you're still welcome to leave your comments.

In response to this:

LGTM

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 tisonkun requested review from xhebox and disksing July 26, 2021 07:13
@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Jul 26, 2021
x, err := Unquote(v.str)
require.Equal(t, v.expect, x)
if v.ok {
require.Nil(t, err)
Copy link
Contributor

@xhebox xhebox Jul 26, 2021

Choose a reason for hiding this comment

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

There is Nilf, and NotNilf, the alternative for Commentf("source %v", t.str), ditto for other comments. Comments are useful for debugging. I suggest not removing it, especially in the loop. Once it fails, you only know the line number, but you don't know where you are in the loop.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok thanks, i will ehance it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

hi, i finished the enhance, please review again.
i searched whole code repo and it seems that i am the first one to use Nilf and NotNilf function.
i manually made some test fail, seems the testfiy output is clean enough and no Nilf related comment is show on the idea terminal. not sure this is expected or not.

/usr/local/go/bin/go tool test2json -t /tmp/___TestUnquote_in_github_com_pingcap_tidb_util_stringutil.test -test.v -test.paniconexit0 -test.run ^\QTestUnquote\E$
=== RUN   TestUnquote
=== PAUSE TestUnquote
=== CONT  TestUnquote
    string_util_test.go:59: 
        	Error Trace:	string_util_test.go:59
        	Error:      	Not equal: 
        	            	expected: "abcdef"
        	            	actual  : "123abcdef"
        	            	
        	            	Diff:
        	            	--- Expected
        	            	+++ Actual
        	            	@@ -1 +1 @@
        	            	-abcdef
        	            	+123abcdef
        	Test:       	TestUnquote
--- FAIL: TestUnquote (0.00s)

Copy link
Contributor

Choose a reason for hiding this comment

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

I'd suggest you write "source %v" to cover the case where v=""

Copy link
Contributor Author

Choose a reason for hiding this comment

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

get it

@ti-chi-bot
Copy link
Member

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • disksing
  • xhebox

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 status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Jul 26, 2021
@xhebox
Copy link
Contributor

xhebox commented Jul 26, 2021

/merge

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

Commit hash: 208b4e8

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Jul 26, 2021
@disksing
Copy link
Contributor

CI failed. Not sure if it is related.

@tisonkun
Copy link
Contributor

tisonkun commented Jul 26, 2021

[2021-07-26T08:42:06.291Z]     testing.go:1092: race detected during execution of test
[2021-07-26T08:42:06.291Z] --- FAIL: TestT (15.79s)
[2021-07-26T08:42:06.291Z] === CONT  
[2021-07-26T08:42:06.291Z]     testing.go:1092: race detected during execution of test
[2021-07-26T08:42:06.291Z] FAIL
[2021-07-26T08:42:06.291Z] FAIL	github.com/pingcap/tidb/table/tables	16.026s

I think it is unrelated. But we should avoid any test failure...

reopen #25691

@ti-chi-bot ti-chi-bot removed the status/can-merge Indicates a PR has been approved by a committer. label Jul 26, 2021
@disksing
Copy link
Contributor

Thanks for your contribution @feitian124 . I'll summon a bot to merge your PR.

@disksing
Copy link
Contributor

/merge

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

Commit hash: 2284ac0

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

@feitian124: 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 7726e55 into pingcap:master Jul 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/M Denotes a PR that changes 30-99 lines, ignoring generated files. 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.

migrate test-infra to testify for util/stringutil pkg
7 participants