-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
Conversation
Welcome @feitian124! |
No release note, Please follow https://github.com/pingcap/community/blob/master/contributors/release-note-checker.md |
/rebuild |
/cc @tisonkun |
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.
LGTM
@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:
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. |
util/stringutil/string_util_test.go
Outdated
x, err := Unquote(v.str) | ||
require.Equal(t, v.expect, x) | ||
if v.ok { | ||
require.Nil(t, err) |
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.
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.
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.
ok thanks, i will ehance 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.
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)
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.
I'd suggest you write "source %v" to cover the case where v=""
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.
get it
[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. |
/merge |
This pull request has been accepted and is ready to merge. Commit hash: 208b4e8
|
CI failed. Not sure if it is related. |
I think it is unrelated. But we should avoid any test failure... reopen #25691 |
Thanks for your contribution @feitian124 . I'll summon a bot to merge your PR. |
/merge |
This pull request has been accepted and is ready to merge. Commit hash: 2284ac0
|
@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. |
What problem does this PR solve?
Issue Number: close #26421
Release note