-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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: replace t.Errorf
and t.Fatalf
with assert
and require
#17720
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Your Name <[email protected]>
Review ChecklistHello reviewers! 👋 Please follow this checklist when reviewing this Pull Request. General
Tests
Documentation
New flags
If a workflow is added or modified:
Backward compatibility
|
t.Errorf
and t.Fatalf
with assert
and require
t.Errorf
and t.Fatalf
with assert
and require
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #17720 +/- ##
=======================================
Coverage 67.94% 67.95%
=======================================
Files 1586 1586
Lines 255173 255195 +22
=======================================
+ Hits 173389 173405 +16
- Misses 81784 81790 +6 ☔ View full report in Codecov by Sentry. |
b20f549
to
363eb5c
Compare
Signed-off-by: Your Name <[email protected]>
363eb5c
to
49f9180
Compare
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.
Thank you for this pull request! The changes are desired and align with modern testing methodologies which we practice today. I have left multiple comments on how to improve the testing even further, while we're at it, using testify
's more user-friendly functionality in some places, or more formal functions in others. These suggestions repeat themselves and so I have not commented on every single change. Would you be open to rewrite those changes as per suggestions?
Signed-off-by: Your Name <[email protected]>
Signed-off-by: Your Name <[email protected]>
512c244
to
9c9dd9b
Compare
BTW, we have a preference for normal |
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.
Please consider this subset of comments for removing superfluous text, as testify's functions already report as much. The same form of comments applies to the entirety of the PR.
Signed-off-by: Your Name <[email protected]>
Signed-off-by: Your Name <[email protected]>
The Sign-off messages in your commits look off? 🤔 |
Signed-off-by: Harshvir Potpose <[email protected]>
I had misconfigured it on my new Linux setup, got it fixed now! 😅 |
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.
Again thank you for your efforts. In this review I have dozens of comments. I stopped at some point as I see those are repeating. Some notes:
- Please be very cautious, and use
require
when the original code otherwise issues areturn
. - If using
EqualValues
, which we encourage, get rid of casting. - Use
ErrorContains
to both check that an error is not nil, as well as that it contains some text - Sometimes you will use
require
where anassert
seems more compatible with the original code.
Signed-off-by: Harshvir Potpose <[email protected]>
Signed-off-by: Harshvir Potpose <[email protected]>
Signed-off-by: Harshvir Potpose <[email protected]>
Description
Related Issue(s)
t.Errorf
andt.Fatalf
withassert
andrequire
, respectively #15182Checklist
Deployment Notes