diff --git a/.github/workflows/build-and-test.yaml b/.github/workflows/build-and-test.yaml index 754469dfb4..ca8af647a7 100644 --- a/.github/workflows/build-and-test.yaml +++ b/.github/workflows/build-and-test.yaml @@ -107,7 +107,7 @@ jobs: steps: - uses: actions/checkout@v3 - ingress-conformance-test: + higress-conformance-test: runs-on: ubuntu-latest needs: [build] steps: @@ -141,10 +141,10 @@ jobs: - run: git stash # restore patch - - name: "Run Ingress Conformance Tests" - run: GOPROXY="https://proxy.golang.org,direct" make ingress-conformance-test + - name: "Run Higress E2E Conformance Tests" + run: GOPROXY="https://proxy.golang.org,direct" make higress-conformance-test - ingress-wasmplugin-test: + higress-wasmplugin-test: runs-on: ubuntu-latest needs: [build] steps: @@ -179,10 +179,10 @@ jobs: - run: git stash # restore patch - name: "Run Ingress WasmPlugins Tests" - run: GOPROXY="https://proxy.golang.org,direct" make ingress-wasmplugin-test + run: GOPROXY="https://proxy.golang.org,direct" make higress-wasmplugin-test publish: runs-on: ubuntu-latest - needs: [ingress-conformance-test,gateway-conformance-test,ingress-wasmplugin-test] + needs: [higress-conformance-test,gateway-conformance-test,higress-wasmplugin-test] steps: - uses: actions/checkout@v3 diff --git a/Makefile.core.mk b/Makefile.core.mk index 83313d4c4d..bf9016c7db 100644 --- a/Makefile.core.mk +++ b/Makefile.core.mk @@ -199,13 +199,13 @@ include tools/lint.mk .PHONY: gateway-conformance-test gateway-conformance-test: -# ingress-conformance-test runs ingress api conformance tests. -.PHONY: ingress-conformance-test -ingress-conformance-test: $(tools/kind) delete-cluster create-cluster docker-build kube-load-image install-dev run-ingress-e2e-test delete-cluster +# higress-conformance-test runs ingress api conformance tests. +.PHONY: higress-conformance-test +higress-conformance-test: $(tools/kind) delete-cluster create-cluster docker-build kube-load-image install-dev run-higress-e2e-test delete-cluster -# ingress-wasmplugin-test runs ingress wasmplugin tests. -.PHONY: ingress-wasmplugin-test -ingress-wasmplugin-test: $(tools/kind) delete-cluster create-cluster docker-build kube-load-image install-dev-wasmplugin run-ingress-e2e-test-wasmplugin delete-cluster +# higress-wasmplugin-test runs ingress wasmplugin tests. +.PHONY: higress-wasmplugin-test +higress-wasmplugin-test: $(tools/kind) delete-cluster create-cluster docker-build kube-load-image install-dev-wasmplugin run-higress-e2e-test-wasmplugin delete-cluster # create-cluster creates a kube cluster with kind. .PHONY: create-cluster @@ -229,22 +229,22 @@ kube-load-image: $(tools/kind) ## Install the Higress image to a kind cluster us tools/hack/kind-load-image.sh registry.cn-hangzhou.aliyuncs.com/hinsteny/dubbo-provider-demo 0.0.1 tools/hack/kind-load-image.sh registry.cn-hangzhou.aliyuncs.com/hinsteny/nacos-standlone-rc3 1.0.0-RC3 -# run-ingress-e2e-test starts to run ingress e2e tests. -.PHONY: run-ingress-e2e-test -run-ingress-e2e-test: +# run-higress-e2e-test starts to run ingress e2e tests. +.PHONY: run-higress-e2e-test +run-higress-e2e-test: @echo -e "\n\033[36mRunning higress conformance tests...\033[0m" @echo -e "\n\033[36mWaiting higress-controller to be ready...\033[0m\n" kubectl wait --timeout=10m -n higress-system deployment/higress-controller --for=condition=Available @echo -e "\n\033[36mWaiting higress-gateway to be ready...\033[0m\n" kubectl wait --timeout=10m -n higress-system deployment/higress-gateway --for=condition=Available - go test -v -tags conformance ./test/ingress/e2e_test.go --ingress-class=higress --debug=true + go test -v -tags conformance ./test/e2e/e2e_test.go --ingress-class=higress --debug=true -# run-ingress-e2e-test starts to run ingress e2e tests. -.PHONY: run-ingress-e2e-test-wasmplugin -run-ingress-e2e-test-wasmplugin: +# run-higress-e2e-test starts to run ingress e2e tests. +.PHONY: run-higress-e2e-test-wasmplugin +run-higress-e2e-test-wasmplugin: @echo -e "\n\033[36mRunning higress conformance tests...\033[0m" @echo -e "\n\033[36mWaiting higress-controller to be ready...\033[0m\n" kubectl wait --timeout=10m -n higress-system deployment/higress-controller --for=condition=Available @echo -e "\n\033[36mWaiting higress-gateway to be ready...\033[0m\n" kubectl wait --timeout=10m -n higress-system deployment/higress-gateway --for=condition=Available - go test -v -tags conformance ./test/ingress/e2e_test.go -isWasmPluginTest=true --ingress-class=higress --debug=true + go test -v -tags conformance ./test/e2e/e2e_test.go -isWasmPluginTest=true --ingress-class=higress --debug=true diff --git a/test/ingress/arch.png b/test/e2e/arch.png similarity index 100% rename from test/ingress/arch.png rename to test/e2e/arch.png diff --git a/test/ingress/conformance/base/manifests.yaml b/test/e2e/conformance/base/manifests.yaml similarity index 100% rename from test/ingress/conformance/base/manifests.yaml rename to test/e2e/conformance/base/manifests.yaml diff --git a/test/ingress/conformance/embed.go b/test/e2e/conformance/embed.go similarity index 100% rename from test/ingress/conformance/embed.go rename to test/e2e/conformance/embed.go diff --git a/test/ingress/conformance/tests/httproute-app-root.go b/test/e2e/conformance/tests/httproute-app-root.go similarity index 90% rename from test/ingress/conformance/tests/httproute-app-root.go rename to test/e2e/conformance/tests/httproute-app-root.go index 84b6a0a523..30ae6ab079 100644 --- a/test/ingress/conformance/tests/httproute-app-root.go +++ b/test/e2e/conformance/tests/httproute-app-root.go @@ -17,9 +17,9 @@ package tests import ( "testing" - "github.com/alibaba/higress/test/ingress/conformance/utils/http" - "github.com/alibaba/higress/test/ingress/conformance/utils/roundtripper" - "github.com/alibaba/higress/test/ingress/conformance/utils/suite" + "github.com/alibaba/higress/test/e2e/conformance/utils/http" + "github.com/alibaba/higress/test/e2e/conformance/utils/roundtripper" + "github.com/alibaba/higress/test/e2e/conformance/utils/suite" ) func init() { diff --git a/test/ingress/conformance/tests/httproute-app-root.yaml b/test/e2e/conformance/tests/httproute-app-root.yaml similarity index 100% rename from test/ingress/conformance/tests/httproute-app-root.yaml rename to test/e2e/conformance/tests/httproute-app-root.yaml diff --git a/test/ingress/conformance/tests/httproute-canary-header-with-customized-header.go b/test/e2e/conformance/tests/httproute-canary-header-with-customized-header.go similarity index 96% rename from test/ingress/conformance/tests/httproute-canary-header-with-customized-header.go rename to test/e2e/conformance/tests/httproute-canary-header-with-customized-header.go index 674ef183aa..48444f3908 100644 --- a/test/ingress/conformance/tests/httproute-canary-header-with-customized-header.go +++ b/test/e2e/conformance/tests/httproute-canary-header-with-customized-header.go @@ -17,8 +17,8 @@ package tests import ( "testing" - "github.com/alibaba/higress/test/ingress/conformance/utils/http" - "github.com/alibaba/higress/test/ingress/conformance/utils/suite" + "github.com/alibaba/higress/test/e2e/conformance/utils/http" + "github.com/alibaba/higress/test/e2e/conformance/utils/suite" ) func init() { diff --git a/test/ingress/conformance/tests/httproute-canary-header-with-customized-header.yaml b/test/e2e/conformance/tests/httproute-canary-header-with-customized-header.yaml similarity index 100% rename from test/ingress/conformance/tests/httproute-canary-header-with-customized-header.yaml rename to test/e2e/conformance/tests/httproute-canary-header-with-customized-header.yaml diff --git a/test/ingress/conformance/tests/httproute-canary-header.go b/test/e2e/conformance/tests/httproute-canary-header.go similarity index 96% rename from test/ingress/conformance/tests/httproute-canary-header.go rename to test/e2e/conformance/tests/httproute-canary-header.go index 7957a87985..a47e03f726 100644 --- a/test/ingress/conformance/tests/httproute-canary-header.go +++ b/test/e2e/conformance/tests/httproute-canary-header.go @@ -17,8 +17,8 @@ package tests import ( "testing" - "github.com/alibaba/higress/test/ingress/conformance/utils/http" - "github.com/alibaba/higress/test/ingress/conformance/utils/suite" + "github.com/alibaba/higress/test/e2e/conformance/utils/http" + "github.com/alibaba/higress/test/e2e/conformance/utils/suite" ) func init() { diff --git a/test/ingress/conformance/tests/httproute-canary-header.yaml b/test/e2e/conformance/tests/httproute-canary-header.yaml similarity index 100% rename from test/ingress/conformance/tests/httproute-canary-header.yaml rename to test/e2e/conformance/tests/httproute-canary-header.yaml diff --git a/test/ingress/conformance/tests/httproute-canary-weight.go b/test/e2e/conformance/tests/httproute-canary-weight.go similarity index 94% rename from test/ingress/conformance/tests/httproute-canary-weight.go rename to test/e2e/conformance/tests/httproute-canary-weight.go index cc8fdb743d..2bcdd99206 100644 --- a/test/ingress/conformance/tests/httproute-canary-weight.go +++ b/test/e2e/conformance/tests/httproute-canary-weight.go @@ -17,8 +17,8 @@ package tests import ( "testing" - "github.com/alibaba/higress/test/ingress/conformance/utils/http" - "github.com/alibaba/higress/test/ingress/conformance/utils/suite" + "github.com/alibaba/higress/test/e2e/conformance/utils/http" + "github.com/alibaba/higress/test/e2e/conformance/utils/suite" ) func init() { diff --git a/test/ingress/conformance/tests/httproute-canary-weight.yaml b/test/e2e/conformance/tests/httproute-canary-weight.yaml similarity index 100% rename from test/ingress/conformance/tests/httproute-canary-weight.yaml rename to test/e2e/conformance/tests/httproute-canary-weight.yaml diff --git a/test/ingress/conformance/tests/httproute-downstream-encryption.go b/test/e2e/conformance/tests/httproute-downstream-encryption.go similarity index 95% rename from test/ingress/conformance/tests/httproute-downstream-encryption.go rename to test/e2e/conformance/tests/httproute-downstream-encryption.go index 19dd58459f..f7936f1d4f 100644 --- a/test/ingress/conformance/tests/httproute-downstream-encryption.go +++ b/test/e2e/conformance/tests/httproute-downstream-encryption.go @@ -20,10 +20,10 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" - "github.com/alibaba/higress/test/ingress/conformance/utils/cert" - "github.com/alibaba/higress/test/ingress/conformance/utils/http" - "github.com/alibaba/higress/test/ingress/conformance/utils/kubernetes" - "github.com/alibaba/higress/test/ingress/conformance/utils/suite" + "github.com/alibaba/higress/test/e2e/conformance/utils/cert" + "github.com/alibaba/higress/test/e2e/conformance/utils/http" + "github.com/alibaba/higress/test/e2e/conformance/utils/kubernetes" + "github.com/alibaba/higress/test/e2e/conformance/utils/suite" ) func init() { diff --git a/test/ingress/conformance/tests/httproute-downstream-encryption.yaml b/test/e2e/conformance/tests/httproute-downstream-encryption.yaml similarity index 100% rename from test/ingress/conformance/tests/httproute-downstream-encryption.yaml rename to test/e2e/conformance/tests/httproute-downstream-encryption.yaml diff --git a/test/ingress/conformance/tests/httproute-enable-cors.go b/test/e2e/conformance/tests/httproute-enable-cors.go similarity index 96% rename from test/ingress/conformance/tests/httproute-enable-cors.go rename to test/e2e/conformance/tests/httproute-enable-cors.go index 877b518e2b..028d443fac 100644 --- a/test/ingress/conformance/tests/httproute-enable-cors.go +++ b/test/e2e/conformance/tests/httproute-enable-cors.go @@ -17,8 +17,8 @@ package tests import ( "testing" - "github.com/alibaba/higress/test/ingress/conformance/utils/http" - "github.com/alibaba/higress/test/ingress/conformance/utils/suite" + "github.com/alibaba/higress/test/e2e/conformance/utils/http" + "github.com/alibaba/higress/test/e2e/conformance/utils/suite" ) func init() { diff --git a/test/ingress/conformance/tests/httproute-enable-cors.yaml b/test/e2e/conformance/tests/httproute-enable-cors.yaml similarity index 100% rename from test/ingress/conformance/tests/httproute-enable-cors.yaml rename to test/e2e/conformance/tests/httproute-enable-cors.yaml diff --git a/test/ingress/conformance/tests/httproute-enable-ignore-case.go b/test/e2e/conformance/tests/httproute-enable-ignore-case.go similarity index 95% rename from test/ingress/conformance/tests/httproute-enable-ignore-case.go rename to test/e2e/conformance/tests/httproute-enable-ignore-case.go index c3855c5189..4b0e1d62c1 100644 --- a/test/ingress/conformance/tests/httproute-enable-ignore-case.go +++ b/test/e2e/conformance/tests/httproute-enable-ignore-case.go @@ -17,8 +17,8 @@ package tests import ( "testing" - "github.com/alibaba/higress/test/ingress/conformance/utils/http" - "github.com/alibaba/higress/test/ingress/conformance/utils/suite" + "github.com/alibaba/higress/test/e2e/conformance/utils/http" + "github.com/alibaba/higress/test/e2e/conformance/utils/suite" ) func init() { diff --git a/test/ingress/conformance/tests/httproute-enable-ignore-case.yaml b/test/e2e/conformance/tests/httproute-enable-ignore-case.yaml similarity index 100% rename from test/ingress/conformance/tests/httproute-enable-ignore-case.yaml rename to test/e2e/conformance/tests/httproute-enable-ignore-case.yaml diff --git a/test/ingress/conformance/tests/httproute-force-redirect-https.go b/test/e2e/conformance/tests/httproute-force-redirect-https.go similarity index 90% rename from test/ingress/conformance/tests/httproute-force-redirect-https.go rename to test/e2e/conformance/tests/httproute-force-redirect-https.go index b85274b723..7e25948e79 100644 --- a/test/ingress/conformance/tests/httproute-force-redirect-https.go +++ b/test/e2e/conformance/tests/httproute-force-redirect-https.go @@ -17,9 +17,9 @@ package tests import ( "testing" - "github.com/alibaba/higress/test/ingress/conformance/utils/http" - "github.com/alibaba/higress/test/ingress/conformance/utils/roundtripper" - "github.com/alibaba/higress/test/ingress/conformance/utils/suite" + "github.com/alibaba/higress/test/e2e/conformance/utils/http" + "github.com/alibaba/higress/test/e2e/conformance/utils/roundtripper" + "github.com/alibaba/higress/test/e2e/conformance/utils/suite" ) func init() { diff --git a/test/ingress/conformance/tests/httproute-force-redirect-https.yaml b/test/e2e/conformance/tests/httproute-force-redirect-https.yaml similarity index 100% rename from test/ingress/conformance/tests/httproute-force-redirect-https.yaml rename to test/e2e/conformance/tests/httproute-force-redirect-https.yaml diff --git a/test/ingress/conformance/tests/httproute-full-path-regex.go b/test/e2e/conformance/tests/httproute-full-path-regex.go similarity index 94% rename from test/ingress/conformance/tests/httproute-full-path-regex.go rename to test/e2e/conformance/tests/httproute-full-path-regex.go index bbdc12cb4b..26948c70d3 100644 --- a/test/ingress/conformance/tests/httproute-full-path-regex.go +++ b/test/e2e/conformance/tests/httproute-full-path-regex.go @@ -17,8 +17,8 @@ package tests import ( "testing" - "github.com/alibaba/higress/test/ingress/conformance/utils/http" - "github.com/alibaba/higress/test/ingress/conformance/utils/suite" + "github.com/alibaba/higress/test/e2e/conformance/utils/http" + "github.com/alibaba/higress/test/e2e/conformance/utils/suite" ) func init() { diff --git a/test/ingress/conformance/tests/httproute-full-path-regex.yaml b/test/e2e/conformance/tests/httproute-full-path-regex.yaml similarity index 100% rename from test/ingress/conformance/tests/httproute-full-path-regex.yaml rename to test/e2e/conformance/tests/httproute-full-path-regex.yaml diff --git a/test/ingress/conformance/tests/httproute-hostname-same-namespace.go b/test/e2e/conformance/tests/httproute-hostname-same-namespace.go similarity index 96% rename from test/ingress/conformance/tests/httproute-hostname-same-namespace.go rename to test/e2e/conformance/tests/httproute-hostname-same-namespace.go index f231d9b0d5..b87106178a 100644 --- a/test/ingress/conformance/tests/httproute-hostname-same-namespace.go +++ b/test/e2e/conformance/tests/httproute-hostname-same-namespace.go @@ -17,8 +17,8 @@ package tests import ( "testing" - "github.com/alibaba/higress/test/ingress/conformance/utils/http" - "github.com/alibaba/higress/test/ingress/conformance/utils/suite" + "github.com/alibaba/higress/test/e2e/conformance/utils/http" + "github.com/alibaba/higress/test/e2e/conformance/utils/suite" ) func init() { diff --git a/test/ingress/conformance/tests/httproute-hostname-same-namespace.yaml b/test/e2e/conformance/tests/httproute-hostname-same-namespace.yaml similarity index 100% rename from test/ingress/conformance/tests/httproute-hostname-same-namespace.yaml rename to test/e2e/conformance/tests/httproute-hostname-same-namespace.yaml diff --git a/test/ingress/conformance/tests/httproute-http2rpc.go b/test/e2e/conformance/tests/httproute-http2rpc.go similarity index 92% rename from test/ingress/conformance/tests/httproute-http2rpc.go rename to test/e2e/conformance/tests/httproute-http2rpc.go index 7892e5b77b..a0a3e13a5f 100644 --- a/test/ingress/conformance/tests/httproute-http2rpc.go +++ b/test/e2e/conformance/tests/httproute-http2rpc.go @@ -17,8 +17,8 @@ package tests import ( "testing" - "github.com/alibaba/higress/test/ingress/conformance/utils/http" - "github.com/alibaba/higress/test/ingress/conformance/utils/suite" + "github.com/alibaba/higress/test/e2e/conformance/utils/http" + "github.com/alibaba/higress/test/e2e/conformance/utils/suite" ) func init() { diff --git a/test/ingress/conformance/tests/httproute-http2rpc.yaml b/test/e2e/conformance/tests/httproute-http2rpc.yaml similarity index 100% rename from test/ingress/conformance/tests/httproute-http2rpc.yaml rename to test/e2e/conformance/tests/httproute-http2rpc.yaml diff --git a/test/ingress/conformance/tests/httproute-match-headers.go b/test/e2e/conformance/tests/httproute-match-headers.go similarity index 95% rename from test/ingress/conformance/tests/httproute-match-headers.go rename to test/e2e/conformance/tests/httproute-match-headers.go index 0925611c9c..00160e11e0 100644 --- a/test/ingress/conformance/tests/httproute-match-headers.go +++ b/test/e2e/conformance/tests/httproute-match-headers.go @@ -17,8 +17,8 @@ package tests import ( "testing" - "github.com/alibaba/higress/test/ingress/conformance/utils/http" - "github.com/alibaba/higress/test/ingress/conformance/utils/suite" + "github.com/alibaba/higress/test/e2e/conformance/utils/http" + "github.com/alibaba/higress/test/e2e/conformance/utils/suite" ) func init() { diff --git a/test/ingress/conformance/tests/httproute-match-headers.yaml b/test/e2e/conformance/tests/httproute-match-headers.yaml similarity index 100% rename from test/ingress/conformance/tests/httproute-match-headers.yaml rename to test/e2e/conformance/tests/httproute-match-headers.yaml diff --git a/test/ingress/conformance/tests/httproute-match-methods.go b/test/e2e/conformance/tests/httproute-match-methods.go similarity index 95% rename from test/ingress/conformance/tests/httproute-match-methods.go rename to test/e2e/conformance/tests/httproute-match-methods.go index e1c308830d..7c0d03a21b 100644 --- a/test/ingress/conformance/tests/httproute-match-methods.go +++ b/test/e2e/conformance/tests/httproute-match-methods.go @@ -17,8 +17,8 @@ package tests import ( "testing" - "github.com/alibaba/higress/test/ingress/conformance/utils/http" - "github.com/alibaba/higress/test/ingress/conformance/utils/suite" + "github.com/alibaba/higress/test/e2e/conformance/utils/http" + "github.com/alibaba/higress/test/e2e/conformance/utils/suite" ) func init() { diff --git a/test/ingress/conformance/tests/httproute-match-methods.yaml b/test/e2e/conformance/tests/httproute-match-methods.yaml similarity index 100% rename from test/ingress/conformance/tests/httproute-match-methods.yaml rename to test/e2e/conformance/tests/httproute-match-methods.yaml diff --git a/test/ingress/conformance/tests/httproute-match-path.go b/test/e2e/conformance/tests/httproute-match-path.go similarity index 96% rename from test/ingress/conformance/tests/httproute-match-path.go rename to test/e2e/conformance/tests/httproute-match-path.go index dc9ca1f034..3ae9436595 100644 --- a/test/ingress/conformance/tests/httproute-match-path.go +++ b/test/e2e/conformance/tests/httproute-match-path.go @@ -17,8 +17,8 @@ package tests import ( "testing" - "github.com/alibaba/higress/test/ingress/conformance/utils/http" - "github.com/alibaba/higress/test/ingress/conformance/utils/suite" + "github.com/alibaba/higress/test/e2e/conformance/utils/http" + "github.com/alibaba/higress/test/e2e/conformance/utils/suite" ) func init() { diff --git a/test/ingress/conformance/tests/httproute-match-path.yaml b/test/e2e/conformance/tests/httproute-match-path.yaml similarity index 100% rename from test/ingress/conformance/tests/httproute-match-path.yaml rename to test/e2e/conformance/tests/httproute-match-path.yaml diff --git a/test/ingress/conformance/tests/httproute-match-query-params.go b/test/e2e/conformance/tests/httproute-match-query-params.go similarity index 94% rename from test/ingress/conformance/tests/httproute-match-query-params.go rename to test/e2e/conformance/tests/httproute-match-query-params.go index 8c1e98671e..6910f0b6bc 100644 --- a/test/ingress/conformance/tests/httproute-match-query-params.go +++ b/test/e2e/conformance/tests/httproute-match-query-params.go @@ -17,8 +17,8 @@ package tests import ( "testing" - "github.com/alibaba/higress/test/ingress/conformance/utils/http" - "github.com/alibaba/higress/test/ingress/conformance/utils/suite" + "github.com/alibaba/higress/test/e2e/conformance/utils/http" + "github.com/alibaba/higress/test/e2e/conformance/utils/suite" ) func init() { diff --git a/test/ingress/conformance/tests/httproute-match-query-params.yaml b/test/e2e/conformance/tests/httproute-match-query-params.yaml similarity index 100% rename from test/ingress/conformance/tests/httproute-match-query-params.yaml rename to test/e2e/conformance/tests/httproute-match-query-params.yaml diff --git a/test/ingress/conformance/tests/httproute-permanent-redirect-code.go b/test/e2e/conformance/tests/httproute-permanent-redirect-code.go similarity index 90% rename from test/ingress/conformance/tests/httproute-permanent-redirect-code.go rename to test/e2e/conformance/tests/httproute-permanent-redirect-code.go index 42cf6da3b5..ef92b612f7 100644 --- a/test/ingress/conformance/tests/httproute-permanent-redirect-code.go +++ b/test/e2e/conformance/tests/httproute-permanent-redirect-code.go @@ -17,9 +17,9 @@ package tests import ( "testing" - "github.com/alibaba/higress/test/ingress/conformance/utils/http" - "github.com/alibaba/higress/test/ingress/conformance/utils/roundtripper" - "github.com/alibaba/higress/test/ingress/conformance/utils/suite" + "github.com/alibaba/higress/test/e2e/conformance/utils/http" + "github.com/alibaba/higress/test/e2e/conformance/utils/roundtripper" + "github.com/alibaba/higress/test/e2e/conformance/utils/suite" ) func init() { diff --git a/test/ingress/conformance/tests/httproute-permanent-redirect-code.yaml b/test/e2e/conformance/tests/httproute-permanent-redirect-code.yaml similarity index 100% rename from test/ingress/conformance/tests/httproute-permanent-redirect-code.yaml rename to test/e2e/conformance/tests/httproute-permanent-redirect-code.yaml diff --git a/test/ingress/conformance/tests/httproute-permanent-redirect.go b/test/e2e/conformance/tests/httproute-permanent-redirect.go similarity index 90% rename from test/ingress/conformance/tests/httproute-permanent-redirect.go rename to test/e2e/conformance/tests/httproute-permanent-redirect.go index a170156b8c..11b49364dc 100644 --- a/test/ingress/conformance/tests/httproute-permanent-redirect.go +++ b/test/e2e/conformance/tests/httproute-permanent-redirect.go @@ -17,9 +17,9 @@ package tests import ( "testing" - "github.com/alibaba/higress/test/ingress/conformance/utils/http" - "github.com/alibaba/higress/test/ingress/conformance/utils/roundtripper" - "github.com/alibaba/higress/test/ingress/conformance/utils/suite" + "github.com/alibaba/higress/test/e2e/conformance/utils/http" + "github.com/alibaba/higress/test/e2e/conformance/utils/roundtripper" + "github.com/alibaba/higress/test/e2e/conformance/utils/suite" ) func init() { diff --git a/test/ingress/conformance/tests/httproute-permanent-redirect.yaml b/test/e2e/conformance/tests/httproute-permanent-redirect.yaml similarity index 100% rename from test/ingress/conformance/tests/httproute-permanent-redirect.yaml rename to test/e2e/conformance/tests/httproute-permanent-redirect.yaml diff --git a/test/ingress/conformance/tests/httproute-redirct-as-https.yaml b/test/e2e/conformance/tests/httproute-redirct-as-https.yaml similarity index 100% rename from test/ingress/conformance/tests/httproute-redirct-as-https.yaml rename to test/e2e/conformance/tests/httproute-redirct-as-https.yaml diff --git a/test/ingress/conformance/tests/httproute-redirect-as-https.go b/test/e2e/conformance/tests/httproute-redirect-as-https.go similarity index 90% rename from test/ingress/conformance/tests/httproute-redirect-as-https.go rename to test/e2e/conformance/tests/httproute-redirect-as-https.go index 0da6cfcaa1..6b15eb3e0d 100644 --- a/test/ingress/conformance/tests/httproute-redirect-as-https.go +++ b/test/e2e/conformance/tests/httproute-redirect-as-https.go @@ -17,9 +17,9 @@ package tests import ( "testing" - "github.com/alibaba/higress/test/ingress/conformance/utils/http" - "github.com/alibaba/higress/test/ingress/conformance/utils/roundtripper" - "github.com/alibaba/higress/test/ingress/conformance/utils/suite" + "github.com/alibaba/higress/test/e2e/conformance/utils/http" + "github.com/alibaba/higress/test/e2e/conformance/utils/roundtripper" + "github.com/alibaba/higress/test/e2e/conformance/utils/suite" ) func init() { diff --git a/test/ingress/conformance/tests/httproute-request-header-control.go b/test/e2e/conformance/tests/httproute-request-header-control.go similarity index 97% rename from test/ingress/conformance/tests/httproute-request-header-control.go rename to test/e2e/conformance/tests/httproute-request-header-control.go index 42cb90688c..31baefd2c9 100644 --- a/test/ingress/conformance/tests/httproute-request-header-control.go +++ b/test/e2e/conformance/tests/httproute-request-header-control.go @@ -17,8 +17,8 @@ package tests import ( "testing" - "github.com/alibaba/higress/test/ingress/conformance/utils/http" - "github.com/alibaba/higress/test/ingress/conformance/utils/suite" + "github.com/alibaba/higress/test/e2e/conformance/utils/http" + "github.com/alibaba/higress/test/e2e/conformance/utils/suite" ) func init() { diff --git a/test/ingress/conformance/tests/httproute-request-header-control.yaml b/test/e2e/conformance/tests/httproute-request-header-control.yaml similarity index 100% rename from test/ingress/conformance/tests/httproute-request-header-control.yaml rename to test/e2e/conformance/tests/httproute-request-header-control.yaml diff --git a/test/ingress/conformance/tests/httproute-rewrite-host.go b/test/e2e/conformance/tests/httproute-rewrite-host.go similarity index 94% rename from test/ingress/conformance/tests/httproute-rewrite-host.go rename to test/e2e/conformance/tests/httproute-rewrite-host.go index eac208b700..a97ccf9f2a 100644 --- a/test/ingress/conformance/tests/httproute-rewrite-host.go +++ b/test/e2e/conformance/tests/httproute-rewrite-host.go @@ -17,8 +17,8 @@ package tests import ( "testing" - "github.com/alibaba/higress/test/ingress/conformance/utils/http" - "github.com/alibaba/higress/test/ingress/conformance/utils/suite" + "github.com/alibaba/higress/test/e2e/conformance/utils/http" + "github.com/alibaba/higress/test/e2e/conformance/utils/suite" ) func init() { diff --git a/test/ingress/conformance/tests/httproute-rewrite-host.yaml b/test/e2e/conformance/tests/httproute-rewrite-host.yaml similarity index 100% rename from test/ingress/conformance/tests/httproute-rewrite-host.yaml rename to test/e2e/conformance/tests/httproute-rewrite-host.yaml diff --git a/test/ingress/conformance/tests/httproute-rewrite-path.go b/test/e2e/conformance/tests/httproute-rewrite-path.go similarity index 93% rename from test/ingress/conformance/tests/httproute-rewrite-path.go rename to test/e2e/conformance/tests/httproute-rewrite-path.go index 65873c6d20..2ec0145ec5 100644 --- a/test/ingress/conformance/tests/httproute-rewrite-path.go +++ b/test/e2e/conformance/tests/httproute-rewrite-path.go @@ -17,8 +17,8 @@ package tests import ( "testing" - "github.com/alibaba/higress/test/ingress/conformance/utils/http" - "github.com/alibaba/higress/test/ingress/conformance/utils/suite" + "github.com/alibaba/higress/test/e2e/conformance/utils/http" + "github.com/alibaba/higress/test/e2e/conformance/utils/suite" ) func init() { diff --git a/test/ingress/conformance/tests/httproute-rewrite-path.yaml b/test/e2e/conformance/tests/httproute-rewrite-path.yaml similarity index 100% rename from test/ingress/conformance/tests/httproute-rewrite-path.yaml rename to test/e2e/conformance/tests/httproute-rewrite-path.yaml diff --git a/test/ingress/conformance/tests/httproute-same-host-and-path.go b/test/e2e/conformance/tests/httproute-same-host-and-path.go similarity index 95% rename from test/ingress/conformance/tests/httproute-same-host-and-path.go rename to test/e2e/conformance/tests/httproute-same-host-and-path.go index 1eb7e61389..e65cefb377 100644 --- a/test/ingress/conformance/tests/httproute-same-host-and-path.go +++ b/test/e2e/conformance/tests/httproute-same-host-and-path.go @@ -17,8 +17,8 @@ package tests import ( "testing" - "github.com/alibaba/higress/test/ingress/conformance/utils/http" - "github.com/alibaba/higress/test/ingress/conformance/utils/suite" + "github.com/alibaba/higress/test/e2e/conformance/utils/http" + "github.com/alibaba/higress/test/e2e/conformance/utils/suite" ) func init() { diff --git a/test/ingress/conformance/tests/httproute-same-host-and-path.yaml b/test/e2e/conformance/tests/httproute-same-host-and-path.yaml similarity index 100% rename from test/ingress/conformance/tests/httproute-same-host-and-path.yaml rename to test/e2e/conformance/tests/httproute-same-host-and-path.yaml diff --git a/test/ingress/conformance/tests/httproute-simple-same-namespace.go b/test/e2e/conformance/tests/httproute-simple-same-namespace.go similarity index 92% rename from test/ingress/conformance/tests/httproute-simple-same-namespace.go rename to test/e2e/conformance/tests/httproute-simple-same-namespace.go index 0b5ea171cc..9e4cd50a0f 100644 --- a/test/ingress/conformance/tests/httproute-simple-same-namespace.go +++ b/test/e2e/conformance/tests/httproute-simple-same-namespace.go @@ -17,8 +17,8 @@ package tests import ( "testing" - "github.com/alibaba/higress/test/ingress/conformance/utils/http" - "github.com/alibaba/higress/test/ingress/conformance/utils/suite" + "github.com/alibaba/higress/test/e2e/conformance/utils/http" + "github.com/alibaba/higress/test/e2e/conformance/utils/suite" ) func init() { diff --git a/test/ingress/conformance/tests/httproute-simple-same-namespace.yaml b/test/e2e/conformance/tests/httproute-simple-same-namespace.yaml similarity index 100% rename from test/ingress/conformance/tests/httproute-simple-same-namespace.yaml rename to test/e2e/conformance/tests/httproute-simple-same-namespace.yaml diff --git a/test/ingress/conformance/tests/httproute-temporal-redirect.go b/test/e2e/conformance/tests/httproute-temporal-redirect.go similarity index 90% rename from test/ingress/conformance/tests/httproute-temporal-redirect.go rename to test/e2e/conformance/tests/httproute-temporal-redirect.go index f06428ac2a..f7236eba08 100644 --- a/test/ingress/conformance/tests/httproute-temporal-redirect.go +++ b/test/e2e/conformance/tests/httproute-temporal-redirect.go @@ -17,9 +17,9 @@ package tests import ( "testing" - "github.com/alibaba/higress/test/ingress/conformance/utils/http" - "github.com/alibaba/higress/test/ingress/conformance/utils/roundtripper" - "github.com/alibaba/higress/test/ingress/conformance/utils/suite" + "github.com/alibaba/higress/test/e2e/conformance/utils/http" + "github.com/alibaba/higress/test/e2e/conformance/utils/roundtripper" + "github.com/alibaba/higress/test/e2e/conformance/utils/suite" ) func init() { diff --git a/test/ingress/conformance/tests/httproute-temporal-redirect.yaml b/test/e2e/conformance/tests/httproute-temporal-redirect.yaml similarity index 100% rename from test/ingress/conformance/tests/httproute-temporal-redirect.yaml rename to test/e2e/conformance/tests/httproute-temporal-redirect.yaml diff --git a/test/ingress/conformance/tests/httproute-whitelist-source-range.go b/test/e2e/conformance/tests/httproute-whitelist-source-range.go similarity index 94% rename from test/ingress/conformance/tests/httproute-whitelist-source-range.go rename to test/e2e/conformance/tests/httproute-whitelist-source-range.go index 2990aeff76..71b2fab2af 100644 --- a/test/ingress/conformance/tests/httproute-whitelist-source-range.go +++ b/test/e2e/conformance/tests/httproute-whitelist-source-range.go @@ -17,8 +17,8 @@ package tests import ( "testing" - "github.com/alibaba/higress/test/ingress/conformance/utils/http" - "github.com/alibaba/higress/test/ingress/conformance/utils/suite" + "github.com/alibaba/higress/test/e2e/conformance/utils/http" + "github.com/alibaba/higress/test/e2e/conformance/utils/suite" ) func init() { diff --git a/test/ingress/conformance/tests/httproute-whitelist-source-range.yaml b/test/e2e/conformance/tests/httproute-whitelist-source-range.yaml similarity index 100% rename from test/ingress/conformance/tests/httproute-whitelist-source-range.yaml rename to test/e2e/conformance/tests/httproute-whitelist-source-range.yaml diff --git a/test/ingress/conformance/tests/main.go b/test/e2e/conformance/tests/main.go similarity index 90% rename from test/ingress/conformance/tests/main.go rename to test/e2e/conformance/tests/main.go index 43fce7faa1..10a5c79cd0 100644 --- a/test/ingress/conformance/tests/main.go +++ b/test/e2e/conformance/tests/main.go @@ -14,6 +14,6 @@ package tests -import "github.com/alibaba/higress/test/ingress/conformance/utils/suite" +import "github.com/alibaba/higress/test/e2e/conformance/utils/suite" var HigressConformanceTests []suite.ConformanceTest diff --git a/test/ingress/conformance/tests/request-block.go b/test/e2e/conformance/tests/request-block.go similarity index 93% rename from test/ingress/conformance/tests/request-block.go rename to test/e2e/conformance/tests/request-block.go index c1025e138b..52e9e5e2b2 100644 --- a/test/ingress/conformance/tests/request-block.go +++ b/test/e2e/conformance/tests/request-block.go @@ -17,8 +17,8 @@ package tests import ( "testing" - "github.com/alibaba/higress/test/ingress/conformance/utils/http" - "github.com/alibaba/higress/test/ingress/conformance/utils/suite" + "github.com/alibaba/higress/test/e2e/conformance/utils/http" + "github.com/alibaba/higress/test/e2e/conformance/utils/suite" ) func init() { diff --git a/test/ingress/conformance/tests/request-block.yaml b/test/e2e/conformance/tests/request-block.yaml similarity index 100% rename from test/ingress/conformance/tests/request-block.yaml rename to test/e2e/conformance/tests/request-block.yaml diff --git a/test/ingress/conformance/utils/cert/cert.go b/test/e2e/conformance/utils/cert/cert.go similarity index 87% rename from test/ingress/conformance/utils/cert/cert.go rename to test/e2e/conformance/utils/cert/cert.go index b7951f7aff..2e9f55fd8a 100644 --- a/test/ingress/conformance/utils/cert/cert.go +++ b/test/e2e/conformance/utils/cert/cert.go @@ -1,16 +1,15 @@ -// Copyright (c) 2022 Alibaba Group Holding Ltd. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* +Copyright 2022 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ package cert diff --git a/test/e2e/conformance/utils/config/timeout.go b/test/e2e/conformance/utils/config/timeout.go new file mode 100644 index 0000000000..dbacd08d9a --- /dev/null +++ b/test/e2e/conformance/utils/config/timeout.go @@ -0,0 +1,92 @@ +/* +Copyright 2022 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package config + +import "time" + +type TimeoutConfig struct { + // CreateTimeout represents the maximum time for a Kubernetes object to be created. + // Max value for conformant implementation: None + CreateTimeout time.Duration + + // DeleteTimeout represents the maximum time for a Kubernetes object to be deleted. + // Max value for conformant implementation: None + DeleteTimeout time.Duration + + // GetTimeout represents the maximum time to get a Kubernetes object. + // Max value for conformant implementation: None + GetTimeout time.Duration + + // ManifestFetchTimeout represents the maximum time for getting content from a https:// URL. + // Max value for conformant implementation: None + ManifestFetchTimeout time.Duration + + // MaxTimeToConsistency is the maximum time for requiredConsecutiveSuccesses (default 3) requests to succeed in a row before failing the test. + // Max value for conformant implementation: 30 seconds + MaxTimeToConsistency time.Duration + + // NamespacesMustBeReady represents the maximum time for all Pods and Gateways in a namespaces to be marked as ready. + // Max value for conformant implementation: None + NamespacesMustBeReady time.Duration + + // RequestTimeout represents the maximum time for making an HTTP Request with the roundtripper. + // Max value for conformant implementation: None + RequestTimeout time.Duration + + // TLSHandshakeTimeout represents the maximum time for waiting for a TLS handshake. Zero means no timeout. + // Max value for conformant implementation: None + TLSHandshakeTimeout time.Duration +} + +// DefaultTimeoutConfig populates a TimeoutConfig with the default values. +func DefaultTimeoutConfig() TimeoutConfig { + return TimeoutConfig{ + CreateTimeout: 60 * time.Second, + DeleteTimeout: 10 * time.Second, + GetTimeout: 10 * time.Second, + ManifestFetchTimeout: 10 * time.Second, + MaxTimeToConsistency: 30 * time.Second, + NamespacesMustBeReady: 300 * time.Second, + RequestTimeout: 10 * time.Second, + TLSHandshakeTimeout: 10 * time.Second, + } +} + +func SetupTimeoutConfig(timeoutConfig *TimeoutConfig) { + defaultTimeoutConfig := DefaultTimeoutConfig() + if timeoutConfig.CreateTimeout == 0 { + timeoutConfig.CreateTimeout = defaultTimeoutConfig.CreateTimeout + } + if timeoutConfig.DeleteTimeout == 0 { + timeoutConfig.DeleteTimeout = defaultTimeoutConfig.DeleteTimeout + } + if timeoutConfig.GetTimeout == 0 { + timeoutConfig.GetTimeout = defaultTimeoutConfig.GetTimeout + } + if timeoutConfig.ManifestFetchTimeout == 0 { + timeoutConfig.ManifestFetchTimeout = defaultTimeoutConfig.ManifestFetchTimeout + } + if timeoutConfig.MaxTimeToConsistency == 0 { + timeoutConfig.MaxTimeToConsistency = defaultTimeoutConfig.MaxTimeToConsistency + } + if timeoutConfig.NamespacesMustBeReady == 0 { + timeoutConfig.NamespacesMustBeReady = defaultTimeoutConfig.NamespacesMustBeReady + } + if timeoutConfig.RequestTimeout == 0 { + timeoutConfig.RequestTimeout = defaultTimeoutConfig.RequestTimeout + } + if timeoutConfig.TLSHandshakeTimeout == 0 { + timeoutConfig.TLSHandshakeTimeout = defaultTimeoutConfig.TLSHandshakeTimeout + } +} diff --git a/test/e2e/conformance/utils/flags/flags.go b/test/e2e/conformance/utils/flags/flags.go new file mode 100644 index 0000000000..aa03687132 --- /dev/null +++ b/test/e2e/conformance/utils/flags/flags.go @@ -0,0 +1,26 @@ +/* +Copyright 2022 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package flags + +import ( + "flag" +) + +var ( + IngressClassName = flag.String("ingress-class", "higress", "Name of IngressClass to use for tests") + ShowDebug = flag.Bool("debug", false, "Whether to print debug logs") + CleanupBaseResources = flag.Bool("cleanup-base-resources", true, "Whether to cleanup base test resources after the run") + SupportedFeatures = flag.String("supported-features", "", "Supported features included in conformance tests suites") + ExemptFeatures = flag.String("exempt-features", "", "Exempt Features excluded from conformance tests suites") +) diff --git a/test/ingress/conformance/utils/http/http.go b/test/e2e/conformance/utils/http/http.go similarity index 95% rename from test/ingress/conformance/utils/http/http.go rename to test/e2e/conformance/utils/http/http.go index 794f8415b7..84f4935d76 100644 --- a/test/ingress/conformance/utils/http/http.go +++ b/test/e2e/conformance/utils/http/http.go @@ -1,16 +1,15 @@ -// Copyright (c) 2022 Alibaba Group Holding Ltd. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* +Copyright 2022 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ package http @@ -21,8 +20,8 @@ import ( "testing" "time" - "github.com/alibaba/higress/test/ingress/conformance/utils/config" - "github.com/alibaba/higress/test/ingress/conformance/utils/roundtripper" + "github.com/alibaba/higress/test/e2e/conformance/utils/config" + "github.com/alibaba/higress/test/e2e/conformance/utils/roundtripper" ) type Assertion struct { diff --git a/test/ingress/conformance/utils/kubernetes/apply.go b/test/e2e/conformance/utils/kubernetes/apply.go similarity index 89% rename from test/ingress/conformance/utils/kubernetes/apply.go rename to test/e2e/conformance/utils/kubernetes/apply.go index b1c1a581a9..f54358a453 100644 --- a/test/ingress/conformance/utils/kubernetes/apply.go +++ b/test/e2e/conformance/utils/kubernetes/apply.go @@ -1,16 +1,15 @@ -// Copyright (c) 2022 Alibaba Group Holding Ltd. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* +Copyright 2022 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ package kubernetes @@ -24,7 +23,7 @@ import ( "strings" "testing" - ingress "github.com/alibaba/higress/test/ingress/conformance" + ingress "github.com/alibaba/higress/test/e2e/conformance" "github.com/stretchr/testify/require" apierrors "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" @@ -32,7 +31,7 @@ import ( "k8s.io/apimachinery/pkg/util/yaml" "sigs.k8s.io/controller-runtime/pkg/client" - "github.com/alibaba/higress/test/ingress/conformance/utils/config" + "github.com/alibaba/higress/test/e2e/conformance/utils/config" ) // Applier prepares manifests depending on the available options and applies diff --git a/test/e2e/conformance/utils/kubernetes/apply_test.go b/test/e2e/conformance/utils/kubernetes/apply_test.go new file mode 100644 index 0000000000..3ad062474b --- /dev/null +++ b/test/e2e/conformance/utils/kubernetes/apply_test.go @@ -0,0 +1,18 @@ +/* +Copyright 2022 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package kubernetes + +import ( + _ "github.com/alibaba/higress/test/e2e/conformance/utils/flags" +) diff --git a/test/ingress/conformance/utils/kubernetes/cert.go b/test/e2e/conformance/utils/kubernetes/cert.go similarity index 82% rename from test/ingress/conformance/utils/kubernetes/cert.go rename to test/e2e/conformance/utils/kubernetes/cert.go index 3d13d9d481..85f72a8b26 100644 --- a/test/ingress/conformance/utils/kubernetes/cert.go +++ b/test/e2e/conformance/utils/kubernetes/cert.go @@ -1,16 +1,15 @@ -// Copyright (c) 2022 Alibaba Group Holding Ltd. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* +Copyright 2022 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ package kubernetes @@ -35,7 +34,7 @@ import ( // ensure auth plugins are loaded _ "k8s.io/client-go/plugin/pkg/client/auth" - "github.com/alibaba/higress/test/ingress/conformance/utils/cert" + "github.com/alibaba/higress/test/e2e/conformance/utils/cert" ) // MustCreateSelfSignedCertSecret creates a self-signed SSL certificate and stores it in a secret diff --git a/test/ingress/conformance/utils/kubernetes/helpers.go b/test/e2e/conformance/utils/kubernetes/helpers.go similarity index 84% rename from test/ingress/conformance/utils/kubernetes/helpers.go rename to test/e2e/conformance/utils/kubernetes/helpers.go index 4d5f5d48b2..bddcb1be0b 100644 --- a/test/ingress/conformance/utils/kubernetes/helpers.go +++ b/test/e2e/conformance/utils/kubernetes/helpers.go @@ -1,16 +1,15 @@ -// Copyright (c) 2022 Alibaba Group Holding Ltd. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* +Copyright 2022 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ package kubernetes @@ -26,7 +25,7 @@ import ( "k8s.io/apimachinery/pkg/util/wait" "sigs.k8s.io/controller-runtime/pkg/client" - "github.com/alibaba/higress/test/ingress/conformance/utils/config" + "github.com/alibaba/higress/test/e2e/conformance/utils/config" ) // FilterStaleConditions returns the list of status condition whos observedGeneration does not diff --git a/test/ingress/conformance/utils/roundtripper/roundtripper.go b/test/e2e/conformance/utils/roundtripper/roundtripper.go similarity index 90% rename from test/ingress/conformance/utils/roundtripper/roundtripper.go rename to test/e2e/conformance/utils/roundtripper/roundtripper.go index 0ef92fc637..e1d96e0521 100644 --- a/test/ingress/conformance/utils/roundtripper/roundtripper.go +++ b/test/e2e/conformance/utils/roundtripper/roundtripper.go @@ -1,16 +1,15 @@ -// Copyright (c) 2022 Alibaba Group Holding Ltd. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* +Copyright 2022 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ package roundtripper @@ -26,7 +25,7 @@ import ( "net/url" "regexp" - "github.com/alibaba/higress/test/ingress/conformance/utils/config" + "github.com/alibaba/higress/test/e2e/conformance/utils/config" ) // RoundTripper is an interface used to make requests within conformance tests. diff --git a/test/ingress/conformance/utils/suite/suite.go b/test/e2e/conformance/utils/suite/suite.go similarity index 52% rename from test/ingress/conformance/utils/suite/suite.go rename to test/e2e/conformance/utils/suite/suite.go index fbda05b3c7..b0c91c2f07 100644 --- a/test/ingress/conformance/utils/suite/suite.go +++ b/test/e2e/conformance/utils/suite/suite.go @@ -1,16 +1,15 @@ -// Copyright (c) 2022 Alibaba Group Holding Ltd. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* +Copyright 2022 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ package suite @@ -18,65 +17,24 @@ import ( "fmt" "testing" - "github.com/alibaba/higress/test/ingress/conformance/utils/config" - "github.com/alibaba/higress/test/ingress/conformance/utils/kubernetes" - "github.com/alibaba/higress/test/ingress/conformance/utils/roundtripper" + "github.com/alibaba/higress/test/e2e/conformance/utils/config" + "github.com/alibaba/higress/test/e2e/conformance/utils/kubernetes" + "github.com/alibaba/higress/test/e2e/conformance/utils/roundtripper" "sigs.k8s.io/controller-runtime/pkg/client" ) -// SupportedFeature allows opting in to additional conformance tests at an -// individual feature granularity. -type SupportedFeature string - -const ( - // This option indicates support for TLSRoute (extended conformance). - SupportTLSRoute SupportedFeature = "TLSRoute" - - // This option indicates support for HTTPRoute query param matching (extended conformance). - SupportHTTPRouteQueryParamMatching SupportedFeature = "HTTPRouteQueryParamMatching" - - // This option indicates support for HTTPRoute method matching (extended conformance). - SupportHTTPRouteMethodMatching SupportedFeature = "HTTPRouteMethodMatching" - - // This option indicates support for HTTPRoute response header modification (extended conformance). - SupportHTTPResponseHeaderModification SupportedFeature = "HTTPResponseHeaderModification" - - // This option indicates support for Destination Port matching (extended conformance). - SupportRouteDestinationPortMatching SupportedFeature = "RouteDestinationPortMatching" - - // This option indicates support for HTTPRoute port redirect (extended conformance). - SupportHTTPRoutePortRedirect SupportedFeature = "HTTPRoutePortRedirect" - - // This option indicates support for HTTPRoute scheme redirect (extended conformance). - SupportHTTPRouteSchemeRedirect SupportedFeature = "HTTPRouteSchemeRedirect" - - // This option indicates support for HTTPRoute path redirect (experimental conformance). - SupportHTTPRoutePathRedirect SupportedFeature = "HTTPRoutePathRedirect" - - // This option indicates support for HTTPRoute host rewrite (experimental conformance) - SupportHTTPRouteHostRewrite SupportedFeature = "HTTPRouteHostRewrite" - - // This option indicates support for HTTPRoute path rewrite (experimental conformance) - SupportHTTPRoutePathRewrite SupportedFeature = "HTTPRoutePathRewrite" -) - -// StandardCoreFeatures are the features that are required to be conformant with -// the Core API features that are part of the Standard release channel. -var StandardCoreFeatures = map[SupportedFeature]bool{} - // ConformanceTestSuite defines the test suite used to run Gateway API // conformance tests. type ConformanceTestSuite struct { - Client client.Client - RoundTripper roundtripper.RoundTripper - GatewayAddress string - IngressClassName string - Debug bool - Cleanup bool - BaseManifests string - Applier kubernetes.Applier - SupportedFeatures map[SupportedFeature]bool - TimeoutConfig config.TimeoutConfig + Client client.Client + RoundTripper roundtripper.RoundTripper + GatewayAddress string + IngressClassName string + Debug bool + Cleanup bool + BaseManifests string + Applier kubernetes.Applier + TimeoutConfig config.TimeoutConfig } // Options can be used to initialize a ConformanceTestSuite. @@ -92,7 +50,6 @@ type Options struct { // CleanupBaseResources indicates whether or not the base test // resources such as Gateways should be cleaned up after the run. CleanupBaseResources bool - SupportedFeatures map[SupportedFeature]bool TimeoutConfig config.TimeoutConfig } @@ -105,16 +62,6 @@ func New(s Options) *ConformanceTestSuite { roundTripper = &roundtripper.DefaultRoundTripper{Debug: s.Debug, TimeoutConfig: s.TimeoutConfig} } - if s.SupportedFeatures == nil { - s.SupportedFeatures = StandardCoreFeatures - } else { - for feature, val := range StandardCoreFeatures { - if _, ok := s.SupportedFeatures[feature]; !ok { - s.SupportedFeatures[feature] = val - } - } - } - suite := &ConformanceTestSuite{ Client: s.Client, RoundTripper: roundTripper, @@ -126,8 +73,7 @@ func New(s Options) *ConformanceTestSuite { Applier: kubernetes.Applier{ NamespaceLabels: s.NamespaceLabels, }, - SupportedFeatures: s.SupportedFeatures, - TimeoutConfig: s.TimeoutConfig, + TimeoutConfig: s.TimeoutConfig, } // apply defaults @@ -189,7 +135,6 @@ func globalConformanceTestsListInfo(tests []ConformanceTest) string { type ConformanceTest struct { ShortName string Description string - Features []SupportedFeature Manifests []string Slow bool Parallel bool @@ -203,14 +148,6 @@ func (test *ConformanceTest) Run(t *testing.T, suite *ConformanceTestSuite) { t.Parallel() } - // Check that all features exercised by the test have been opted into by - // the suite. - for _, feature := range test.Features { - if supported, ok := suite.SupportedFeatures[feature]; !ok || !supported { - t.Skipf("Skipping %s: suite does not support %s", test.ShortName, feature) - } - } - for _, manifestLocation := range test.Manifests { t.Logf("Applying %s", manifestLocation) suite.Applier.MustApplyWithCleanup(t, suite.Client, suite.TimeoutConfig, manifestLocation, true) diff --git a/test/ingress/e2e_test.go b/test/e2e/e2e_test.go similarity index 90% rename from test/ingress/e2e_test.go rename to test/e2e/e2e_test.go index 0ec2a31ac0..00ceaf20ad 100644 --- a/test/ingress/e2e_test.go +++ b/test/e2e/e2e_test.go @@ -23,9 +23,9 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/client/config" - "github.com/alibaba/higress/test/ingress/conformance/tests" - "github.com/alibaba/higress/test/ingress/conformance/utils/flags" - "github.com/alibaba/higress/test/ingress/conformance/utils/suite" + "github.com/alibaba/higress/test/e2e/conformance/tests" + "github.com/alibaba/higress/test/e2e/conformance/utils/flags" + "github.com/alibaba/higress/test/e2e/conformance/utils/suite" ) var isWasmPluginTest = flag.Bool("isWasmPluginTest", false, "") @@ -46,7 +46,6 @@ func TestHigressConformanceTests(t *testing.T) { IngressClassName: *flags.IngressClassName, Debug: *flags.ShowDebug, CleanupBaseResources: *flags.CleanupBaseResources, - SupportedFeatures: map[suite.SupportedFeature]bool{}, GatewayAddress: "localhost", }) diff --git a/test/ingress/pipeline.png b/test/e2e/pipeline.png similarity index 100% rename from test/ingress/pipeline.png rename to test/e2e/pipeline.png diff --git a/test/ingress/conformance/utils/config/timeout.go b/test/ingress/conformance/utils/config/timeout.go deleted file mode 100644 index f780f23349..0000000000 --- a/test/ingress/conformance/utils/config/timeout.go +++ /dev/null @@ -1,141 +0,0 @@ -// Copyright (c) 2022 Alibaba Group Holding Ltd. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package config - -import "time" - -type TimeoutConfig struct { - // CreateTimeout represents the maximum time for a Kubernetes object to be created. - // Max value for conformant implementation: None - CreateTimeout time.Duration - - // DeleteTimeout represents the maximum time for a Kubernetes object to be deleted. - // Max value for conformant implementation: None - DeleteTimeout time.Duration - - // GetTimeout represents the maximum time to get a Kubernetes object. - // Max value for conformant implementation: None - GetTimeout time.Duration - - // GatewayMustHaveAddress represents the maximum time for at least one IP Address has been set in the status of a Gateway. - // Max value for conformant implementation: None - GatewayMustHaveAddress time.Duration - - // GatewayStatusMustHaveListeners represents the maximum time for a Gateway to have listeners in status that match the expected listeners. - // Max value for conformant implementation: None - GatewayStatusMustHaveListeners time.Duration - - // GWCMustBeAccepted represents the maximum time for a GatewayClass to have an Accepted condition set to true. - // Max value for conformant implementation: None - GWCMustBeAccepted time.Duration - - // HTTPRouteMustNotHaveParents represents the maximum time for an HTTPRoute to have either no parents or a single parent that is not accepted. - // Max value for conformant implementation: None - HTTPRouteMustNotHaveParents time.Duration - - // HTTPRouteMustHaveCondition represents the maximum time for an HTTPRoute to have the supplied Condition. - // Max value for conformant implementation: None - HTTPRouteMustHaveCondition time.Duration - - // HTTPRouteMustHaveParents represents the maximum time for an HTTPRoute to have parents in status that match the expected parents. - // Max value for conformant implementation: None - HTTPRouteMustHaveParents time.Duration - - // ManifestFetchTimeout represents the maximum time for getting content from a https:// URL. - // Max value for conformant implementation: None - ManifestFetchTimeout time.Duration - - // MaxTimeToConsistency is the maximum time for requiredConsecutiveSuccesses (default 3) requests to succeed in a row before failing the test. - // Max value for conformant implementation: 30 seconds - MaxTimeToConsistency time.Duration - - // NamespacesMustBeReady represents the maximum time for all Pods and Gateways in a namespaces to be marked as ready. - // Max value for conformant implementation: None - NamespacesMustBeReady time.Duration - - // RequestTimeout represents the maximum time for making an HTTP Request with the roundtripper. - // Max value for conformant implementation: None - RequestTimeout time.Duration - - // TLSHandshakeTimeout represents the maximum time for waiting for a TLS handshake. Zero means no timeout. - // Max value for conformant implementation: None - TLSHandshakeTimeout time.Duration -} - -// DefaultTimeoutConfig populates a TimeoutConfig with the default values. -func DefaultTimeoutConfig() TimeoutConfig { - return TimeoutConfig{ - CreateTimeout: 60 * time.Second, - DeleteTimeout: 10 * time.Second, - GetTimeout: 10 * time.Second, - GatewayMustHaveAddress: 180 * time.Second, - GatewayStatusMustHaveListeners: 60 * time.Second, - GWCMustBeAccepted: 180 * time.Second, - HTTPRouteMustNotHaveParents: 60 * time.Second, - HTTPRouteMustHaveCondition: 60 * time.Second, - HTTPRouteMustHaveParents: 60 * time.Second, - ManifestFetchTimeout: 10 * time.Second, - MaxTimeToConsistency: 30 * time.Second, - NamespacesMustBeReady: 300 * time.Second, - RequestTimeout: 10 * time.Second, - TLSHandshakeTimeout: 10 * time.Second, - } -} - -func SetupTimeoutConfig(timeoutConfig *TimeoutConfig) { - defaultTimeoutConfig := DefaultTimeoutConfig() - if timeoutConfig.CreateTimeout == 0 { - timeoutConfig.CreateTimeout = defaultTimeoutConfig.CreateTimeout - } - if timeoutConfig.DeleteTimeout == 0 { - timeoutConfig.DeleteTimeout = defaultTimeoutConfig.DeleteTimeout - } - if timeoutConfig.GetTimeout == 0 { - timeoutConfig.GetTimeout = defaultTimeoutConfig.GetTimeout - } - if timeoutConfig.GatewayMustHaveAddress == 0 { - timeoutConfig.GatewayMustHaveAddress = defaultTimeoutConfig.GatewayMustHaveAddress - } - if timeoutConfig.GatewayStatusMustHaveListeners == 0 { - timeoutConfig.GatewayStatusMustHaveListeners = defaultTimeoutConfig.GatewayStatusMustHaveListeners - } - if timeoutConfig.GWCMustBeAccepted == 0 { - timeoutConfig.GWCMustBeAccepted = defaultTimeoutConfig.GWCMustBeAccepted - } - if timeoutConfig.HTTPRouteMustNotHaveParents == 0 { - timeoutConfig.HTTPRouteMustNotHaveParents = defaultTimeoutConfig.HTTPRouteMustNotHaveParents - } - if timeoutConfig.HTTPRouteMustHaveCondition == 0 { - timeoutConfig.HTTPRouteMustHaveCondition = defaultTimeoutConfig.HTTPRouteMustHaveCondition - } - if timeoutConfig.HTTPRouteMustHaveParents == 0 { - timeoutConfig.HTTPRouteMustHaveParents = defaultTimeoutConfig.HTTPRouteMustHaveParents - } - if timeoutConfig.ManifestFetchTimeout == 0 { - timeoutConfig.ManifestFetchTimeout = defaultTimeoutConfig.ManifestFetchTimeout - } - if timeoutConfig.MaxTimeToConsistency == 0 { - timeoutConfig.MaxTimeToConsistency = defaultTimeoutConfig.MaxTimeToConsistency - } - if timeoutConfig.NamespacesMustBeReady == 0 { - timeoutConfig.NamespacesMustBeReady = defaultTimeoutConfig.NamespacesMustBeReady - } - if timeoutConfig.RequestTimeout == 0 { - timeoutConfig.RequestTimeout = defaultTimeoutConfig.RequestTimeout - } - if timeoutConfig.TLSHandshakeTimeout == 0 { - timeoutConfig.TLSHandshakeTimeout = defaultTimeoutConfig.TLSHandshakeTimeout - } -} diff --git a/test/ingress/conformance/utils/flags/flags.go b/test/ingress/conformance/utils/flags/flags.go deleted file mode 100644 index ef0c1748d9..0000000000 --- a/test/ingress/conformance/utils/flags/flags.go +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) 2022 Alibaba Group Holding Ltd. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package flags - -import ( - "flag" -) - -var ( - IngressClassName = flag.String("ingress-class", "higress", "Name of IngressClass to use for tests") - ShowDebug = flag.Bool("debug", false, "Whether to print debug logs") - CleanupBaseResources = flag.Bool("cleanup-base-resources", true, "Whether to cleanup base test resources after the run") - SupportedFeatures = flag.String("supported-features", "", "Supported features included in conformance tests suites") - ExemptFeatures = flag.String("exempt-features", "", "Exempt Features excluded from conformance tests suites") -) diff --git a/test/ingress/conformance/utils/kubernetes/apply_test.go b/test/ingress/conformance/utils/kubernetes/apply_test.go deleted file mode 100644 index a7d33373d3..0000000000 --- a/test/ingress/conformance/utils/kubernetes/apply_test.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) 2022 Alibaba Group Holding Ltd. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package kubernetes - -import ( - _ "github.com/alibaba/higress/test/ingress/conformance/utils/flags" -)