Skip to content
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

Merged
merged 1 commit into from
Sep 27, 2022
Merged

Refactor l4 tests #1822

merged 1 commit into from
Sep 27, 2022

Conversation

panslava
Copy link
Contributor

  • Split l4netlb_test assertions by functions
  • Move common l4_test, l4netlb_test assertions to l4testutils

This will also make it easier to add dual-stack tests to l4netlb in the future

/assign @kl52752

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Sep 19, 2022
@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Sep 19, 2022
pkg/loadbalancers/l4_test.go Show resolved Hide resolved
pkg/loadbalancers/l4netlb_test.go Outdated Show resolved Hide resolved
pkg/loadbalancers/l4netlb_test.go Outdated Show resolved Hide resolved
pkg/loadbalancers/l4netlb_test.go Outdated Show resolved Hide resolved
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)
Copy link
Contributor

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?

Copy link
Contributor Author

@panslava panslava Sep 26, 2022

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
@kl52752
Copy link
Contributor

kl52752 commented Sep 27, 2022

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 27, 2022
@k8s-ci-robot
Copy link
Contributor

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot merged commit 6b12b41 into kubernetes:master Sep 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants