-
Notifications
You must be signed in to change notification settings - Fork 83
Add tests to watch.go #151
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
Add tests to watch.go #151
Conversation
This commit adds unit tests for watch.go As of now part of tests are implemented, I'll add additional tests.
7814ba1
to
27795a3
Compare
/retitle Add tests to watch.go I'd like to add more tests, but it's difficult on unit test. It may need k8s cluster and it's not unit test, I think. |
/assign @justinsb |
/assign @pwittrock |
for _, tt := range tests { | ||
t.Run(tt.name, func(t *testing.T) { | ||
actualSchema := uniqueGroupVersionKind(tt.inputObjects) | ||
assert.Equal(t, tt.expectedSchema, actualSchema) |
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.
FYI, the google go style guide says to avoid assertion libraries, and to use e.g.
if diff := cmp.Diff(got, want); diff != "" {
t.Errorf("unexpected result from watch; diff %s", diff)
}
(or something along those lines)
Thanks @atoato88 . A suggestion to avoid assertion libraries, but that's more based on my code style guide from work, and I don't know that kubernetes has made the same statement. /approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: atoato88, justinsb The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/retest Test failure was unrelated, should have been fixed by #155 |
This PR adds unit tests for
watch.go
As of now part of tests are implemented, I'll add additional tests.
related to: #150