-
Notifications
You must be signed in to change notification settings - Fork 297
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
Refactor l4 tests #1822
Refactor l4 tests #1822
Conversation
ad44fc9
to
39554f1
Compare
pkg/loadbalancers/l4_test.go
Outdated
if result != nil && result.Error != nil { | ||
t.Fatalf("Error ensuring service err: %v", result.Error) | ||
} | ||
svc2, l4, result := ensureService(fakeGCE, namer, nodeNames, vals.ZoneName, 8081, t) | ||
svc2, l4, result := ensureService(fakeGCE, namer, nodeNames, vals.ZoneName, t) |
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.
Is it working as intended? Do we expect here 2 different services or ensure twice the same 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.
I agree this test is confusing
I deleted port from ensureService argument, because it was not used inside
Feels like creating 2 services here is not needed, all the test logic relies on
(fakeGCE.Compute().(*cloud.MockGCE)).MockHealthChecks.DeleteHook = test.DeleteHealthCheckResourceInUseErrorHook
So, I deleted second service creation and left only one service
- Split l4netlb_test assertions by functions - Move common l4_test, l4netlb_test assertions to l4testutils
39554f1
to
51039da
Compare
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: kl52752, panslava 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 |
This will also make it easier to add dual-stack tests to l4netlb in the future
/assign @kl52752