@@ -141,6 +141,7 @@ func TestCiliumCCMLoadBalancers(t *testing.T) {
141
141
f : testCiliumUpdateLoadBalancerAddNodeWithNewIpHolderNamingConvention ,
142
142
},
143
143
}
144
+ //nolint: paralleltest // two tests use t.Setenv, which fails after t.Parallel() call
144
145
for _ , tc := range testCases {
145
146
ctrl := gomock .NewController (t )
146
147
mc := mocks .NewMockClient (ctrl )
@@ -180,13 +181,17 @@ func createTestService() *v1.Service {
180
181
}
181
182
182
183
func addService (t * testing.T , kubeClient kubernetes.Interface , svc * v1.Service ) {
184
+ t .Helper ()
185
+
183
186
_ , err := kubeClient .CoreV1 ().Services (svc .Namespace ).Create (context .TODO (), svc , metav1.CreateOptions {})
184
187
if err != nil {
185
188
t .Fatalf ("failed to add Service: %v" , err )
186
189
}
187
190
}
188
191
189
192
func addNodes (t * testing.T , kubeClient kubernetes.Interface , nodes []* v1.Node ) {
193
+ t .Helper ()
194
+
190
195
for _ , node := range nodes {
191
196
_ , err := kubeClient .CoreV1 ().Nodes ().Create (context .TODO (), node , metav1.CreateOptions {})
192
197
if err != nil {
@@ -206,6 +211,8 @@ func createNewIpHolderInstance() linodego.Instance {
206
211
}
207
212
208
213
func testNoBGPNodeLabel (t * testing.T , mc * mocks.MockClient ) {
214
+ t .Helper ()
215
+
209
216
Options .BGPNodeSelector = ""
210
217
Options .IpHolderSuffix = clusterName
211
218
t .Setenv ("BGP_PEER_PREFIX" , "2600:3cef" )
@@ -255,6 +262,8 @@ func testNoBGPNodeLabel(t *testing.T, mc *mocks.MockClient) {
255
262
}
256
263
257
264
func testUnsupportedRegion (t * testing.T , mc * mocks.MockClient ) {
265
+ t .Helper ()
266
+
258
267
Options .BGPNodeSelector = nodeSelector
259
268
svc := createTestService ()
260
269
@@ -284,6 +293,8 @@ func testUnsupportedRegion(t *testing.T, mc *mocks.MockClient) {
284
293
}
285
294
286
295
func testCreateWithExistingIPHolderWithOldIpHolderNamingConvention (t * testing.T , mc * mocks.MockClient ) {
296
+ t .Helper ()
297
+
287
298
Options .BGPNodeSelector = nodeSelector
288
299
svc := createTestService ()
289
300
newIpHolderInstance = createNewIpHolderInstance ()
@@ -323,6 +334,8 @@ func testCreateWithExistingIPHolderWithOldIpHolderNamingConvention(t *testing.T,
323
334
}
324
335
325
336
func testCreateWithExistingIPHolderWithNewIpHolderNamingConvention (t * testing.T , mc * mocks.MockClient ) {
337
+ t .Helper ()
338
+
326
339
Options .BGPNodeSelector = nodeSelector
327
340
Options .IpHolderSuffix = clusterName
328
341
svc := createTestService ()
@@ -363,6 +376,8 @@ func testCreateWithExistingIPHolderWithNewIpHolderNamingConvention(t *testing.T,
363
376
}
364
377
365
378
func testCreateWithExistingIPHolderWithNewIpHolderNamingConventionUsingLongSuffix (t * testing.T , mc * mocks.MockClient ) {
379
+ t .Helper ()
380
+
366
381
Options .BGPNodeSelector = nodeSelector
367
382
Options .IpHolderSuffix = "OaTJrRuufacHVougjwkpBpmstiqvswvBNEMWXsRYfMBTCkKIUTXpbGIcIbDWSQp"
368
383
svc := createTestService ()
@@ -403,6 +418,8 @@ func testCreateWithExistingIPHolderWithNewIpHolderNamingConventionUsingLongSuffi
403
418
}
404
419
405
420
func testCreateWithNoExistingIPHolderUsingNoSuffix (t * testing.T , mc * mocks.MockClient ) {
421
+ t .Helper ()
422
+
406
423
Options .BGPNodeSelector = nodeSelector
407
424
Options .IpHolderSuffix = ""
408
425
svc := createTestService ()
@@ -447,6 +464,8 @@ func testCreateWithNoExistingIPHolderUsingNoSuffix(t *testing.T, mc *mocks.MockC
447
464
}
448
465
449
466
func testCreateWithNoExistingIPHolderUsingShortSuffix (t * testing.T , mc * mocks.MockClient ) {
467
+ t .Helper ()
468
+
450
469
Options .BGPNodeSelector = nodeSelector
451
470
Options .IpHolderSuffix = clusterName
452
471
svc := createTestService ()
@@ -491,6 +510,8 @@ func testCreateWithNoExistingIPHolderUsingShortSuffix(t *testing.T, mc *mocks.Mo
491
510
}
492
511
493
512
func testCreateWithNoExistingIPHolderUsingLongSuffix (t * testing.T , mc * mocks.MockClient ) {
513
+ t .Helper ()
514
+
494
515
Options .BGPNodeSelector = nodeSelector
495
516
Options .IpHolderSuffix = "OaTJrRuufacHVougjwkpBpmstiqvswvBNEMWXsRYfMBTCkKIUTXpbGIcIbDWSQp"
496
517
svc := createTestService ()
@@ -535,6 +556,8 @@ func testCreateWithNoExistingIPHolderUsingLongSuffix(t *testing.T, mc *mocks.Moc
535
556
}
536
557
537
558
func testEnsureCiliumLoadBalancerDeletedWithOldIpHolderNamingConvention (t * testing.T , mc * mocks.MockClient ) {
559
+ t .Helper ()
560
+
538
561
Options .BGPNodeSelector = nodeSelector
539
562
svc := createTestService ()
540
563
@@ -561,6 +584,8 @@ func testEnsureCiliumLoadBalancerDeletedWithOldIpHolderNamingConvention(t *testi
561
584
}
562
585
563
586
func testEnsureCiliumLoadBalancerDeletedWithNewIpHolderNamingConvention (t * testing.T , mc * mocks.MockClient ) {
587
+ t .Helper ()
588
+
564
589
Options .BGPNodeSelector = nodeSelector
565
590
Options .IpHolderSuffix = clusterName
566
591
svc := createTestService ()
@@ -592,6 +617,8 @@ func testEnsureCiliumLoadBalancerDeletedWithNewIpHolderNamingConvention(t *testi
592
617
}
593
618
594
619
func testCiliumUpdateLoadBalancerAddNodeWithOldIpHolderNamingConvention (t * testing.T , mc * mocks.MockClient ) {
620
+ t .Helper ()
621
+
595
622
Options .BGPNodeSelector = nodeSelector
596
623
svc := createTestService ()
597
624
@@ -648,6 +675,8 @@ func testCiliumUpdateLoadBalancerAddNodeWithOldIpHolderNamingConvention(t *testi
648
675
}
649
676
650
677
func testCiliumUpdateLoadBalancerAddNodeWithNewIpHolderNamingConvention (t * testing.T , mc * mocks.MockClient ) {
678
+ t .Helper ()
679
+
651
680
Options .BGPNodeSelector = nodeSelector
652
681
Options .IpHolderSuffix = clusterName
653
682
svc := createTestService ()
0 commit comments