10 Commits

Author SHA1 Message Date
Dan Winship
24065780ed Add e2eendpointslice.WaitForEndpointPorts, use in some tests.
Slightly-more-generic replacement for validateEndpointsPortsOrFail()
(but only validates EndpointSlices, not Endpoints).

Also, add two new unit tests to the Endpoints controller, to assert
the correct Endpoints-generating behavior in the cases formerly
covered by the "should serve endpoints on same port and different
protocols" and "should be updated after adding or deleting ports" e2e
tests (since they are now EndpointSlice-only). (There's not much point
in testing the Endpoints controller in "end to end" tests, since
nothing in a normal cluster ever looks at its output, so there's
really only one "end" anyway.)
2025-07-17 15:34:34 -04:00
Dan Winship
b35ad4e9b0 Add e2eendpointslice.WaitForEndpointPods, use in various test
These tests were using validateEndpointsPortsOrFail() not because they
cared about ports, but just because it was there, or in some cases
because they needed to wait for one pod to exit and a different pod to
start, which can't be done with framework.WaitForServiceEndpointsNum()
(or e2eendpointslice.WaitForEndpointCount) without racing. Update
these tests using the new e2eendpointslice.WaitForEndpointPods, which
can wait for specific expected pods.

(This also means these tests now only watch EndpointSlices, rather
than watching both Endpoints and EndpointSlices, which is fine,
because none of them are doing tricky things that actually require
making assertions about the exact contents of the
Endpoints/EndpointSlices. They just want to know when the controller
has updated things to point to the expected pods.)
2025-07-16 11:42:02 -04:00
Dan Winship
b7998a397b Add e2eendpointslice.WaitForEndpointCount, use it in some network tests
This replaces framework.WaitForServiceEndpointsNum
2025-07-16 11:42:00 -04:00
Dan Winship
665599417a Add e2eendpointslice.WaitForEndpointSlices, use it in a few places
(This is mostly a helper for the other functions about to be added,
but it's useful by itself in a few places.)
2025-07-16 06:17:34 -04:00
Ed Bartosh
ff9ebfa90d e2e framework: control k/k/pkg imports
Modified import restrictions for the e2e framework submodules
to enable control of the k/k/pkg imports.
2023-04-17 00:17:16 +03:00
Patrick Ohly
3e760310b2 e2e: revise import restrictions
- test/e2e/framework/*.go should have very minimal dependencies.
  We can enforce that via import-boss.

- What each test/e2e/framework/* sub-package uses is less relevant,
  although ideally it also should be as minimal as possible in each case.

Enforcing this via import-boss ensures that new dependencies get flagged as
problem and thus will get additional scrutiny. It might be okay to add them,
but it needs to be considered.
2023-02-12 14:56:45 +01:00
Laszlo Janosi
9d75c958ce Fix review comments. Implement endpoint port validation that verifies the protocol, too. 2022-11-03 10:54:14 +02:00
Swetha Repakula
3ef94fbe3e Update e2e tests to use EndpointSlice v1 API 2021-03-08 09:44:47 -08:00
Benjamin Elder
56e092e382 hack/update-bazel.sh 2021-02-28 15:17:29 -08:00
wojtekt
76b3fe7f6d Wait for both endpoints and endpointslices in e2e tests 2020-07-31 17:24:53 +02:00