@@ -13,7 +13,7 @@ import (
1313 "github.com/teutonet/cluster-api-provider-hosted-control-plane/pkg/reconcilers/alias"
1414 "github.com/teutonet/cluster-api-provider-hosted-control-plane/pkg/reconcilers/etcd_cluster/etcd_client"
1515 "github.com/teutonet/cluster-api-provider-hosted-control-plane/pkg/reconcilers/etcd_cluster/s3_client"
16- "github.com/teutonet/cluster-api-provider-hosted-control-plane/test"
16+ . "github.com/teutonet/cluster-api-provider-hosted-control-plane/test"
1717 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
1818 "k8s.io/apimachinery/pkg/runtime"
1919 "k8s.io/apimachinery/pkg/types"
3434 _ * v1alpha1.HostedControlPlane ,
3535 _ * capiv2.Cluster ,
3636 ) (s3_client.S3Client , error ) {
37- return test . NewS3ClientStub (), nil
37+ return NewS3ClientStub (), nil
3838 }
3939 etcdClientStubFactory = func (
4040 _ context.Context ,
4343 _ * capiv2.Cluster ,
4444 _ int32 ,
4545 ) (etcd_client.EtcdClient , error ) {
46- return test . NewEtcdClientStub (), nil
46+ return NewEtcdClientStub (), nil
4747 }
4848 workloadClusterClientStubFactory = func (
4949 _ context.Context ,
@@ -71,7 +71,7 @@ func createTestReconcilerWithFilter(client client.Client, reconcileFilter string
7171 workloadClusterClientStubFactory ,
7272 etcdClientStubFactory ,
7373 s3ClientStubFactory ,
74- test . NewEtcdVolumeStatsProviderStub (),
74+ NewEtcdVolumeStatsProviderStub (),
7575 & recorder.InfiniteDiscardingFakeRecorder {},
7676 "test-namespace" ,
7777 reconcileFilter ,
@@ -220,7 +220,7 @@ func TestHostedControlPlaneReconciler_ReconcileWorkflow(t *testing.T) {
220220 for _ , tt := range tests {
221221 t .Run (tt .name , func (t * testing.T ) {
222222 ctx := log .IntoContext (t .Context (), log .Log )
223- g := NewWithT (t )
223+ g , _ , _ := G (t )
224224 scheme := runtime .NewScheme ()
225225 g .Expect (capiv2 .AddToScheme (scheme )).To (Succeed ())
226226 g .Expect (v1alpha1 .AddToScheme (scheme )).To (Succeed ())
@@ -270,13 +270,13 @@ func TestHostedControlPlaneReconciler_ReconcileWorkflow(t *testing.T) {
270270
271271func TestHostedControlPlaneReconciler_FinalizerManagement (t * testing.T ) {
272272 scheme := runtime .NewScheme ()
273- g := NewWithT (t )
273+ g , _ , _ := G (t )
274274 g .Expect (v1alpha1 .AddToScheme (scheme )).To (Succeed ())
275275 g .Expect (capiv2 .AddToScheme (scheme )).To (Succeed ())
276276
277277 t .Run ("finalizer behavior during reconcile lifecycle" , func (t * testing.T ) {
278278 ctx := log .IntoContext (t .Context (), log .Log )
279- g := NewWithT (t )
279+ g , _ , _ := G (t )
280280 cluster := createTestCluster ("test-cluster" , "default" )
281281 hostedControlPlane := withReplicas (
282282 withOwnerReference (createTestHostedControlPlane ("test-hcp" , "default" ), cluster ),
@@ -319,7 +319,7 @@ func TestHostedControlPlaneReconciler_FinalizerManagement(t *testing.T) {
319319
320320 t .Run ("finalizer should be removed during deletion" , func (t * testing.T ) {
321321 ctx := log .IntoContext (t .Context (), log .Log )
322- g := NewWithT (t )
322+ g , _ , _ := G (t )
323323 cluster := createTestClusterWithPausedCondition ("test-cluster" , "default" , false )
324324 hostedControlPlane := withDeletion (
325325 withOwnerReference (createTestHostedControlPlane ("test-hcp" , "default" ), cluster ),
@@ -366,13 +366,13 @@ func TestHostedControlPlaneReconciler_FinalizerManagement(t *testing.T) {
366366
367367func TestHostedControlPlaneReconciler_OwnerReferenceValidation (t * testing.T ) {
368368 scheme := runtime .NewScheme ()
369- g := NewWithT (t )
369+ g , _ , _ := G (t )
370370 g .Expect (v1alpha1 .AddToScheme (scheme )).To (Succeed ())
371371 g .Expect (capiv2 .AddToScheme (scheme )).To (Succeed ())
372372
373373 t .Run ("should requeue when owner cluster is not found" , func (t * testing.T ) {
374374 ctx := log .IntoContext (t .Context (), log .Log )
375- g := NewWithT (t )
375+ g , _ , _ := G (t )
376376 hostedControlPlane := createTestHostedControlPlane ("test-hcp" , "default" )
377377
378378 fakeClient := fakeClient .NewClientBuilder ().
@@ -399,7 +399,7 @@ func TestHostedControlPlaneReconciler_OwnerReferenceValidation(t *testing.T) {
399399
400400 t .Run ("should proceed when valid owner cluster is found" , func (t * testing.T ) {
401401 ctx := log .IntoContext (t .Context (), log .Log )
402- g := NewWithT (t )
402+ g , _ , _ := G (t )
403403 cluster := createTestCluster ("test-cluster" , "default" )
404404 hostedControlPlane := withReplicas (
405405 withOwnerReference (createTestHostedControlPlane ("test-hcp" , "default" ), cluster ),
@@ -436,13 +436,13 @@ func TestHostedControlPlaneReconciler_OwnerReferenceValidation(t *testing.T) {
436436
437437func TestHostedControlPlaneReconciler_StatusConditions (t * testing.T ) {
438438 scheme := runtime .NewScheme ()
439- g := NewWithT (t )
439+ g , _ , _ := G (t )
440440 g .Expect (v1alpha1 .AddToScheme (scheme )).To (Succeed ())
441441 g .Expect (capiv2 .AddToScheme (scheme )).To (Succeed ())
442442
443443 t .Run ("should set paused condition when cluster is paused" , func (t * testing.T ) {
444444 ctx := log .IntoContext (t .Context (), log .Log )
445- g := NewWithT (t )
445+ g , _ , _ := G (t )
446446 cluster := withPaused (createTestCluster ("test-cluster" , "default" ), true )
447447 hostedControlPlane := withOwnerReference (createTestHostedControlPlane ("test-hcp" , "default" ), cluster )
448448
@@ -488,7 +488,7 @@ func TestHostedControlPlaneReconciler_StatusConditions(t *testing.T) {
488488
489489func TestHostedControlPlaneReconciler_ObservedGeneration (t * testing.T ) {
490490 scheme := runtime .NewScheme ()
491- g := NewWithT (t )
491+ g , _ , _ := G (t )
492492 g .Expect (v1alpha1 .AddToScheme (scheme )).To (Succeed ())
493493 g .Expect (capiv2 .AddToScheme (scheme )).To (Succeed ())
494494
@@ -540,7 +540,7 @@ func TestHostedControlPlaneReconciler_ObservedGeneration(t *testing.T) {
540540 for _ , tt := range tests {
541541 t .Run (tt .name , func (t * testing.T ) {
542542 ctx := log .IntoContext (t .Context (), log .Log )
543- g := NewWithT (t )
543+ g , _ , _ := G (t )
544544
545545 objs := []client.Object {tt .hostedControlPlane }
546546 if tt .cluster != nil {
@@ -590,7 +590,7 @@ func TestHostedControlPlaneReconciler_ObservedGeneration(t *testing.T) {
590590
591591func TestHostedControlPlaneReconciler_NonExistentResource (t * testing.T ) {
592592 scheme := runtime .NewScheme ()
593- g := NewWithT (t )
593+ g , _ , _ := G (t )
594594 g .Expect (v1alpha1 .AddToScheme (scheme )).To (Succeed ())
595595
596596 fakeClient := fakeClient .NewClientBuilder ().
@@ -613,7 +613,7 @@ func TestHostedControlPlaneReconciler_NonExistentResource(t *testing.T) {
613613
614614func TestHostedControlPlaneReconciler_ReconcileFilter (t * testing.T ) {
615615 scheme := runtime .NewScheme ()
616- g := NewWithT (t )
616+ g , _ , _ := G (t )
617617 g .Expect (v1alpha1 .AddToScheme (scheme )).To (Succeed ())
618618 g .Expect (capiv2 .AddToScheme (scheme )).To (Succeed ())
619619
@@ -644,7 +644,7 @@ func TestHostedControlPlaneReconciler_ReconcileFilter(t *testing.T) {
644644 hasFinalizer := func (t * testing.T , fc client.Client ) bool {
645645 t .Helper ()
646646 updated := & v1alpha1.HostedControlPlane {}
647- g := NewWithT (t )
647+ g , _ , _ := G (t )
648648 g .Expect (fc .Get (t .Context (), req .NamespacedName , updated )).To (Succeed ())
649649 return len (updated .Finalizers ) > 0
650650 }
@@ -693,7 +693,7 @@ func TestHostedControlPlaneReconciler_ReconcileFilter(t *testing.T) {
693693
694694 for _ , tt := range tests {
695695 t .Run (tt .name , func (t * testing.T ) {
696- g := NewWithT (t )
696+ g , _ , _ := G (t )
697697 fc := buildClient ()
698698 reconciler := createTestReconcilerWithFilter (fc , tt .filter )
699699
0 commit comments