-
Notifications
You must be signed in to change notification settings - Fork 516
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
chore: use testify instead of t.Fatal or t.Error #1040
base: main
Are you sure you want to change the base?
Conversation
456808d
to
c527e51
Compare
pkg/cache/v3/delta_test.go
Outdated
if !cmp.Equal(want, got, protocmp.Transform()) { | ||
t.Errorf("got resources %v, want %v", got, want) | ||
} | ||
assert.Truef(t, cmp.Equal(want, got, protocmp.Transform()), "got resources %v, want %v", got, want) |
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.
Nit, using cmp.Diff
in the error message makes it much simpler to process errors imo
pkg/cache/v3/delta_test.go
Outdated
if reflect.DeepEqual(streams[testTypes[0]].GetResourceVersions(), nextVersionMap) { | ||
t.Fatalf("versionMap for the endpoint resource type did not change, received: %v, instead of an empty map", nextVersionMap) | ||
} | ||
require.Falsef(t, reflect.DeepEqual(streams[testTypes[0]].GetResourceVersions(), nextVersionMap), "versionMap for the endpoint resource type did not change, received: %v, instead of an empty map", nextVersionMap) |
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.
Same remark: using cmp.Equal
/cmp.Diff
could be nicer in error messages
Thank you @valerian-roche |
Signed-off-by: Matthieu MOREL <[email protected]>
3fca00f
to
04d5899
Compare
This uses testify instead of testing for t.Fatal or t.Error calls