-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
prefer testify Error/NoError over NotNil/Nil #20044
Conversation
Since this is a community submitted pull request, a Jenkins build has not been kicked off automatically. Can an Elastic organization member please verify the contents of this patch and then kick off a build manually? |
1 similar comment
Since this is a community submitted pull request, a Jenkins build has not been kicked off automatically. Can an Elastic organization member please verify the contents of this patch and then kick off a build manually? |
💚 CLA has been signed |
CLA signed. |
💔 Build FailedExpand to view the summary
Build stats
Test stats 🧪
Steps errorsExpand to view the steps failures
Log outputExpand to view the last 100 lines of log output
|
jenkins, test this |
Pinging @elastic/integrations-services (Team:Services) |
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. Thanks for the cleanup.
jenkins, run tests |
…-basis-when * upstream/master: [CI] run everything for branches/tags (elastic#20057) Limit the number of bytes read by LineReader in Filebeat (elastic#19552) Prefer testify.Error/NoError over NotNil/Nil (elastic#20044)
What does this PR do?
replaces calls to require/assert Nil/NotNil to NoError/Error
NoError is for asserting no error was return
Error is for asserting an error was returned
Why is it important?
When these fail their message explicitly calls out that we were or were not expecting an error. This communicates the intent of the assertion.
Checklist
My code follows the style guidelines of this project
I have commented my code, particularly in hard-to-understand areas
I have made corresponding changes to the documentation
I have made corresponding change to the default configuration files
I have added tests that prove my fix is effective or that my feature works
I have added an entry in
CHANGELOG.next.asciidoc
orCHANGELOG-developer.next.asciidoc
Im not sure what you are looking for here.
How to test this PR locally
run go test make sure it still passes.