@@ -18,6 +18,7 @@ import (
18
18
)
19
19
20
20
func TestExecuteServers (t * testing.T ) {
21
+ t .Parallel ()
21
22
conf := dataplane.Configuration {
22
23
HTTPServers : []dataplane.VirtualServer {
23
24
{
@@ -145,6 +146,7 @@ func TestExecuteServers(t *testing.T) {
145
146
}
146
147
147
148
func TestExecuteServers_IPFamily (t * testing.T ) {
149
+ t .Parallel ()
148
150
httpServers := []dataplane.VirtualServer {
149
151
{
150
152
IsDefault : true ,
@@ -267,6 +269,7 @@ func TestExecuteServers_IPFamily(t *testing.T) {
267
269
268
270
for _ , test := range tests {
269
271
t .Run (test .msg , func (t * testing.T ) {
272
+ t .Parallel ()
270
273
g := NewWithT (t )
271
274
272
275
gen := GeneratorImpl {}
@@ -284,6 +287,7 @@ func TestExecuteServers_IPFamily(t *testing.T) {
284
287
}
285
288
286
289
func TestExecuteServers_RewriteClientIP (t * testing.T ) {
290
+ t .Parallel ()
287
291
httpServers := []dataplane.VirtualServer {
288
292
{
289
293
IsDefault : true ,
@@ -383,6 +387,7 @@ func TestExecuteServers_RewriteClientIP(t *testing.T) {
383
387
384
388
for _ , test := range tests {
385
389
t .Run (test .msg , func (t * testing.T ) {
390
+ t .Parallel ()
386
391
g := NewWithT (t )
387
392
388
393
gen := GeneratorImpl {}
@@ -400,6 +405,7 @@ func TestExecuteServers_RewriteClientIP(t *testing.T) {
400
405
}
401
406
402
407
func TestExecuteServers_Plus (t * testing.T ) {
408
+ t .Parallel ()
403
409
config := dataplane.Configuration {
404
410
HTTPServers : []dataplane.VirtualServer {
405
411
{
@@ -438,6 +444,7 @@ func TestExecuteServers_Plus(t *testing.T) {
438
444
}
439
445
440
446
func TestExecuteForDefaultServers (t * testing.T ) {
447
+ t .Parallel ()
441
448
testcases := []struct {
442
449
msg string
443
450
httpPorts []int
@@ -506,6 +513,7 @@ func TestExecuteForDefaultServers(t *testing.T) {
506
513
507
514
for _ , tc := range testcases {
508
515
t .Run (tc .msg , func (t * testing.T ) {
516
+ t .Parallel ()
509
517
g := NewWithT (t )
510
518
511
519
gen := GeneratorImpl {}
@@ -527,6 +535,7 @@ func TestExecuteForDefaultServers(t *testing.T) {
527
535
}
528
536
529
537
func TestCreateServers (t * testing.T ) {
538
+ t .Parallel ()
530
539
const (
531
540
sslKeyPairID = "test-keypair"
532
541
)
@@ -1498,6 +1507,7 @@ func modifyMatchPairs(matchPairs httpMatchPairs) httpMatchPairs {
1498
1507
}
1499
1508
1500
1509
func TestCreateServersConflicts (t * testing.T ) {
1510
+ t .Parallel ()
1501
1511
fooGroup := dataplane.BackendGroup {
1502
1512
Source : types.NamespacedName {Namespace : "test" , Name : "route" },
1503
1513
RuleIdx : 0 ,
@@ -1671,6 +1681,7 @@ func TestCreateServersConflicts(t *testing.T) {
1671
1681
1672
1682
for _ , test := range tests {
1673
1683
t .Run (test .name , func (t * testing.T ) {
1684
+ t .Parallel ()
1674
1685
httpServers := []dataplane.VirtualServer {
1675
1686
{
1676
1687
IsDefault : true ,
@@ -1703,6 +1714,7 @@ func TestCreateServersConflicts(t *testing.T) {
1703
1714
}
1704
1715
1705
1716
func TestCreateLocationsRootPath (t * testing.T ) {
1717
+ t .Parallel ()
1706
1718
hrNsName := types.NamespacedName {Namespace : "test" , Name : "route1" }
1707
1719
1708
1720
fooGroup := dataplane.BackendGroup {
@@ -1869,6 +1881,7 @@ func TestCreateLocationsRootPath(t *testing.T) {
1869
1881
1870
1882
for _ , test := range tests {
1871
1883
t .Run (test .name , func (t * testing.T ) {
1884
+ t .Parallel ()
1872
1885
g := NewWithT (t )
1873
1886
1874
1887
locs , httpMatchPair , grpc := createLocations (& dataplane.VirtualServer {
@@ -1883,6 +1896,7 @@ func TestCreateLocationsRootPath(t *testing.T) {
1883
1896
}
1884
1897
1885
1898
func TestCreateReturnValForRedirectFilter (t * testing.T ) {
1899
+ t .Parallel ()
1886
1900
const listenerPortCustom = 123
1887
1901
const listenerPortHTTP = 80
1888
1902
const listenerPortHTTPS = 443
@@ -2005,6 +2019,7 @@ func TestCreateReturnValForRedirectFilter(t *testing.T) {
2005
2019
2006
2020
for _ , test := range tests {
2007
2021
t .Run (test .msg , func (t * testing.T ) {
2022
+ t .Parallel ()
2008
2023
g := NewWithT (t )
2009
2024
2010
2025
result := createReturnValForRedirectFilter (test .filter , test .listenerPort )
@@ -2014,6 +2029,7 @@ func TestCreateReturnValForRedirectFilter(t *testing.T) {
2014
2029
}
2015
2030
2016
2031
func TestCreateRewritesValForRewriteFilter (t * testing.T ) {
2032
+ t .Parallel ()
2017
2033
tests := []struct {
2018
2034
filter * dataplane.HTTPURLRewriteFilter
2019
2035
expected * rewriteConfig
@@ -2131,6 +2147,7 @@ func TestCreateRewritesValForRewriteFilter(t *testing.T) {
2131
2147
2132
2148
for _ , test := range tests {
2133
2149
t .Run (test .msg , func (t * testing.T ) {
2150
+ t .Parallel ()
2134
2151
g := NewWithT (t )
2135
2152
2136
2153
result := createRewritesValForRewriteFilter (test .filter , test .path )
@@ -2140,6 +2157,7 @@ func TestCreateRewritesValForRewriteFilter(t *testing.T) {
2140
2157
}
2141
2158
2142
2159
func TestCreateRouteMatch (t * testing.T ) {
2160
+ t .Parallel ()
2143
2161
testPath := "/internal_loc"
2144
2162
2145
2163
testMethodMatch := helpers .GetPointer ("PUT" )
@@ -2290,6 +2308,7 @@ func TestCreateRouteMatch(t *testing.T) {
2290
2308
}
2291
2309
for _ , tc := range tests {
2292
2310
t .Run (tc .msg , func (t * testing.T ) {
2311
+ t .Parallel ()
2293
2312
g := NewWithT (t )
2294
2313
2295
2314
result := createRouteMatch (tc .match , testPath )
@@ -2299,6 +2318,7 @@ func TestCreateRouteMatch(t *testing.T) {
2299
2318
}
2300
2319
2301
2320
func TestCreateQueryParamKeyValString (t * testing.T ) {
2321
+ t .Parallel ()
2302
2322
g := NewWithT (t )
2303
2323
2304
2324
expected := "key=value"
@@ -2325,6 +2345,7 @@ func TestCreateQueryParamKeyValString(t *testing.T) {
2325
2345
}
2326
2346
2327
2347
func TestCreateHeaderKeyValString (t * testing.T ) {
2348
+ t .Parallel ()
2328
2349
g := NewWithT (t )
2329
2350
2330
2351
expected := "kEy:vALUe"
@@ -2340,6 +2361,7 @@ func TestCreateHeaderKeyValString(t *testing.T) {
2340
2361
}
2341
2362
2342
2363
func TestIsPathOnlyMatch (t * testing.T ) {
2364
+ t .Parallel ()
2343
2365
tests := []struct {
2344
2366
msg string
2345
2367
match dataplane.Match
@@ -2385,6 +2407,7 @@ func TestIsPathOnlyMatch(t *testing.T) {
2385
2407
2386
2408
for _ , tc := range tests {
2387
2409
t .Run (tc .msg , func (t * testing.T ) {
2410
+ t .Parallel ()
2388
2411
g := NewWithT (t )
2389
2412
2390
2413
result := isPathOnlyMatch (tc .match )
@@ -2394,7 +2417,7 @@ func TestIsPathOnlyMatch(t *testing.T) {
2394
2417
}
2395
2418
2396
2419
func TestCreateProxyPass (t * testing.T ) {
2397
- g := NewWithT ( t )
2420
+ t . Parallel ( )
2398
2421
2399
2422
tests := []struct {
2400
2423
rewrite * dataplane.HTTPURLRewriteFilter
@@ -2463,12 +2486,17 @@ func TestCreateProxyPass(t *testing.T) {
2463
2486
}
2464
2487
2465
2488
for _ , tc := range tests {
2466
- result := createProxyPass (tc .grp , tc .rewrite , generateProtocolString (nil , tc .GRPC ), tc .GRPC )
2467
- g .Expect (result ).To (Equal (tc .expected ))
2489
+ t .Run (tc .expected , func (t * testing.T ) {
2490
+ t .Parallel ()
2491
+ g := NewWithT (t )
2492
+ result := createProxyPass (tc .grp , tc .rewrite , generateProtocolString (nil , tc .GRPC ), tc .GRPC )
2493
+ g .Expect (result ).To (Equal (tc .expected ))
2494
+ })
2468
2495
}
2469
2496
}
2470
2497
2471
2498
func TestCreateMatchLocation (t * testing.T ) {
2499
+ t .Parallel ()
2472
2500
g := NewWithT (t )
2473
2501
2474
2502
expectedNoGRPC := http.Location {
@@ -2492,6 +2520,7 @@ func TestCreateMatchLocation(t *testing.T) {
2492
2520
}
2493
2521
2494
2522
func TestGenerateProxySetHeaders (t * testing.T ) {
2523
+ t .Parallel ()
2495
2524
tests := []struct {
2496
2525
filters * dataplane.HTTPFilters
2497
2526
msg string
@@ -2685,6 +2714,7 @@ func TestGenerateProxySetHeaders(t *testing.T) {
2685
2714
2686
2715
for _ , tc := range tests {
2687
2716
t .Run (tc .msg , func (t * testing.T ) {
2717
+ t .Parallel ()
2688
2718
g := NewWithT (t )
2689
2719
2690
2720
headers := generateProxySetHeaders (tc .filters , tc .GRPC )
@@ -2694,7 +2724,7 @@ func TestGenerateProxySetHeaders(t *testing.T) {
2694
2724
}
2695
2725
2696
2726
func TestConvertBackendTLSFromGroup (t * testing.T ) {
2697
- g := NewWithT ( t )
2727
+ t . Parallel ( )
2698
2728
2699
2729
tests := []struct {
2700
2730
expected * http.ProxySSLVerify
@@ -2775,14 +2805,18 @@ func TestConvertBackendTLSFromGroup(t *testing.T) {
2775
2805
}
2776
2806
2777
2807
for _ , tc := range tests {
2778
- t .Run (tc .msg , func (_ * testing.T ) {
2808
+ t .Run (tc .msg , func (t * testing.T ) {
2809
+ t .Parallel ()
2810
+ g := NewWithT (t )
2811
+
2779
2812
result := createProxyTLSFromBackends (tc .grp )
2780
2813
g .Expect (result ).To (Equal (tc .expected ))
2781
2814
})
2782
2815
}
2783
2816
}
2784
2817
2785
2818
func TestGenerateResponseHeaders (t * testing.T ) {
2819
+ t .Parallel ()
2786
2820
tests := []struct {
2787
2821
filters * dataplane.HTTPFilters
2788
2822
msg string
@@ -2842,6 +2876,7 @@ func TestGenerateResponseHeaders(t *testing.T) {
2842
2876
2843
2877
for _ , tc := range tests {
2844
2878
t .Run (tc .msg , func (t * testing.T ) {
2879
+ t .Parallel ()
2845
2880
g := NewWithT (t )
2846
2881
2847
2882
headers := generateResponseHeaders (tc .filters )
@@ -2851,6 +2886,7 @@ func TestGenerateResponseHeaders(t *testing.T) {
2851
2886
}
2852
2887
2853
2888
func TestCreateIncludesFromPolicyGenerateResult (t * testing.T ) {
2889
+ t .Parallel ()
2854
2890
tests := []struct {
2855
2891
name string
2856
2892
files []policies.File
@@ -2896,6 +2932,7 @@ func TestCreateIncludesFromPolicyGenerateResult(t *testing.T) {
2896
2932
2897
2933
for _ , test := range tests {
2898
2934
t .Run (test .name , func (t * testing.T ) {
2935
+ t .Parallel ()
2899
2936
g := NewWithT (t )
2900
2937
2901
2938
includes := createIncludesFromPolicyGenerateResult (test .files )
@@ -2905,6 +2942,7 @@ func TestCreateIncludesFromPolicyGenerateResult(t *testing.T) {
2905
2942
}
2906
2943
2907
2944
func TestCreateIncludeFileResults (t * testing.T ) {
2945
+ t .Parallel ()
2908
2946
servers := []http.Server {
2909
2947
{
2910
2948
Includes : []http.Include {
@@ -2995,6 +3033,7 @@ func TestCreateIncludeFileResults(t *testing.T) {
2995
3033
}
2996
3034
2997
3035
func TestGetIPFamily (t * testing.T ) {
3036
+ t .Parallel ()
2998
3037
test := []struct {
2999
3038
msg string
3000
3039
baseHTTPConfig dataplane.BaseHTTPConfig
@@ -3019,7 +3058,9 @@ func TestGetIPFamily(t *testing.T) {
3019
3058
3020
3059
for _ , tc := range test {
3021
3060
t .Run (tc .msg , func (t * testing.T ) {
3061
+ t .Parallel ()
3022
3062
g := NewWithT (t )
3063
+
3023
3064
result := getIPFamily (tc .baseHTTPConfig )
3024
3065
g .Expect (result ).To (Equal (tc .expected ))
3025
3066
})
0 commit comments