-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
refactor(tests): testifylint don't use Equal
for floating point tests
#13459
Conversation
Part of the refactor to enable us to use testifylint, shift to using InEpsilon or InDelta for floating point comparisons Signed-off-by: Alan Clucas <alan@clucas.org>
Equal
for floating point tests
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.
Code LGTM, but one question: Does testifylint
require this? For general floating point arithmetic, this makes sense, but it seems like all of the cases here do not involve large or long floats and so don't have the same chance of being inaccurate (and the tests passed before too)
Mmm I'm going to suggest the same as I did in #13406 (comment) that auto-merge before approval is an anti-pattern. I didn't even notice it was enabled here |
Yes it does. Well, it is a default enabled linter which I agree with. It seems unlikely that rounding will affect the tests in question, but it felt better to leave the linter on.
Sorry, I missed that comment. I'll try to remember we're not using that here in future. |
Also worth noting that most of these are removed by #13265 where I've moved metrics which make most sense as integers to be integers. |
Yea I prefer to stick with the defaults generally as well (for the same reasons that
It's main use-case is to auto-merge once CI/tests are complete, so I think it only makes sense to use after a PR has been approved such that all changes (including to title and co-authors) are already in. |
Part of the refactor started by #13365 to enable us to use testifylint, shift to using InEpsilon or InDelta for floating point comparisons. Mostly use
InEpsilon
as it is more resilient, but usingInDelta
for testing against zero.Reviewers: As with the others in this series, please feel free to apply patches as you see fit.