Uh oh!
There was an error while loading. Please reload this page.
chore: Replace reflect.DeepEqual with cmp.Equal in tests - #3691
Conversation
Updated multiple test files to use github.com/google/go-cmp/cmp.Equal instead of reflect.DeepEqual for value comparisons. This improves test output readability and consistency across the codebase.
gmlewis
commented
Aug 18, 2025
@jferri - just FYI - I lost write access to this repo and this may cause unexpected delays for which I apologize. |
jferrl
commented
Aug 18, 2025
No worries! 😃 |
alexandear
left a comment
There was a problem hiding this comment.
I propose configuring the forbidigo linter in the golangci-lint config to forbid the use of reflect.DeepEqual in tests. This way, the use of cmp.Equal will be automatically enforced in the future.
Configured the forbidigo linter in .golangci.yml to forbid the use of reflect.DeepEqual, recommending cmp.Equal instead. This helps ensure more reliable equality checks in the codebase.
jferrl
commented
Aug 19, 2025
Thanks for the suggestion, good catch 😃 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@## master #3691 +/- ##
=======================================
Coverage 91.12% 91.12% =======================================
Files 187 187 Lines 16640 16640 =======================================
Hits 15164 15164 Misses 1291 1291 Partials 185 185 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
gmlewis
left a comment
There was a problem hiding this comment.
Thank you, @jferrl and @alexandear!
LGTM.
Merging.
Uh oh!
There was an error while loading. Please reload this page.
This PR refactors the test suite to replace all instances of
reflect.DeepEqualwithcmp.Equalfrom thegithub.com/google/go-cmp/cmppackage. This change improves test performance, provides better error messages, and follows modern Go testing best practices. Also improves test output readability and consistency across the codebase