@@ -37,6 +37,7 @@ func getModifiedRef(mod func(ref gatewayv1.BackendRef) gatewayv1.BackendRef) gat
37
37
}
38
38
39
39
func TestValidateRouteBackendRef (t * testing.T ) {
40
+ t .Parallel ()
40
41
tests := []struct {
41
42
expectedCondition conditions.Condition
42
43
name string
@@ -85,6 +86,7 @@ func TestValidateRouteBackendRef(t *testing.T) {
85
86
86
87
for _ , test := range tests {
87
88
t .Run (test .name , func (t * testing.T ) {
89
+ t .Parallel ()
88
90
g := NewWithT (t )
89
91
alwaysTrueRefGrantResolver := func (_ toResource ) bool { return true }
90
92
@@ -97,6 +99,7 @@ func TestValidateRouteBackendRef(t *testing.T) {
97
99
}
98
100
99
101
func TestValidateBackendRef (t * testing.T ) {
102
+ t .Parallel ()
100
103
alwaysFalseRefGrantResolver := func (_ toResource ) bool { return false }
101
104
alwaysTrueRefGrantResolver := func (_ toResource ) bool { return true }
102
105
@@ -204,6 +207,7 @@ func TestValidateBackendRef(t *testing.T) {
204
207
205
208
for _ , test := range tests {
206
209
t .Run (test .name , func (t * testing.T ) {
210
+ t .Parallel ()
207
211
g := NewWithT (t )
208
212
209
213
valid , cond := validateBackendRef (test .ref , "test" , test .refGrantResolver , field .NewPath ("test" ))
@@ -215,6 +219,7 @@ func TestValidateBackendRef(t *testing.T) {
215
219
}
216
220
217
221
func TestValidateWeight (t * testing.T ) {
222
+ t .Parallel ()
218
223
validWeights := []int32 {0 , 1 , 1000000 }
219
224
invalidWeights := []int32 {- 1 , 1000001 }
220
225
@@ -231,6 +236,7 @@ func TestValidateWeight(t *testing.T) {
231
236
}
232
237
233
238
func TestGetIPFamilyAndPortFromRef (t * testing.T ) {
239
+ t .Parallel ()
234
240
svc1 := & v1.Service {
235
241
ObjectMeta : metav1.ObjectMeta {
236
242
Name : "service1" ,
@@ -301,6 +307,7 @@ func TestGetIPFamilyAndPortFromRef(t *testing.T) {
301
307
302
308
for _ , test := range tests {
303
309
t .Run (test .name , func (t * testing.T ) {
310
+ t .Parallel ()
304
311
g := NewWithT (t )
305
312
306
313
svcIPFamily , servicePort , err := getIPFamilyAndPortFromRef (test .ref , test .svcNsName , services , refPath )
@@ -313,6 +320,7 @@ func TestGetIPFamilyAndPortFromRef(t *testing.T) {
313
320
}
314
321
315
322
func TestVerifyIPFamily (t * testing.T ) {
323
+ t .Parallel ()
316
324
test := []struct {
317
325
name string
318
326
expErr error
@@ -377,6 +385,7 @@ func TestVerifyIPFamily(t *testing.T) {
377
385
378
386
for _ , test := range test {
379
387
t .Run (test .name , func (t * testing.T ) {
388
+ t .Parallel ()
380
389
g := NewWithT (t )
381
390
err := verifyIPFamily (test .npCfg , test .svcIPFamily )
382
391
if test .expErr != nil {
@@ -748,6 +757,7 @@ func TestAddBackendRefsToRulesTest(t *testing.T) {
748
757
}
749
758
750
759
func TestCreateBackend (t * testing.T ) {
760
+ t .Parallel ()
751
761
createService := func (name string ) * v1.Service {
752
762
return & v1.Service {
753
763
ObjectMeta : metav1.ObjectMeta {
@@ -1007,6 +1017,7 @@ func TestCreateBackend(t *testing.T) {
1007
1017
1008
1018
for _ , test := range tests {
1009
1019
t .Run (test .name , func (t * testing.T ) {
1020
+ t .Parallel ()
1010
1021
g := NewWithT (t )
1011
1022
1012
1023
alwaysTrueRefGrantResolver := func (_ toResource ) bool { return true }
@@ -1035,6 +1046,7 @@ func TestCreateBackend(t *testing.T) {
1035
1046
}
1036
1047
1037
1048
func TestGetServicePort (t * testing.T ) {
1049
+ t .Parallel ()
1038
1050
svc := & v1.Service {
1039
1051
Spec : v1.ServiceSpec {
1040
1052
Ports : []v1.ServicePort {
@@ -1065,6 +1077,7 @@ func TestGetServicePort(t *testing.T) {
1065
1077
}
1066
1078
1067
1079
func TestValidateBackendTLSPolicyMatchingAllBackends (t * testing.T ) {
1080
+ t .Parallel ()
1068
1081
getBtp := func (name , caCertName string ) * BackendTLSPolicy {
1069
1082
return & BackendTLSPolicy {
1070
1083
Source : & v1alpha3.BackendTLSPolicy {
@@ -1156,6 +1169,7 @@ func TestValidateBackendTLSPolicyMatchingAllBackends(t *testing.T) {
1156
1169
1157
1170
for _ , test := range tests {
1158
1171
t .Run (test .name , func (t * testing.T ) {
1172
+ t .Parallel ()
1159
1173
g := NewWithT (t )
1160
1174
1161
1175
cond := validateBackendTLSPolicyMatchingAllBackends (test .backendRefs )
@@ -1166,6 +1180,7 @@ func TestValidateBackendTLSPolicyMatchingAllBackends(t *testing.T) {
1166
1180
}
1167
1181
1168
1182
func TestFindBackendTLSPolicyForService (t * testing.T ) {
1183
+ t .Parallel ()
1169
1184
oldCreationTimestamp := metav1 .Now ()
1170
1185
newCreationTimestamp := metav1 .Now ()
1171
1186
getBtp := func (name string , timestamp metav1.Time ) * BackendTLSPolicy {
@@ -1231,6 +1246,7 @@ func TestFindBackendTLSPolicyForService(t *testing.T) {
1231
1246
1232
1247
for _ , test := range tests {
1233
1248
t .Run (test .name , func (t * testing.T ) {
1249
+ t .Parallel ()
1234
1250
g := NewWithT (t )
1235
1251
1236
1252
btp , err := findBackendTLSPolicyForService (test .backendTLSPolicies , ref .Namespace , string (ref .Name ), "test" )
@@ -1242,6 +1258,7 @@ func TestFindBackendTLSPolicyForService(t *testing.T) {
1242
1258
}
1243
1259
1244
1260
func TestGetRefGrantFromResourceForRoute (t * testing.T ) {
1261
+ t .Parallel ()
1245
1262
tests := []struct {
1246
1263
name string
1247
1264
routeType RouteType
@@ -1264,13 +1281,15 @@ func TestGetRefGrantFromResourceForRoute(t *testing.T) {
1264
1281
1265
1282
for _ , test := range tests {
1266
1283
t .Run (test .name , func (t * testing.T ) {
1284
+ t .Parallel ()
1267
1285
g := NewWithT (t )
1268
1286
g .Expect (getRefGrantFromResourceForRoute (test .routeType , test .ns )).To (Equal (test .expFromResource ))
1269
1287
})
1270
1288
}
1271
1289
}
1272
1290
1273
1291
func TestGetRefGrantFromResourceForRoute_Panics (t * testing.T ) {
1292
+ t .Parallel ()
1274
1293
g := NewWithT (t )
1275
1294
1276
1295
get := func () {
0 commit comments