@@ -30,6 +30,7 @@ import (
30
30
)
31
31
32
32
func TestHasCorrectIngressClass (t * testing.T ) {
33
+ t .Parallel ()
33
34
ingressClass := "ing-ctrl"
34
35
incorrectIngressClass := "gce"
35
36
emptyClass := ""
@@ -172,6 +173,7 @@ func deepCopyWithIngressClass(obj interface{}, class string) interface{} {
172
173
}
173
174
174
175
func TestIngressClassForCustomResources (t * testing.T ) {
176
+ t .Parallel ()
175
177
ctrl := & LoadBalancerController {
176
178
ingressClass : "nginx" ,
177
179
}
@@ -221,6 +223,7 @@ func TestIngressClassForCustomResources(t *testing.T) {
221
223
}
222
224
223
225
func TestComparePorts (t * testing.T ) {
226
+ t .Parallel ()
224
227
scenarios := []struct {
225
228
sp api_v1.ServicePort
226
229
cp api_v1.ContainerPort
@@ -314,6 +317,7 @@ func TestComparePorts(t *testing.T) {
314
317
}
315
318
316
319
func TestFindProbeForPods (t * testing.T ) {
320
+ t .Parallel ()
317
321
pods := []* api_v1.Pod {
318
322
{
319
323
Spec : api_v1.PodSpec {
@@ -404,6 +408,7 @@ func TestFindProbeForPods(t *testing.T) {
404
408
}
405
409
406
410
func TestGetServicePortForIngressPort (t * testing.T ) {
411
+ t .Parallel ()
407
412
fakeClient := fake .NewSimpleClientset ()
408
413
cnf := configs .NewConfigurator (& nginx.LocalManager {}, & configs.StaticConfigParams {}, & configs.ConfigParams {}, & version1.TemplateExecutor {}, & version2.TemplateExecutor {}, false , false , nil , false , nil , false )
409
414
lbc := LoadBalancerController {
@@ -462,6 +467,7 @@ func TestGetServicePortForIngressPort(t *testing.T) {
462
467
}
463
468
464
469
func TestFormatWarningsMessages (t * testing.T ) {
470
+ t .Parallel ()
465
471
warnings := []string {"Test warning" , "Test warning 2" }
466
472
467
473
expected := "Test warning; Test warning 2"
@@ -473,6 +479,7 @@ func TestFormatWarningsMessages(t *testing.T) {
473
479
}
474
480
475
481
func TestGetEndpointsFromEndpointSlices_DuplicateEndpointsInOneEndpointSlice (t * testing.T ) {
482
+ t .Parallel ()
476
483
endpointPort := int32 (8080 )
477
484
478
485
lbc := LoadBalancerController {
@@ -561,6 +568,7 @@ func TestGetEndpointsFromEndpointSlices_DuplicateEndpointsInOneEndpointSlice(t *
561
568
}
562
569
563
570
func TestGetEndpointsFromEndpointSlices_TwoDifferentEndpointsInOnEndpointSlice (t * testing.T ) {
571
+ t .Parallel ()
564
572
endpointPort := int32 (8080 )
565
573
566
574
lbc := LoadBalancerController {
@@ -651,6 +659,7 @@ func TestGetEndpointsFromEndpointSlices_TwoDifferentEndpointsInOnEndpointSlice(t
651
659
}
652
660
653
661
func TestGetEndpointsFromEndpointSlices_DuplicateEndpointsAcrossTwoEndpointSlices (t * testing.T ) {
662
+ t .Parallel ()
654
663
endpointPort := int32 (8080 )
655
664
656
665
lbc := LoadBalancerController {
@@ -770,6 +779,7 @@ func TestGetEndpointsFromEndpointSlices_DuplicateEndpointsAcrossTwoEndpointSlice
770
779
}
771
780
772
781
func TestGetEndpointsFromEndpointSlices_TwoDifferentEndpointsInOnEndpointSliceOneEndpointNotReady (t * testing.T ) {
782
+ t .Parallel ()
773
783
endpointPort := int32 (8080 )
774
784
775
785
lbc := LoadBalancerController {
@@ -858,6 +868,7 @@ func TestGetEndpointsFromEndpointSlices_TwoDifferentEndpointsInOnEndpointSliceOn
858
868
}
859
869
860
870
func TestGetEndpointsFromEndpointSlices_TwoDifferentEndpointsAcrossTwoEndpointSlicesOneEndpointNotReady (t * testing.T ) {
871
+ t .Parallel ()
861
872
endpointPort := int32 (8080 )
862
873
863
874
lbc := LoadBalancerController {
@@ -956,6 +967,7 @@ func TestGetEndpointsFromEndpointSlices_TwoDifferentEndpointsAcrossTwoEndpointSl
956
967
}
957
968
958
969
func TestGetEndpointsFromEndpointSlices_ErrorsOnInvalidTargetPort (t * testing.T ) {
970
+ t .Parallel ()
959
971
endpointPort := int32 (8080 )
960
972
961
973
lbc := LoadBalancerController {
@@ -1027,6 +1039,7 @@ func TestGetEndpointsFromEndpointSlices_ErrorsOnInvalidTargetPort(t *testing.T)
1027
1039
}
1028
1040
1029
1041
func TestGetEndpointsFromEndpointSlices_ErrorsOnNoEndpointSlicesFound (t * testing.T ) {
1042
+ t .Parallel ()
1030
1043
lbc := LoadBalancerController {
1031
1044
isNginxPlus : true ,
1032
1045
}
@@ -1076,6 +1089,7 @@ func TestGetEndpointsFromEndpointSlices_ErrorsOnNoEndpointSlicesFound(t *testing
1076
1089
}
1077
1090
1078
1091
func TestGetEndpointSlicesBySubselectedPods_FindOnePodInOneEndpointSlice (t * testing.T ) {
1092
+ t .Parallel ()
1079
1093
endpointPort := int32 (8080 )
1080
1094
endpointReady := true
1081
1095
boolPointer := func (b bool ) * bool { return & b }
@@ -1148,6 +1162,7 @@ func TestGetEndpointSlicesBySubselectedPods_FindOnePodInOneEndpointSlice(t *test
1148
1162
}
1149
1163
1150
1164
func TestGetEndpointSlicesBySubselectedPods_FindOnePodInTwoEndpointSlicesWithDuplicateEndpoints (t * testing.T ) {
1165
+ t .Parallel ()
1151
1166
endpointPort := int32 (8080 )
1152
1167
endpointReady := true
1153
1168
boolPointer := func (b bool ) * bool { return & b }
@@ -1237,6 +1252,7 @@ func TestGetEndpointSlicesBySubselectedPods_FindOnePodInTwoEndpointSlicesWithDup
1237
1252
}
1238
1253
1239
1254
func TestGetEndpointSlicesBySubselectedPods_FindTwoPodsInOneEndpointSlice (t * testing.T ) {
1255
+ t .Parallel ()
1240
1256
endpointPort := int32 (8080 )
1241
1257
endpointReady := true
1242
1258
boolPointer := func (b bool ) * bool { return & b }
@@ -1338,6 +1354,7 @@ func TestGetEndpointSlicesBySubselectedPods_FindTwoPodsInOneEndpointSlice(t *tes
1338
1354
}
1339
1355
1340
1356
func TestGetEndpointSlicesBySubselectedPods_FindTwoPodsInTwoEndpointSlices (t * testing.T ) {
1357
+ t .Parallel ()
1341
1358
endpointPort := int32 (8080 )
1342
1359
endpointReady := true
1343
1360
boolPointer := func (b bool ) * bool { return & b }
@@ -1448,6 +1465,7 @@ func TestGetEndpointSlicesBySubselectedPods_FindTwoPodsInTwoEndpointSlices(t *te
1448
1465
}
1449
1466
1450
1467
func TestGetEndpointSlicesBySubselectedPods_FindOnePodEndpointInOneEndpointSliceWithOneEndpointNotReady (t * testing.T ) {
1468
+ t .Parallel ()
1451
1469
endpointPort := int32 (8080 )
1452
1470
endpointReadyTrue := true
1453
1471
endpointReadyFalse := false
@@ -1543,6 +1561,7 @@ func TestGetEndpointSlicesBySubselectedPods_FindOnePodEndpointInOneEndpointSlice
1543
1561
}
1544
1562
1545
1563
func TestGetEndpointSlicesBySubselectedPods_FindOnePodEndpointInTwoEndpointSlicesWithOneEndpointNotReady (t * testing.T ) {
1564
+ t .Parallel ()
1546
1565
endpointPort := int32 (8080 )
1547
1566
endpointReadyTrue := true
1548
1567
endpointReadyFalse := false
@@ -1647,6 +1666,7 @@ func TestGetEndpointSlicesBySubselectedPods_FindOnePodEndpointInTwoEndpointSlice
1647
1666
}
1648
1667
1649
1668
func TestGetEndpointSlicesBySubselectedPods_FindNoPods (t * testing.T ) {
1669
+ t .Parallel ()
1650
1670
endpointPort := int32 (8080 )
1651
1671
endpointReady := true
1652
1672
boolPointer := func (b bool ) * bool { return & b }
@@ -1711,6 +1731,7 @@ func TestGetEndpointSlicesBySubselectedPods_FindNoPods(t *testing.T) {
1711
1731
}
1712
1732
1713
1733
func TestGetEndpointSlicesBySubselectedPods_TargetPortMismatch (t * testing.T ) {
1734
+ t .Parallel ()
1714
1735
endpointPort := int32 (8080 )
1715
1736
1716
1737
boolPointer := func (b bool ) * bool { return & b }
@@ -1788,6 +1809,7 @@ func unorderedEqual(got, want []podEndpoint) bool {
1788
1809
}
1789
1810
1790
1811
func TestGetStatusFromEventTitle (t * testing.T ) {
1812
+ t .Parallel ()
1791
1813
tests := []struct {
1792
1814
eventTitle string
1793
1815
expected string
@@ -1847,6 +1869,7 @@ func TestGetStatusFromEventTitle(t *testing.T) {
1847
1869
}
1848
1870
1849
1871
func TestGetPolicies (t * testing.T ) {
1872
+ t .Parallel ()
1850
1873
validPolicy := & conf_v1.Policy {
1851
1874
ObjectMeta : meta_v1.ObjectMeta {
1852
1875
Name : "valid-policy" ,
@@ -1946,6 +1969,7 @@ func TestGetPolicies(t *testing.T) {
1946
1969
}
1947
1970
1948
1971
func TestCreatePolicyMap (t * testing.T ) {
1972
+ t .Parallel ()
1949
1973
policies := []* conf_v1.Policy {
1950
1974
{
1951
1975
ObjectMeta : meta_v1.ObjectMeta {
@@ -2001,6 +2025,7 @@ func TestCreatePolicyMap(t *testing.T) {
2001
2025
}
2002
2026
2003
2027
func TestGetPodOwnerTypeAndName (t * testing.T ) {
2028
+ t .Parallel ()
2004
2029
tests := []struct {
2005
2030
desc string
2006
2031
expType string
@@ -2144,6 +2169,7 @@ func (t *testResource) String() string {
2144
2169
}
2145
2170
2146
2171
func TestRemoveDuplicateResources (t * testing.T ) {
2172
+ t .Parallel ()
2147
2173
tests := []struct {
2148
2174
resources []Resource
2149
2175
expected []Resource
@@ -2182,6 +2208,7 @@ func TestRemoveDuplicateResources(t *testing.T) {
2182
2208
}
2183
2209
2184
2210
func TestFindPoliciesForSecret (t * testing.T ) {
2211
+ t .Parallel ()
2185
2212
jwtPol1 := & conf_v1.Policy {
2186
2213
ObjectMeta : meta_v1.ObjectMeta {
2187
2214
Name : "jwt-policy" ,
@@ -2398,6 +2425,7 @@ func errorComparer(e1, e2 error) bool {
2398
2425
}
2399
2426
2400
2427
func TestAddJWTSecrets (t * testing.T ) {
2428
+ t .Parallel ()
2401
2429
invalidErr := errors .New ("invalid" )
2402
2430
validJWKSecret := & api_v1.Secret {
2403
2431
ObjectMeta : meta_v1.ObjectMeta {
@@ -2542,6 +2570,7 @@ func TestAddJWTSecrets(t *testing.T) {
2542
2570
}
2543
2571
2544
2572
func TestAddBasicSecrets (t * testing.T ) {
2573
+ t .Parallel ()
2545
2574
invalidErr := errors .New ("invalid" )
2546
2575
validBasicSecret := & api_v1.Secret {
2547
2576
ObjectMeta : meta_v1.ObjectMeta {
@@ -2666,6 +2695,7 @@ func TestAddBasicSecrets(t *testing.T) {
2666
2695
}
2667
2696
2668
2697
func TestAddIngressMTLSSecret (t * testing.T ) {
2698
+ t .Parallel ()
2669
2699
invalidErr := errors .New ("invalid" )
2670
2700
validSecret := & api_v1.Secret {
2671
2701
ObjectMeta : meta_v1.ObjectMeta {
@@ -2788,6 +2818,7 @@ func TestAddIngressMTLSSecret(t *testing.T) {
2788
2818
}
2789
2819
2790
2820
func TestAddEgressMTLSSecrets (t * testing.T ) {
2821
+ t .Parallel ()
2791
2822
invalidErr := errors .New ("invalid" )
2792
2823
validMTLSSecret := & api_v1.Secret {
2793
2824
ObjectMeta : meta_v1.ObjectMeta {
@@ -3005,6 +3036,7 @@ func TestAddEgressMTLSSecrets(t *testing.T) {
3005
3036
}
3006
3037
3007
3038
func TestAddOidcSecret (t * testing.T ) {
3039
+ t .Parallel ()
3008
3040
invalidErr := errors .New ("invalid" )
3009
3041
validSecret := & api_v1.Secret {
3010
3042
ObjectMeta : meta_v1.ObjectMeta {
@@ -3128,6 +3160,7 @@ func TestAddOidcSecret(t *testing.T) {
3128
3160
}
3129
3161
3130
3162
func TestAddWAFPolicyRefs (t * testing.T ) {
3163
+ t .Parallel ()
3131
3164
apPol := & unstructured.Unstructured {
3132
3165
Object : map [string ]interface {}{
3133
3166
"metadata" : map [string ]interface {}{
@@ -3358,6 +3391,7 @@ func TestAddWAFPolicyRefs(t *testing.T) {
3358
3391
}
3359
3392
3360
3393
func TestGetWAFPoliciesForAppProtectPolicy (t * testing.T ) {
3394
+ t .Parallel ()
3361
3395
apPol := & conf_v1.Policy {
3362
3396
Spec : conf_v1.PolicySpec {
3363
3397
WAF : & conf_v1.WAF {
@@ -3435,6 +3469,7 @@ func TestGetWAFPoliciesForAppProtectPolicy(t *testing.T) {
3435
3469
}
3436
3470
3437
3471
func TestGetWAFPoliciesForAppProtectLogConf (t * testing.T ) {
3472
+ t .Parallel ()
3438
3473
logConf := & conf_v1.Policy {
3439
3474
Spec : conf_v1.PolicySpec {
3440
3475
WAF : & conf_v1.WAF {
@@ -3541,6 +3576,7 @@ func TestGetWAFPoliciesForAppProtectLogConf(t *testing.T) {
3541
3576
}
3542
3577
3543
3578
func TestPreSyncSecrets (t * testing.T ) {
3579
+ t .Parallel ()
3544
3580
secretLister := & cache.FakeCustomStore {
3545
3581
ListFunc : func () []interface {} {
3546
3582
return []interface {}{
0 commit comments