Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions test/e2e/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ func TestE2E(t *testing.T) {
if tests.IPFamily == "ipv6" {
skipTests = append(skipTests,
tests.DynamicResolverBackendTest.ShortName,
tests.DynamicResolverBackendWithTLSTest.ShortName,
tests.RateLimitCIDRMatchTest.ShortName,
tests.RateLimitMultipleListenersTest.ShortName,
tests.RateLimitGlobalSharedCidrMatchTest.ShortName,
Expand Down
29 changes: 26 additions & 3 deletions test/e2e/tests/httproute_with_dynamic_resolver_backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,14 @@ import (
)

func init() {
ConformanceTests = append(ConformanceTests, DynamicResolverBackendTest)
ConformanceTests = append(ConformanceTests, DynamicResolverBackendTest, DynamicResolverBackendWithTLSTest)
}

var DynamicResolverBackendTest = suite.ConformanceTest{
ShortName: "DynamicResolverBackend",
Description: "Routes with a backend ref to a dynamic resolver backend",
Manifests: []string{
"testdata/httproute-with-dynamic-resolver-backend.yaml",
"testdata/httproute-with-dynamic-resolver-backend-with-tls.yaml",
"testdata/httproute-with-dynamic-resolver-backend-with-tls-system-ca.yaml",
},
Test: func(t *testing.T, suite *suite.ConformanceTestSuite) {
ns := "gateway-conformance-infra"
Expand Down Expand Up @@ -63,6 +61,7 @@ var DynamicResolverBackendTest = suite.ConformanceTest{

http.MakeRequestAndExpectEventuallyConsistentResponse(t, suite.RoundTripper, suite.TimeoutConfig, gwAddr, expectedResponse)
})

t.Run("route to external service with app protocol", func(t *testing.T) {
routeNN := types.NamespacedName{Name: "httproute-with-dynamic-resolver-backend-with-app-protocol", Namespace: ns}
gwAddr := kubernetes.GatewayAndHTTPRoutesMustBeAccepted(t, suite.Client, suite.TimeoutConfig, suite.ControllerName, kubernetes.NewGatewayRef(gwNN), routeNN)
Expand All @@ -85,6 +84,25 @@ var DynamicResolverBackendTest = suite.ConformanceTest{

http.MakeRequestAndExpectEventuallyConsistentResponse(t, suite.RoundTripper, suite.TimeoutConfig, gwAddr, expectedResponse)
})
t.Cleanup(func() {
if t.Failed() {
CollectAndDump(t, suite.RestConfig)
}
})
},
}

var DynamicResolverBackendWithTLSTest = suite.ConformanceTest{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

QQ: why split them into two test? They should be able run in same test for short time cost.

Copy link
Member Author

@zhaohuabing zhaohuabing May 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be easier to debug the flaky when running the non-TLS and TLS in different tests - they didn't fail at the same time in the previous flaky tests.

ShortName: "DynamicResolverBackendWithTLS",
Description: "Routes with a backend ref to a dynamic resolver backend",
Manifests: []string{
"testdata/httproute-with-dynamic-resolver-backend-with-tls.yaml",
"testdata/httproute-with-dynamic-resolver-backend-with-tls-system-ca.yaml",
},
Test: func(t *testing.T, suite *suite.ConformanceTestSuite) {
ns := "gateway-conformance-infra"
gwNN := types.NamespacedName{Name: "same-namespace", Namespace: ns}

t.Run("route to service with TLS", func(t *testing.T) {
routeNN := types.NamespacedName{Name: "httproute-with-dynamic-resolver-backend-tls", Namespace: ns}
gwAddr := kubernetes.GatewayAndHTTPRoutesMustBeAccepted(t, suite.Client, suite.TimeoutConfig, suite.ControllerName, kubernetes.NewGatewayRef(gwNN), routeNN)
Expand Down Expand Up @@ -124,5 +142,10 @@ var DynamicResolverBackendTest = suite.ConformanceTest{
}
http.MakeRequestAndExpectEventuallyConsistentResponse(t, suite.RoundTripper, suite.TimeoutConfig, gwAddr, expectedResponse)
})
t.Cleanup(func() {
if t.Failed() {
CollectAndDump(t, suite.RestConfig)
}
})
},
}