Skip to content

Commit e5535b3

Browse files
authored
reenable TCPRoute e2e test (#10712)
1 parent f3d03ca commit e5535b3

File tree

8 files changed

+88
-110
lines changed

8 files changed

+88
-110
lines changed

.github/workflows/pr-kubernetes-tests.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ jobs:
2525
# NOTE: We use the GitHub action step time (as opposed to the `go test` time), because it is easier to capture
2626

2727
test:
28-
# Feb 18, 2025: 4 minutes
28+
# Feb 27, 2025: 13 minutes
2929
- cluster-name: 'cluster-one'
3030
go-test-args: '-v -timeout=25m'
31-
go-test-run-regex: '^TestKgateway$$/^BasicRouting$$'
31+
go-test-run-regex: '^TestKgateway$$/^BasicRouting$$|^TestKgateway$$/^HTTPRouteServices$$|^TestKgateway$$/^TCPRouteServices$$'
3232

3333
# # Dec 4, 2024: 23 minutes
3434
# - cluster-name: 'cluster-two'

test/gomega/matchers/contain_substrings.go

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
//go:build ignore
2-
31
package matchers
42

53
import (

test/kubernetes/e2e/features/services/httproute/suite.go

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
//go:build ignore
2-
31
package httproute
42

53
import (

test/kubernetes/e2e/features/services/httproute/types.go

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
//go:build ignore
2-
31
package httproute
42

53
import (

test/kubernetes/e2e/features/services/tcproute/suite.go

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
//go:build ignore
2-
31
package tcproute
42

53
import (
@@ -151,7 +149,7 @@ func (s *testingSuite) TestConfigureTCPRouteBackingDestinations() {
151149
tcpRouteManifest: crossNsNoRefGrantTCPRouteManifest,
152150
proxyService: crossNsNoRefGrantProxyService,
153151
proxyDeployment: crossNsNoRefGrantProxyDeployment,
154-
expectedErrorCode: 7,
152+
expectedErrorCode: 56,
155153
ports: []int{8080},
156154
listenerNames: []v1.SectionName{
157155
v1.SectionName(crossNsNoRefGrantListenerName),

test/kubernetes/e2e/features/services/tcproute/types.go

-15
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
//go:build ignore
2-
31
package tcproute
42

53
import (
@@ -88,26 +86,13 @@ var (
8886
ctxTimeout = 5 * time.Minute
8987
timeout = 60 * time.Second
9088

91-
// Proxy resources to be translated
92-
singleSvcNS = &corev1.Namespace{
93-
ObjectMeta: metav1.ObjectMeta{
94-
Name: singleSvcNsName,
95-
},
96-
}
97-
9889
singleGlooProxy = metav1.ObjectMeta{
9990
Name: "single-tcp-gateway",
10091
Namespace: singleSvcNsName,
10192
}
10293
singleSvcProxyDeployment = &appsv1.Deployment{ObjectMeta: singleGlooProxy}
10394
singleSvcProxyService = &corev1.Service{ObjectMeta: singleGlooProxy}
10495

105-
multiSvcNS = &corev1.Namespace{
106-
ObjectMeta: metav1.ObjectMeta{
107-
Name: multiSvcNsName,
108-
},
109-
}
110-
11196
multiGlooProxy = metav1.ObjectMeta{
11297
Name: "multi-tcp-gateway",
11398
Namespace: multiSvcNsName,

test/kubernetes/e2e/tests/kgateway_tests.go

+5-4
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package tests
33
import (
44
"github.com/kgateway-dev/kgateway/v2/test/kubernetes/e2e"
55
"github.com/kgateway-dev/kgateway/v2/test/kubernetes/e2e/features/basicrouting"
6+
67
// "github.com/kgateway-dev/kgateway/v2/test/kubernetes/e2e/features/admin_server"
78
// "github.com/kgateway-dev/kgateway/v2/test/kubernetes/e2e/features/crd_categories"
89
// "github.com/kgateway-dev/kgateway/v2/test/kubernetes/e2e/features/deployer"
@@ -14,8 +15,8 @@ import (
1415
// "github.com/kgateway-dev/kgateway/v2/test/kubernetes/e2e/features/port_routing"
1516
// "github.com/kgateway-dev/kgateway/v2/test/kubernetes/e2e/features/route_delegation"
1617
// "github.com/kgateway-dev/kgateway/v2/test/kubernetes/e2e/features/route_options"
17-
// "github.com/kgateway-dev/kgateway/v2/test/kubernetes/e2e/features/services/httproute"
18-
// "github.com/kgateway-dev/kgateway/v2/test/kubernetes/e2e/features/services/tcproute"
18+
"github.com/kgateway-dev/kgateway/v2/test/kubernetes/e2e/features/services/httproute"
19+
"github.com/kgateway-dev/kgateway/v2/test/kubernetes/e2e/features/services/tcproute"
1920
// "github.com/kgateway-dev/kgateway/v2/test/kubernetes/e2e/features/upstreams"
2021
// "github.com/kgateway-dev/kgateway/v2/test/kubernetes/e2e/features/virtualhost_options"
2122
)
@@ -31,8 +32,8 @@ func KubeGatewaySuiteRunner() e2e.SuiteRunner {
3132
// kubeGatewaySuiteRunner.Register("RouteOptions", route_options.NewTestingSuite)
3233
// kubeGatewaySuiteRunner.Register("VirtualHostOptions", virtualhost_options.NewTestingSuite)
3334
// kubeGatewaySuiteRunner.Register("Upstreams", upstreams.NewTestingSuite)
34-
// kubeGatewaySuiteRunner.Register("HTTPRouteServices", httproute.NewTestingSuite)
35-
// kubeGatewaySuiteRunner.Register("TCPRouteServices", tcproute.NewTestingSuite)
35+
kubeGatewaySuiteRunner.Register("HTTPRouteServices", httproute.NewTestingSuite)
36+
kubeGatewaySuiteRunner.Register("TCPRouteServices", tcproute.NewTestingSuite)
3637
// kubeGatewaySuiteRunner.Register("HeadlessSvc", headless_svc.NewK8sGatewayHeadlessSvcSuite)
3738
// kubeGatewaySuiteRunner.Register("PortRouting", port_routing.NewK8sGatewayTestingSuite)
3839
// kubeGatewaySuiteRunner.Register("RouteDelegation", route_delegation.NewTestingSuite)

test/kubernetes/testutils/assertions/status.go

+80-80
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
//go:build ignore
2-
31
package assertions
42

53
import (
@@ -10,8 +8,9 @@ import (
108
"github.com/onsi/ginkgo/v2"
119
"github.com/onsi/gomega"
1210
"github.com/onsi/gomega/gstruct"
13-
errors "github.com/rotisserie/eris"
14-
"github.com/solo-io/solo-kit/pkg/api/v1/resources/core"
11+
12+
// errors "github.com/rotisserie/eris"
13+
// "github.com/solo-io/solo-kit/pkg/api/v1/resources/core"
1514
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
1615
"k8s.io/apimachinery/pkg/types"
1716
gwv1 "sigs.k8s.io/gateway-api/apis/v1"
@@ -21,92 +20,92 @@ import (
2120
"github.com/kgateway-dev/kgateway/v2/test/helpers"
2221
)
2322

24-
// Checks GetNamespacedStatuses status for gloo installation namespace
25-
func (p *Provider) EventuallyResourceStatusMatchesWarningReasons(getter helpers.InputResourceGetter, desiredStatusReasons []string, desiredReporter string, timeout ...time.Duration) {
26-
ginkgo.GinkgoHelper()
23+
// // Checks GetNamespacedStatuses status for gloo installation namespace
24+
// func (p *Provider) EventuallyResourceStatusMatchesWarningReasons(getter helpers.InputResourceGetter, desiredStatusReasons []string, desiredReporter string, timeout ...time.Duration) {
25+
// ginkgo.GinkgoHelper()
2726

28-
currentTimeout, pollingInterval := helpers.GetTimeouts(timeout...)
29-
gomega.Eventually(func(g gomega.Gomega) {
30-
statusWarningsMatcher := matchers.MatchStatusInNamespace(
31-
p.installContext.InstallNamespace,
32-
gomega.And(matchers.HaveWarningStateWithReasonSubstrings(desiredStatusReasons...), matchers.HaveReportedBy(desiredReporter)),
33-
)
27+
// currentTimeout, pollingInterval := helpers.GetTimeouts(timeout...)
28+
// gomega.Eventually(func(g gomega.Gomega) {
29+
// statusWarningsMatcher := matchers.MatchStatusInNamespace(
30+
// p.installContext.InstallNamespace,
31+
// gomega.And(matchers.HaveWarningStateWithReasonSubstrings(desiredStatusReasons...), matchers.HaveReportedBy(desiredReporter)),
32+
// )
3433

35-
status, err := getResourceNamespacedStatus(getter)
36-
g.Expect(err).NotTo(gomega.HaveOccurred(), "failed to get resource namespaced status")
37-
g.Expect(status).ToNot(gomega.BeNil())
38-
g.Expect(status).To(gomega.HaveValue(statusWarningsMatcher))
39-
}, currentTimeout, pollingInterval).Should(gomega.Succeed())
40-
}
34+
// status, err := getResourceNamespacedStatus(getter)
35+
// g.Expect(err).NotTo(gomega.HaveOccurred(), "failed to get resource namespaced status")
36+
// g.Expect(status).ToNot(gomega.BeNil())
37+
// g.Expect(status).To(gomega.HaveValue(statusWarningsMatcher))
38+
// }, currentTimeout, pollingInterval).Should(gomega.Succeed())
39+
// }
4140

42-
func (p *Provider) EventuallyResourceStatusMatchesRejectedReasons(getter helpers.InputResourceGetter, desiredStatusReasons []string, desiredReporter string, timeout ...time.Duration) {
43-
ginkgo.GinkgoHelper()
41+
// func (p *Provider) EventuallyResourceStatusMatchesRejectedReasons(getter helpers.InputResourceGetter, desiredStatusReasons []string, desiredReporter string, timeout ...time.Duration) {
42+
// ginkgo.GinkgoHelper()
4443

45-
currentTimeout, pollingInterval := helpers.GetTimeouts(timeout...)
46-
gomega.Eventually(func(g gomega.Gomega) {
47-
statusRejectionsMatcher := matchers.MatchStatusInNamespace(
48-
p.installContext.InstallNamespace,
49-
gomega.And(matchers.HaveRejectedStateWithReasonSubstrings(desiredStatusReasons...), matchers.HaveReportedBy(desiredReporter)),
50-
)
44+
// currentTimeout, pollingInterval := helpers.GetTimeouts(timeout...)
45+
// gomega.Eventually(func(g gomega.Gomega) {
46+
// statusRejectionsMatcher := matchers.MatchStatusInNamespace(
47+
// p.installContext.InstallNamespace,
48+
// gomega.And(matchers.HaveRejectedStateWithReasonSubstrings(desiredStatusReasons...), matchers.HaveReportedBy(desiredReporter)),
49+
// )
5150

52-
status, err := getResourceNamespacedStatus(getter)
53-
g.Expect(err).NotTo(gomega.HaveOccurred(), "failed to get resource namespaced status")
54-
g.Expect(status).ToNot(gomega.BeNil())
55-
g.Expect(status).To(gomega.HaveValue(statusRejectionsMatcher))
56-
}, currentTimeout, pollingInterval).Should(gomega.Succeed())
57-
}
51+
// status, err := getResourceNamespacedStatus(getter)
52+
// g.Expect(err).NotTo(gomega.HaveOccurred(), "failed to get resource namespaced status")
53+
// g.Expect(status).ToNot(gomega.BeNil())
54+
// g.Expect(status).To(gomega.HaveValue(statusRejectionsMatcher))
55+
// }, currentTimeout, pollingInterval).Should(gomega.Succeed())
56+
// }
5857

59-
func (p *Provider) EventuallyResourceStatusMatchesState(
60-
getter helpers.InputResourceGetter,
61-
desiredState core.Status_State,
62-
desiredReporter string,
63-
timeout ...time.Duration,
64-
) {
65-
currentTimeout, pollingInterval := helpers.GetTimeouts(timeout...)
66-
p.Gomega.Eventually(func(g gomega.Gomega) {
67-
statusStateMatcher := matchers.MatchStatusInNamespace(
68-
p.installContext.InstallNamespace,
69-
gomega.And(matchers.HaveState(desiredState), matchers.HaveReportedBy(desiredReporter)),
70-
)
71-
status, err := getResourceNamespacedStatus(getter)
72-
g.Expect(err).NotTo(gomega.HaveOccurred(), "failed to get resource namespaced status")
73-
g.Expect(status).ToNot(gomega.BeNil())
74-
g.Expect(status).To(gomega.HaveValue(statusStateMatcher))
75-
}, currentTimeout, pollingInterval).Should(gomega.Succeed())
76-
}
58+
// func (p *Provider) EventuallyResourceStatusMatchesState(
59+
// getter helpers.InputResourceGetter,
60+
// desiredState core.Status_State,
61+
// desiredReporter string,
62+
// timeout ...time.Duration,
63+
// ) {
64+
// currentTimeout, pollingInterval := helpers.GetTimeouts(timeout...)
65+
// p.Gomega.Eventually(func(g gomega.Gomega) {
66+
// statusStateMatcher := matchers.MatchStatusInNamespace(
67+
// p.installContext.InstallNamespace,
68+
// gomega.And(matchers.HaveState(desiredState), matchers.HaveReportedBy(desiredReporter)),
69+
// )
70+
// status, err := getResourceNamespacedStatus(getter)
71+
// g.Expect(err).NotTo(gomega.HaveOccurred(), "failed to get resource namespaced status")
72+
// g.Expect(status).ToNot(gomega.BeNil())
73+
// g.Expect(status).To(gomega.HaveValue(statusStateMatcher))
74+
// }, currentTimeout, pollingInterval).Should(gomega.Succeed())
75+
// }
7776

78-
func (p *Provider) EventuallyResourceStatusMatchesSubResource(
79-
getter helpers.InputResourceGetter,
80-
desiredSubresourceName string,
81-
desiredSubresource matchers.SoloKitSubresourceStatus,
82-
timeout ...time.Duration,
83-
) {
84-
currentTimeout, pollingInterval := helpers.GetTimeouts(timeout...)
85-
p.Gomega.Eventually(func(g gomega.Gomega) {
86-
subResourceStatusMatcher := matchers.HaveSubResourceStatusState(desiredSubresourceName, desiredSubresource)
87-
status, err := getResourceNamespacedStatus(getter)
88-
g.Expect(err).NotTo(gomega.HaveOccurred(), "failed to get resource namespaced status")
89-
g.Expect(status).ToNot(gomega.BeNil())
90-
g.Expect(status).To(gomega.HaveValue(subResourceStatusMatcher))
91-
}, currentTimeout, pollingInterval).Should(gomega.Succeed())
92-
}
77+
// func (p *Provider) EventuallyResourceStatusMatchesSubResource(
78+
// getter helpers.InputResourceGetter,
79+
// desiredSubresourceName string,
80+
// desiredSubresource matchers.SoloKitSubresourceStatus,
81+
// timeout ...time.Duration,
82+
// ) {
83+
// currentTimeout, pollingInterval := helpers.GetTimeouts(timeout...)
84+
// p.Gomega.Eventually(func(g gomega.Gomega) {
85+
// subResourceStatusMatcher := matchers.HaveSubResourceStatusState(desiredSubresourceName, desiredSubresource)
86+
// status, err := getResourceNamespacedStatus(getter)
87+
// g.Expect(err).NotTo(gomega.HaveOccurred(), "failed to get resource namespaced status")
88+
// g.Expect(status).ToNot(gomega.BeNil())
89+
// g.Expect(status).To(gomega.HaveValue(subResourceStatusMatcher))
90+
// }, currentTimeout, pollingInterval).Should(gomega.Succeed())
91+
// }
9392

94-
func getResourceNamespacedStatus(getter helpers.InputResourceGetter) (*core.NamespacedStatuses, error) {
95-
resource, err := getter()
96-
if err != nil {
97-
return &core.NamespacedStatuses{}, errors.Wrapf(err, "failed to get resource")
98-
}
93+
// func getResourceNamespacedStatus(getter helpers.InputResourceGetter) (*core.NamespacedStatuses, error) {
94+
// resource, err := getter()
95+
// if err != nil {
96+
// return &core.NamespacedStatuses{}, errors.Wrapf(err, "failed to get resource")
97+
// }
9998

100-
namespacedStatuses := resource.GetNamespacedStatuses()
99+
// namespacedStatuses := resource.GetNamespacedStatuses()
101100

102-
// In newer versions of Gloo Edge we provide a default "empty" status, which allows us to patch it to perform updates
103-
// As a result, a nil check isn't enough to determine that that status hasn't been reported
104-
if namespacedStatuses == nil || namespacedStatuses.GetStatuses() == nil {
105-
return &core.NamespacedStatuses{}, errors.Wrapf(err, "waiting for %v status to be non-empty", resource.GetMetadata().GetName())
106-
}
101+
// // In newer versions of Gloo Edge we provide a default "empty" status, which allows us to patch it to perform updates
102+
// // As a result, a nil check isn't enough to determine that that status hasn't been reported
103+
// if namespacedStatuses == nil || namespacedStatuses.GetStatuses() == nil {
104+
// return &core.NamespacedStatuses{}, errors.Wrapf(err, "waiting for %v status to be non-empty", resource.GetMetadata().GetName())
105+
// }
107106

108-
return namespacedStatuses, nil
109-
}
107+
// return namespacedStatuses, nil
108+
// }
110109

111110
// EventuallyHTTPRouteStatusContainsMessage asserts that eventually at least one of the HTTPRoute's route parent statuses contains
112111
// the given message substring.
@@ -142,7 +141,8 @@ func (p *Provider) EventuallyHTTPRouteStatusContainsReason(
142141
routeName string,
143142
routeNamespace string,
144143
reason string,
145-
timeout ...time.Duration) {
144+
timeout ...time.Duration,
145+
) {
146146
currentTimeout, pollingInterval := helpers.GetTimeouts(timeout...)
147147
p.Gomega.Eventually(func(g gomega.Gomega) {
148148
matcher := matchers.HaveKubeGatewayRouteStatus(&matchers.KubeGatewayRouteStatus{

0 commit comments

Comments
 (0)