Skip to content

Commit 154f9f9

Browse files
authored
Merge pull request #3671 from tasdikrahman/cloud-package-refactor-spec-names-camel-cased
refactor: Makes specs for cloud package conformant to a standard naming convention
2 parents 02cf0bf + 490d7cc commit 154f9f9

File tree

12 files changed

+35
-33
lines changed

12 files changed

+35
-33
lines changed

pkg/cloud/scope/machine_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ func TestGetRawBootstrapDataIsNotBase64Encoded(t *testing.T) {
169169
}
170170
}
171171

172-
func Test_GetRawBootstrapDataWithFormat(t *testing.T) {
172+
func TestGetRawBootstrapDataWithFormat(t *testing.T) {
173173
t.Run("returns_empty_format_when_format_is_not_set_in_bootstrap_data", func(t *testing.T) {
174174
scope, err := setupMachineScope()
175175
if err != nil {
@@ -258,7 +258,7 @@ func TestUseSecretsManagerTrue(t *testing.T) {
258258
}
259259
}
260260

261-
func Test_UseIgnition(t *testing.T) {
261+
func TestUseIgnition(t *testing.T) {
262262
t.Run("returns_true_when_given_bootstrap_data_format_is_ignition", func(t *testing.T) {
263263
scope, err := setupMachineScope()
264264
if err != nil {
@@ -283,7 +283,7 @@ func Test_UseIgnition(t *testing.T) {
283283
})
284284
}
285285

286-
func Test_CompressUserData(t *testing.T) {
286+
func TestCompressUserData(t *testing.T) {
287287
// Ignition does not support compressed data in S3.
288288
t.Run("returns_false_when_bootstrap_data_is_in_ignition_format", func(t *testing.T) {
289289
scope, err := setupMachineScope()

pkg/cloud/services/autoscaling/autoscalinggroup_test.go

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ import (
4141
expclusterv1 "sigs.k8s.io/cluster-api/exp/api/v1beta1"
4242
)
4343

44-
func TestService_GetASGByName(t *testing.T) {
44+
func TestServiceGetASGByName(t *testing.T) {
4545
mockCtrl := gomock.NewController(t)
4646
defer mockCtrl.Finish()
4747
tests := []struct {
@@ -128,7 +128,7 @@ func TestService_GetASGByName(t *testing.T) {
128128
}
129129
}
130130

131-
func TestService_SDKToAutoScalingGroup(t *testing.T) {
131+
func TestServiceSDKToAutoScalingGroup(t *testing.T) {
132132
tests := []struct {
133133
name string
134134
input *autoscaling.Group
@@ -294,7 +294,7 @@ func TestService_SDKToAutoScalingGroup(t *testing.T) {
294294
}
295295
}
296296

297-
func TestService_ASGIfExists(t *testing.T) {
297+
func TestServiceASGIfExists(t *testing.T) {
298298
mockCtrl := gomock.NewController(t)
299299
defer mockCtrl.Finish()
300300

@@ -385,7 +385,7 @@ func TestService_ASGIfExists(t *testing.T) {
385385
}
386386
}
387387

388-
func TestService_CreateASG(t *testing.T) {
388+
func TestServiceCreateASG(t *testing.T) {
389389
mockCtrl := gomock.NewController(t)
390390
defer mockCtrl.Finish()
391391
tests := []struct {
@@ -536,7 +536,7 @@ func TestService_CreateASG(t *testing.T) {
536536
}
537537
}
538538

539-
func TestService_UpdateASG(t *testing.T) {
539+
func TestServiceUpdateASG(t *testing.T) {
540540
mockCtrl := gomock.NewController(t)
541541
defer mockCtrl.Finish()
542542

@@ -593,7 +593,7 @@ func TestService_UpdateASG(t *testing.T) {
593593
}
594594
}
595595

596-
func TestService_UpdateASGWithSubnetFilters(t *testing.T) {
596+
func TestServiceUpdateASGWithSubnetFilters(t *testing.T) {
597597
mockCtrl := gomock.NewController(t)
598598
defer mockCtrl.Finish()
599599

@@ -662,7 +662,7 @@ func TestService_UpdateASGWithSubnetFilters(t *testing.T) {
662662
}
663663
}
664664

665-
func TestService_UpdateResourceTags(t *testing.T) {
665+
func TestServiceUpdateResourceTags(t *testing.T) {
666666
mockCtrl := gomock.NewController(t)
667667
defer mockCtrl.Finish()
668668

@@ -778,7 +778,7 @@ func TestService_UpdateResourceTags(t *testing.T) {
778778
}
779779
}
780780

781-
func TestService_DeleteASG(t *testing.T) {
781+
func TestServiceDeleteASG(t *testing.T) {
782782
mockCtrl := gomock.NewController(t)
783783
defer mockCtrl.Finish()
784784

@@ -829,7 +829,7 @@ func TestService_DeleteASG(t *testing.T) {
829829
}
830830
}
831831

832-
func TestService_DeleteASGAndWait(t *testing.T) {
832+
func TestServiceDeleteASGAndWait(t *testing.T) {
833833
mockCtrl := gomock.NewController(t)
834834
defer mockCtrl.Finish()
835835

@@ -899,7 +899,7 @@ func TestService_DeleteASGAndWait(t *testing.T) {
899899
}
900900
}
901901

902-
func TestService_CanStartASGInstanceRefresh(t *testing.T) {
902+
func TestServiceCanStartASGInstanceRefresh(t *testing.T) {
903903
mockCtrl := gomock.NewController(t)
904904
defer mockCtrl.Finish()
905905

@@ -977,7 +977,7 @@ func TestService_CanStartASGInstanceRefresh(t *testing.T) {
977977
}
978978
}
979979

980-
func TestService_StartASGInstanceRefresh(t *testing.T) {
980+
func TestServiceStartASGInstanceRefresh(t *testing.T) {
981981
mockCtrl := gomock.NewController(t)
982982
defer mockCtrl.Finish()
983983

pkg/cloud/services/ec2/ami_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ import (
3232
"sigs.k8s.io/cluster-api-provider-aws/test/mocks"
3333
)
3434

35-
func Test_DefaultAMILookup(t *testing.T) {
35+
func TestDefaultAMILookup(t *testing.T) {
3636
mockCtrl := gomock.NewController(t)
3737
defer mockCtrl.Finish()
3838

pkg/cloud/services/ec2/bastion_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ import (
3636
clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
3737
)
3838

39-
func TestService_DeleteBastion(t *testing.T) {
39+
func TestServiceDeleteBastion(t *testing.T) {
4040
clusterName := "cluster"
4141

4242
describeInput := &ec2.DescribeInstancesInput{
@@ -226,7 +226,7 @@ func TestService_DeleteBastion(t *testing.T) {
226226
}
227227
}
228228

229-
func TestService_ReconcileBastion(t *testing.T) {
229+
func TestServiceReconcileBastion(t *testing.T) {
230230
clusterName := "cluster"
231231

232232
describeInput := &ec2.DescribeInstancesInput{

pkg/cloud/services/ec2/launchtemplate_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ func TestGetLaunchTemplate(t *testing.T) {
290290
}
291291
}
292292

293-
func TestService_SDKToLaunchTemplate(t *testing.T) {
293+
func TestServiceSDKToLaunchTemplate(t *testing.T) {
294294
tests := []struct {
295295
name string
296296
input *ec2.LaunchTemplateVersion
@@ -358,7 +358,7 @@ func TestService_SDKToLaunchTemplate(t *testing.T) {
358358
}
359359
}
360360

361-
func TestService_LaunchTemplateNeedsUpdate(t *testing.T) {
361+
func TestServiceLaunchTemplateNeedsUpdate(t *testing.T) {
362362
mockCtrl := gomock.NewController(t)
363363
defer mockCtrl.Finish()
364364

@@ -930,7 +930,7 @@ func TestCreateLaunchTemplate(t *testing.T) {
930930
}
931931
}
932932

933-
func Test_LaunchTemplateDataCreation(t *testing.T) {
933+
func TestLaunchTemplateDataCreation(t *testing.T) {
934934
mockCtrl := gomock.NewController(t)
935935
defer mockCtrl.Finish()
936936
t.Run("Should return error if failed to create launch template data", func(t *testing.T) {

pkg/cloud/services/eks/cluster_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ func TestParseEKSVersion(t *testing.T) {
102102
})
103103
}
104104
}
105+
105106
func TestVersionToEKS(t *testing.T) {
106107
testCases := []struct {
107108
name string

pkg/cloud/services/elb/loadbalancer_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ func TestGenerateELBName(t *testing.T) {
148148
}
149149
}
150150

151-
func TestGetAPIServerClassicELBSpec_ControlPlaneLoadBalancer(t *testing.T) {
151+
func TestGetAPIServerClassicELBSpecControlPlaneLoadBalancer(t *testing.T) {
152152
tests := []struct {
153153
name string
154154
lb *infrav1.AWSLoadBalancerSpec

pkg/cloud/services/iamauth/crd_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ func TestAddRoleMappingCRD(t *testing.T) {
159159
})
160160
}
161161
}
162+
162163
func TestAddUserMappingCRD(t *testing.T) {
163164
testCases := []struct {
164165
name string

pkg/cloud/services/s3/s3_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ const (
4848
testClusterNamespace = "test-namespace"
4949
)
5050

51-
func Test_Reconcile_bucket(t *testing.T) {
51+
func TestReconcile_bucket(t *testing.T) {
5252
t.Parallel()
5353

5454
t.Run("does_nothing_when_bucket_management_is_disabled", func(t *testing.T) {
@@ -270,7 +270,7 @@ func Test_Reconcile_bucket(t *testing.T) {
270270
})
271271
}
272272

273-
func Test_Delete_bucket(t *testing.T) {
273+
func TestDelete_bucket(t *testing.T) {
274274
t.Parallel()
275275

276276
const bucketName = "foo"
@@ -355,7 +355,7 @@ func Test_Delete_bucket(t *testing.T) {
355355
})
356356
}
357357

358-
func Test_Create_object(t *testing.T) {
358+
func TestCreate_object(t *testing.T) {
359359
t.Parallel()
360360

361361
const (
@@ -565,7 +565,7 @@ func Test_Create_object(t *testing.T) {
565565
})
566566
}
567567

568-
func Test_Delete_object(t *testing.T) {
568+
func TestDelete_object(t *testing.T) {
569569
t.Parallel()
570570

571571
const nodeName = "aws-test1"

pkg/cloud/services/secretsmanager/secret_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ import (
3737
clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
3838
)
3939

40-
func TestService_Create(t *testing.T) {
40+
func TestServiceCreate(t *testing.T) {
4141
mockCtrl := gomock.NewController(t)
4242
defer mockCtrl.Finish()
4343

@@ -181,7 +181,7 @@ func TestService_Create(t *testing.T) {
181181
}
182182
}
183183

184-
func TestService_Delete(t *testing.T) {
184+
func TestServiceDelete(t *testing.T) {
185185
mockCtrl := gomock.NewController(t)
186186
defer mockCtrl.Finish()
187187

0 commit comments

Comments
 (0)