-
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
enh: add tests for checkListenerPorts #2405
Conversation
Hi @sakshi-1505. 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. |
/ok-to-test |
/retest |
pkg/openstack/loadbalancer_test.go
Outdated
Port: 9090, | ||
}: { | ||
ID: "listenerid", | ||
Tags: []string{"test-lb", "test-lb2"}, |
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.
I think we can only have one LB on a listener in our logic.
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.
fixed
pkg/openstack/loadbalancer_test.go
Outdated
type fields struct { | ||
LoadBalancer LoadBalancer | ||
} |
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.
Doesn't seem you ever use this? Can we remove it?
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.
It was added to mimic the interface of LoadBalancer, although we didn't use any field for the caller but it is actually needed to invoke the function from LoadBalancer interface.
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.
But no test case defines LoadBalancer
as anything else than LoadBalancer{}
. Can't we just define it in the loop that goes over the test cases?
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.
Yes that makes sense, I will just define it in the loop
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.
fixed
pkg/openstack/loadbalancer_test.go
Outdated
} | ||
tests := []struct { | ||
name string | ||
fields fields |
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.
And this.
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.
fixed
pkg/openstack/loadbalancer_test.go
Outdated
{ | ||
name: "error is not thrown if lbOwner is present & no tags on service", | ||
args: args{ | ||
service: &corev1.Service{ | ||
Spec: corev1.ServiceSpec{ | ||
Ports: []corev1.ServicePort{ | ||
{ | ||
Name: "service", | ||
Protocol: "https", | ||
Port: 9090, | ||
}, | ||
}, | ||
}, | ||
}, | ||
curListenerMapping: map[listenerKey]*listeners.Listener{ | ||
{ | ||
Protocol: "https", | ||
Port: 9090, | ||
}: { | ||
ID: "listenerid", | ||
}, | ||
}, | ||
isLBOwner: true, | ||
lbName: "test-lb", | ||
}, | ||
wantErr: false, | ||
fields: fields{ | ||
LoadBalancer: LoadBalancer{}, | ||
}, | ||
}, |
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.
We should have a case when lbOwner=true
and there are some tags on the Service.
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.
done
pkg/openstack/loadbalancer_test.go
Outdated
type fields struct { | ||
LoadBalancer LoadBalancer | ||
} |
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.
But no test case defines LoadBalancer
as anything else than LoadBalancer{}
. Can't we just define it in the loop that goes over the test cases?
6b64ce3
to
122cd66
Compare
@pierreprinetti Please check this I have made all the changes which @dulek had requested |
Thank you! Please rebase and we're good 🚀 |
I think it's already aligned with |
the label said otherwise . Can you please check? This also needs a |
There are multiple merge commits from main in this branch, squashing would
make the git history dirty due to those. Do you know how can I get over it?
…On Tue, 17 Oct 2023 at 00:12, Pierre Prinetti ***@***.***> wrote:
Right: I should have said “squash”, not “rebase”
—
Reply to this email directly, view it on GitHub
<#2405 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BDCZVU3Q5QTBCSZOUF6CJRTX7V52XAVCNFSM6AAAAAA5XPXQTWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONRVGA3TQMZWGQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
The problem here is that you have meged master into your branch, whereas you should have rebased your branch onto master. You have several options, the cleanest of which would entail If you find yourself stuck, be aware that you can cancel the rebase at any time with If instead you just want the job done and you're not afraid of using any means necessary: git reset origin/master --hard \
&& git apply <(curl -sSL https://github.com/kubernetes/cloud-provider-openstack/pull/2405.diff) \
&& git add --all \
&& git commit But please don't tell anyone 🤫 In any case, for the next time, I strongly advise you rebase instead of merging: git fetch origin
git rebase origin/master |
f7a9798
to
d02b997
Compare
Thanks @pierreprinetti I will remember this from now on, can you please approve this? |
Unfortunately, another PR merged and you've won a new rebase round |
Or maybe I am misinterpreting the label? |
/approve hold for conflict solve, then let's unhold |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jichenjc 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 |
9cb8468
to
b2b02c1
Compare
@jichenjc @pierreprinetti can you please re-add the lgtm labels & merge this? |
/lgtm |
What this PR does / why we need it:
It increase unit test coverage for LB file
Which issue this PR fixes(if applicable):
refers #2400
Special notes for reviewers:
Release note: