Skip to content

Commit bf8fc46

Browse files
authoredJan 24, 2023
xds/resolver: cleanup tests to use real xDS client 5/n (#5955)
1 parent 3930549 commit bf8fc46

File tree

5 files changed

+389
-302
lines changed

5 files changed

+389
-302
lines changed
 

‎internal/testutils/xds/e2e/clientresources.go

+8-1
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,14 @@ func DefaultRouteConfig(routeName, ldsTarget, clusterName string) *v3routepb.Rou
296296
Routes: []*v3routepb.Route{{
297297
Match: &v3routepb.RouteMatch{PathSpecifier: &v3routepb.RouteMatch_Prefix{Prefix: "/"}},
298298
Action: &v3routepb.Route_Route{Route: &v3routepb.RouteAction{
299-
ClusterSpecifier: &v3routepb.RouteAction_Cluster{Cluster: clusterName},
299+
ClusterSpecifier: &v3routepb.RouteAction_WeightedClusters{WeightedClusters: &v3routepb.WeightedCluster{
300+
Clusters: []*v3routepb.WeightedCluster_ClusterWeight{
301+
{
302+
Name: clusterName,
303+
Weight: &wrapperspb.UInt32Value{Value: 100},
304+
},
305+
},
306+
}},
300307
}},
301308
}},
302309
}},

‎xds/internal/resolver/xds_resolver_test.go

+368-288
Large diffs are not rendered by default.

‎xds/internal/xdsclient/e2e_test/federation_watchers_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ func (s) TestFederation_RouteConfigResourceContextParamOrder(t *testing.T) {
187187
{
188188
Prefix: newStringP("/"),
189189
ActionType: xdsresource.RouteActionRoute,
190-
WeightedClusters: map[string]xdsresource.WeightedCluster{"cluster-resource": {Weight: 1}},
190+
WeightedClusters: map[string]xdsresource.WeightedCluster{"cluster-resource": {Weight: 100}},
191191
},
192192
},
193193
},

‎xds/internal/xdsclient/e2e_test/misc_watchers_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ func (s) TestWatchCallAnotherWatch(t *testing.T) {
9696
{
9797
Prefix: newStringP("/"),
9898
ActionType: xdsresource.RouteActionRoute,
99-
WeightedClusters: map[string]xdsresource.WeightedCluster{cdsName: {Weight: 1}},
99+
WeightedClusters: map[string]xdsresource.WeightedCluster{cdsName: {Weight: 100}},
100100
},
101101
},
102102
},
@@ -112,7 +112,7 @@ func (s) TestWatchCallAnotherWatch(t *testing.T) {
112112
{
113113
Prefix: newStringP("/"),
114114
ActionType: xdsresource.RouteActionRoute,
115-
WeightedClusters: map[string]xdsresource.WeightedCluster{cdsName: {Weight: 1}},
115+
WeightedClusters: map[string]xdsresource.WeightedCluster{cdsName: {Weight: 100}},
116116
},
117117
},
118118
},

‎xds/internal/xdsclient/e2e_test/rds_watchers_test.go

+10-10
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ func (s) TestRDSWatch(t *testing.T) {
142142
{
143143
Prefix: newStringP("/"),
144144
ActionType: xdsresource.RouteActionRoute,
145-
WeightedClusters: map[string]xdsresource.WeightedCluster{cdsName: {Weight: 1}},
145+
WeightedClusters: map[string]xdsresource.WeightedCluster{cdsName: {Weight: 100}},
146146
},
147147
},
148148
},
@@ -165,7 +165,7 @@ func (s) TestRDSWatch(t *testing.T) {
165165
{
166166
Prefix: newStringP("/"),
167167
ActionType: xdsresource.RouteActionRoute,
168-
WeightedClusters: map[string]xdsresource.WeightedCluster{cdsNameNewStyle: {Weight: 1}},
168+
WeightedClusters: map[string]xdsresource.WeightedCluster{cdsNameNewStyle: {Weight: 100}},
169169
},
170170
},
171171
},
@@ -281,7 +281,7 @@ func (s) TestRDSWatch_TwoWatchesForSameResourceName(t *testing.T) {
281281
{
282282
Prefix: newStringP("/"),
283283
ActionType: xdsresource.RouteActionRoute,
284-
WeightedClusters: map[string]xdsresource.WeightedCluster{cdsName: {Weight: 1}},
284+
WeightedClusters: map[string]xdsresource.WeightedCluster{cdsName: {Weight: 100}},
285285
},
286286
},
287287
},
@@ -297,7 +297,7 @@ func (s) TestRDSWatch_TwoWatchesForSameResourceName(t *testing.T) {
297297
{
298298
Prefix: newStringP("/"),
299299
ActionType: xdsresource.RouteActionRoute,
300-
WeightedClusters: map[string]xdsresource.WeightedCluster{"new-cds-resource": {Weight: 1}},
300+
WeightedClusters: map[string]xdsresource.WeightedCluster{"new-cds-resource": {Weight: 100}},
301301
},
302302
},
303303
},
@@ -319,7 +319,7 @@ func (s) TestRDSWatch_TwoWatchesForSameResourceName(t *testing.T) {
319319
{
320320
Prefix: newStringP("/"),
321321
ActionType: xdsresource.RouteActionRoute,
322-
WeightedClusters: map[string]xdsresource.WeightedCluster{cdsNameNewStyle: {Weight: 1}},
322+
WeightedClusters: map[string]xdsresource.WeightedCluster{cdsNameNewStyle: {Weight: 100}},
323323
},
324324
},
325325
},
@@ -335,7 +335,7 @@ func (s) TestRDSWatch_TwoWatchesForSameResourceName(t *testing.T) {
335335
{
336336
Prefix: newStringP("/"),
337337
ActionType: xdsresource.RouteActionRoute,
338-
WeightedClusters: map[string]xdsresource.WeightedCluster{"new-cds-resource": {Weight: 1}},
338+
WeightedClusters: map[string]xdsresource.WeightedCluster{"new-cds-resource": {Weight: 100}},
339339
},
340340
},
341341
},
@@ -492,7 +492,7 @@ func (s) TestRDSWatch_ThreeWatchesForDifferentResourceNames(t *testing.T) {
492492
{
493493
Prefix: newStringP("/"),
494494
ActionType: xdsresource.RouteActionRoute,
495-
WeightedClusters: map[string]xdsresource.WeightedCluster{cdsName: {Weight: 1}},
495+
WeightedClusters: map[string]xdsresource.WeightedCluster{cdsName: {Weight: 100}},
496496
},
497497
},
498498
},
@@ -577,7 +577,7 @@ func (s) TestRDSWatch_ResourceCaching(t *testing.T) {
577577
{
578578
Prefix: newStringP("/"),
579579
ActionType: xdsresource.RouteActionRoute,
580-
WeightedClusters: map[string]xdsresource.WeightedCluster{cdsName: {Weight: 1}},
580+
WeightedClusters: map[string]xdsresource.WeightedCluster{cdsName: {Weight: 100}},
581581
},
582582
},
583583
},
@@ -713,7 +713,7 @@ func (s) TestRDSWatch_ValidResponseCancelsExpiryTimerBehavior(t *testing.T) {
713713
{
714714
Prefix: newStringP("/"),
715715
ActionType: xdsresource.RouteActionRoute,
716-
WeightedClusters: map[string]xdsresource.WeightedCluster{cdsName: {Weight: 1}},
716+
WeightedClusters: map[string]xdsresource.WeightedCluster{cdsName: {Weight: 100}},
717717
},
718718
},
719719
},
@@ -850,7 +850,7 @@ func (s) TestRDSWatch_PartialValid(t *testing.T) {
850850
{
851851
Prefix: newStringP("/"),
852852
ActionType: xdsresource.RouteActionRoute,
853-
WeightedClusters: map[string]xdsresource.WeightedCluster{cdsName: {Weight: 1}},
853+
WeightedClusters: map[string]xdsresource.WeightedCluster{cdsName: {Weight: 100}},
854854
},
855855
},
856856
},

0 commit comments

Comments
 (0)
Please sign in to comment.