diff --git a/.github/workflows/build_daily.yaml b/.github/workflows/build_daily.yaml index 1c7e9459687..fe64c21dfe2 100644 --- a/.github/workflows/build_daily.yaml +++ b/.github/workflows/build_daily.yaml @@ -152,3 +152,38 @@ jobs: steps: ${{ toJson(steps) }} channel: '#contour-ci-notifications' if: ${{ failure() && github.ref == 'refs/heads/main' }} + e2e-endpoint-slices: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/cache@v3 + with: + # * Module download cache + # * Build cache (Linux) + path: | + ~/go/pkg/mod + ~/.cache/go-build + key: ${{ runner.os }}-${{ github.job }}-go-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ runner.os }}-${{ github.job }}-go- + - uses: actions/setup-go@v4 + with: + go-version: ${{ env.GO_VERSION }} + cache: false + - name: add deps to path + run: | + ./hack/actions/install-kubernetes-toolchain.sh $GITHUB_WORKSPACE/bin + echo "$GITHUB_WORKSPACE/bin" >> $GITHUB_PATH + - name: e2e tests + env: + CONTOUR_E2E_IMAGE: ghcr.io/projectcontour/contour:main + CONTOUR_E2E_USE_ENDPOINT_SLICES: true + run: | + make setup-kind-cluster run-e2e cleanup-kind + - uses: act10ns/slack@v2 + with: + status: ${{ job.status }} + steps: ${{ toJson(steps) }} + channel: '#contour-ci-notifications' + if: ${{ failure() && github.ref == 'refs/heads/main' }} + diff --git a/internal/xdscache/v3/endpointslicetranslator_test.go b/internal/xdscache/v3/endpointslicetranslator_test.go index 6a75ce36716..198c3620186 100644 --- a/internal/xdscache/v3/endpointslicetranslator_test.go +++ b/internal/xdscache/v3/endpointslicetranslator_test.go @@ -665,11 +665,6 @@ func TestEndpointSliceTranslatorRemoveEndpoints(t *testing.T) { observer := &simpleObserver{} endpointSliceTranslator.Observer = observer - // TODO(jpeach): this doesn't actually test - // that deleting endpoints works. We ought to - // ensure the cache is populated first and - // only after that, verify that deletion gives - // the expected result. endpointSliceTranslator.OnDelete(tc.endpointSlice) got := endpointSliceTranslator.Contents() protobuf.ExpectEqual(t, tc.want, got) diff --git a/test/e2e/fixtures.go b/test/e2e/fixtures.go index 2e584b9e660..95762b1d2cc 100644 --- a/test/e2e/fixtures.go +++ b/test/e2e/fixtures.go @@ -19,6 +19,7 @@ import ( "context" "io" "os" + "strconv" "github.com/onsi/ginkgo/v2" contour_api_v1alpha1 "github.com/projectcontour/contour/apis/projectcontour/v1alpha1" @@ -566,6 +567,7 @@ func DefaultContourConfiguration() *contour_api_v1alpha1.ContourConfiguration { Address: listenAllAddress(), Port: 8000, }, + UseEndpointSlice: UseEndpointSlicesFromEnv(), Envoy: &contour_api_v1alpha1.EnvoyConfig{ DefaultHTTPVersions: []contour_api_v1alpha1.HTTPVersionType{ "HTTP/1.1", "HTTP/2", @@ -638,6 +640,17 @@ func XDSServerTypeFromEnv() contour_api_v1alpha1.XDSServerType { return serverType } +func UseEndpointSlicesFromEnv() bool { + useFromEnv, found := os.LookupEnv("CONTOUR_E2E_USE_ENDPOINT_SLICES") + if found { + useEndpointSlices, err := strconv.ParseBool(useFromEnv) + if err == nil { + return useEndpointSlices + } + } + return false +} + func valOrDefault(val, defaultVal string) string { if val != "" { return val diff --git a/test/e2e/infra/endpointslice_test.go b/test/e2e/infra/endpointslice_test.go index eeec2fb8035..576c8043831 100644 --- a/test/e2e/infra/endpointslice_test.go +++ b/test/e2e/infra/endpointslice_test.go @@ -60,7 +60,7 @@ func testSimpleEndpointSlice(namespace string) { } f.CreateHTTPProxyAndWaitFor(p, e2e.HTTPProxyValid) - time.Sleep(time.Second * 120) + time.Sleep(time.Second * 5) k8sPodIPs, err := f.Fixtures.Echo.ListPodIPs(namespace, "echo") require.NoError(f.T(), err)