Skip to content

Refactor l4 tests#1822

Merged
k8s-ci-robot merged 1 commit intokubernetes:masterfrom
panslava:l4testutils
Sep 27, 2022
Merged

Refactor l4 tests#1822
k8s-ci-robot merged 1 commit intokubernetes:masterfrom
panslava:l4testutils

Conversation

@panslava
Copy link
Copy Markdown
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
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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

Details 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.

3 participants