Skip to content

Commit

Permalink
Opinionated knative gateway conformance (#673)
Browse files Browse the repository at this point in the history
* opinionated knative gateway conformance

* update and incorporate into e2e-script

* fix gateway_conformance invocation

* enable contour endpointslice support
  • Loading branch information
dprotaso committed Apr 18, 2024
1 parent 8b35f5c commit 1064b49
Show file tree
Hide file tree
Showing 8 changed files with 375 additions and 2 deletions.
13 changes: 12 additions & 1 deletion test/e2e-common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export CLUSTER_DOMAIN=${CLUSTER_DOMAIN:-cluster.local}
export INGRESS=${INGRESS:-istio}
export GATEWAY_OVERRIDE=${GATEWAY_OVERRIDE:-istio-ingressgateway}
export GATEWAY_NAMESPACE_OVERRIDE=${GATEWAY_NAMESPACE_OVERRIDE:-istio-system}
export GATEWAY_CLASS=${GATEWAY_CLASS:-istio}
export UNSUPPORTED_E2E_TESTS=${UNSUPPORTED_E2E_TESTS:-$ISTIO_UNSUPPORTED_E2E_TESTS}
export KIND=${KIND:-0}

Expand All @@ -32,13 +33,15 @@ function parse_flags() {
readonly INGRESS=istio
readonly GATEWAY_OVERRIDE=istio-ingressgateway
readonly GATEWAY_NAMESPACE_OVERRIDE=istio-system
readonly GATEWAY_CLASS=istio
readonly UNSUPPORTED_E2E_TESTS="${ISTIO_UNSUPPORTED_E2E_TESTS}"
return 1
;;
--contour)
readonly INGRESS=contour
readonly GATEWAY_OVERRIDE=envoy-knative-external
readonly GATEWAY_NAMESPACE_OVERRIDE=contour-external
readonly GATEWAY_CLASS=contour-external
readonly UNSUPPORTED_E2E_TESTS="${CONTOUR_UNSUPPORTED_E2E_TESTS}"
return 1
;;
Expand Down Expand Up @@ -136,7 +139,7 @@ function setup_istio() {
fi
}

function test_conformance() {
function knative_conformance() {
local parallel_count="12"
if (( KIND )); then
parallel_count="1"
Expand All @@ -151,6 +154,14 @@ function test_conformance() {
return $?
}

function gateway_conformance() {
pushd "${REPO_ROOT_DIR}/test/gatewayapi"

go_test_e2e -timeout=30m -args -gateway-class ${GATEWAY_CLASS}

popd
}

function test_ha() {
go_test_e2e -timeout=15m -failfast -parallel=1 ./test/ha \
-spoofinterval="10ms" \
Expand Down
3 changes: 2 additions & 1 deletion test/e2e-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@ header "Running e2e tests"

failed=0

test_conformance || failed=1
knative_conformance || failed=1
test_ha || failed=1
gateway_conformance || true # this is informational

(( failed )) && fail_test

Expand Down
8 changes: 8 additions & 0 deletions test/gatewayapi/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
## Knative Gateway API Conformance Profile


Run the opinionated profile using

```sh
go test -args -gateway-class {your-gateway-class}
```
65 changes: 65 additions & 0 deletions test/gatewayapi/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
module knative.dev/net-gateway-api/test/gatewayapi

go 1.22.0

require (
k8s.io/apimachinery v0.29.3
sigs.k8s.io/gateway-api v1.0.1-0.20240418002011-7f9f51098f40
)

require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/emicklei/go-restful/v3 v3.11.2 // indirect
github.com/evanphx/json-patch/v5 v5.7.0 // indirect
github.com/go-logr/logr v1.4.1 // indirect
github.com/go-openapi/jsonpointer v0.20.2 // indirect
github.com/go-openapi/jsonreference v0.20.4 // indirect
github.com/go-openapi/swag v0.22.7 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/google/gnostic-models v0.6.8 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/uuid v1.5.0 // indirect
github.com/gorilla/websocket v1.5.1 // indirect
github.com/imdario/mergo v0.3.16 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 // indirect
github.com/miekg/dns v1.1.58 // indirect
github.com/moby/spdystream v0.2.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/stretchr/testify v1.9.0 // indirect
golang.org/x/mod v0.14.0 // indirect
golang.org/x/net v0.20.0 // indirect
golang.org/x/oauth2 v0.16.0 // indirect
golang.org/x/sync v0.6.0 // indirect
golang.org/x/sys v0.16.0 // indirect
golang.org/x/term v0.16.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/time v0.5.0 // indirect
golang.org/x/tools v0.17.0 // indirect
google.golang.org/appengine v1.6.8 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17 // indirect
google.golang.org/grpc v1.61.0 // indirect
google.golang.org/protobuf v1.33.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/api v0.29.3 // indirect
k8s.io/apiextensions-apiserver v0.29.3 // indirect
k8s.io/client-go v0.29.3 // indirect
k8s.io/klog/v2 v2.120.0 // indirect
k8s.io/kube-openapi v0.0.0-20240105020646-a37d4de58910 // indirect
k8s.io/utils v0.0.0-20240102154912-e7106e64919e // indirect
sigs.k8s.io/controller-runtime v0.16.3 // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
sigs.k8s.io/yaml v1.4.0 // indirect
)
Loading

0 comments on commit 1064b49

Please sign in to comment.