-
Notifications
You must be signed in to change notification settings - Fork 621
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
test : getStringFromServiceAnnotation() #2392
test : getStringFromServiceAnnotation() #2392
Conversation
Hi @KingDaemonX. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
25c7b5a
to
35f6ea7
Compare
/ok-to-test |
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.
Looks good, please just address the comment about usage of asserts.
pkg/openstack/loadbalancer_test.go
Outdated
if got := getStringFromServiceAnnotation(test.testArgs.service, test.testArgs.annotationKey, test.testArgs.defaultSetting); got != test.expect { | ||
t.Errorf("[Error] : getStringFromServiceAnnotation() => %s, expecting = %s", got, test.expect) | ||
} |
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.
This should be done through assert.Equal()
.
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.
noted! and fixed
35f6ea7
to
5bdcf6c
Compare
pkg/openstack/loadbalancer_test.go
Outdated
{ | ||
name: "enter valid arguments with annotations", | ||
testArgs: testArgs{ | ||
service: &corev1.Service{ | ||
ObjectMeta: v1.ObjectMeta{ | ||
Namespace: "service-namespace", | ||
Name: "service-name", | ||
Annotations: map[string]string{"annotationKey": "annotation-Value"}, | ||
}, | ||
}, | ||
annotationKey: "annotationKey", | ||
defaultSetting: "default-setting", | ||
}, | ||
expected: "annotation-Value", | ||
}, |
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.
This seems to be a duplicate of the case number 2 - with the same name.
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.
yeah, my bad, i used that line to create a populated field before editing the unit test and missed it
thank you catching it :)
1d294c2
to
ec964ed
Compare
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: dulek 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 |
ec964ed
to
1aef487
Compare
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! Please rebase and we're good to merge.
My bad, this is rebased already. Let's go! /lgtm |
What this PR does / why we need it:
Which issue this PR fixes(if applicable):
fixes #
Special notes for reviewers:
Release note:
cover all possible edge cases that can during the use of this function and test for behavour of function giving hardcoded value incase there is a change in the logic of the function