Skip to content

Commit

Permalink
add daily builds
Browse files Browse the repository at this point in the history
Signed-off-by: Clayton Gonsalves <[email protected]>
  • Loading branch information
clayton-gonsalves committed Sep 18, 2023
1 parent 902e677 commit 6bc5b28
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 6 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/build_daily.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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' }}

5 changes: 0 additions & 5 deletions internal/xdscache/v3/endpointslicetranslator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
13 changes: 13 additions & 0 deletions test/e2e/fixtures.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
"context"
"io"
"os"
"strconv"

"github.com/onsi/ginkgo/v2"
contour_api_v1alpha1 "github.com/projectcontour/contour/apis/projectcontour/v1alpha1"
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/infra/endpointslice_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 6bc5b28

Please sign in to comment.