-
Notifications
You must be signed in to change notification settings - Fork 288
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
test(pkg/version): migrate test-infra to testify for pkg/version pkg #2920
Conversation
[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. |
pkg/version/check_test.go
Outdated
"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.
"github.com/stretchr/testify/require" | |
"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.
??? what's the difference?
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.
@overvenus He should have meant the empty line below.
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.
oo
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's a problem adding an empty line here?
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 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.
removed blank line
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.
reset LGTM
pkg/version/check_test.go
Outdated
@@ -83,9 +76,9 @@ func (s *checkSuite) TestCheckClusterVersion(c *check.C) { | |||
if err == nil { | |||
break | |||
} | |||
c.Error(err) | |||
fmt.Fprintf(os.Stderr, "[ERROR]:%v", 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.
How about we use t.Log(f)
?
Also the original c.Error should make the case fail straight away.
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.
(1) t.Log(f) LGTM.
(2) c.Error will fail the test but not stop the test immediately. So i can't find the corresponding function in testify like c.Error. testify has fail/failnow/failf function, but they will stop the test-case directly. Any suggestions? @hi-rustin
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.
If it's all going to fail, then I see nothing wrong with ending it early. @overvenus What do you think?
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 find the testify.assert.Fail can act just like c.Error(). But the semantic of assert in testify still confuses me, cause assert means severe mismatch in C/C++.
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.
😆 Cool!
@@ -83,9 +76,9 @@ func (s *checkSuite) TestCheckClusterVersion(c *check.C) { | |||
if err == nil { | |||
break | |||
} |
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 what's the point for sleep in loop to wait? cause the retry already means fail when call c.Error()
pkg/version/check_test.go
Outdated
"github.com/stretchr/testify/require" | ||
|
||
pd "github.com/tikv/pd/client" |
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.
"github.com/stretchr/testify/require" | |
pd "github.com/tikv/pd/client" | |
"github.com/stretchr/testify/require" | |
pd "github.com/tikv/pd/client" |
/run-unit-test |
/run-all-tests |
/run-kafka-tests |
1 similar comment
/run-kafka-tests |
/merge |
This pull request has been accepted and is ready to merge. Commit hash: 29961b0
|
/run-kafka-tests |
@maxshuang: 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. |
/run-kafka-tests |
What problem does this PR solve?
migrate test-infra to testify for pkg/version pkg, close #2919
What is changed and how it works?
Check List
Tests
Release note