Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Makes specs for cloud package conformant to a standard naming convention #3671

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions pkg/cloud/scope/machine_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ func TestGetRawBootstrapDataIsNotBase64Encoded(t *testing.T) {
}
}

func Test_GetRawBootstrapDataWithFormat(t *testing.T) {
func TestGetRawBootstrapDataWithFormat(t *testing.T) {
t.Run("returns_empty_format_when_format_is_not_set_in_bootstrap_data", func(t *testing.T) {
scope, err := setupMachineScope()
if err != nil {
Expand Down Expand Up @@ -258,7 +258,7 @@ func TestUseSecretsManagerTrue(t *testing.T) {
}
}

func Test_UseIgnition(t *testing.T) {
func TestUseIgnition(t *testing.T) {
t.Run("returns_true_when_given_bootstrap_data_format_is_ignition", func(t *testing.T) {
scope, err := setupMachineScope()
if err != nil {
Expand All @@ -283,7 +283,7 @@ func Test_UseIgnition(t *testing.T) {
})
}

func Test_CompressUserData(t *testing.T) {
func TestCompressUserData(t *testing.T) {
// Ignition does not support compressed data in S3.
t.Run("returns_false_when_bootstrap_data_is_in_ignition_format", func(t *testing.T) {
scope, err := setupMachineScope()
Expand Down
22 changes: 11 additions & 11 deletions pkg/cloud/services/autoscaling/autoscalinggroup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ import (
expclusterv1 "sigs.k8s.io/cluster-api/exp/api/v1beta1"
)

func TestService_GetASGByName(t *testing.T) {
func TestServiceGetASGByName(t *testing.T) {
mockCtrl := gomock.NewController(t)
defer mockCtrl.Finish()
tests := []struct {
Expand Down Expand Up @@ -128,7 +128,7 @@ func TestService_GetASGByName(t *testing.T) {
}
}

func TestService_SDKToAutoScalingGroup(t *testing.T) {
func TestServiceSDKToAutoScalingGroup(t *testing.T) {
tests := []struct {
name string
input *autoscaling.Group
Expand Down Expand Up @@ -294,7 +294,7 @@ func TestService_SDKToAutoScalingGroup(t *testing.T) {
}
}

func TestService_ASGIfExists(t *testing.T) {
func TestServiceASGIfExists(t *testing.T) {
mockCtrl := gomock.NewController(t)
defer mockCtrl.Finish()

Expand Down Expand Up @@ -385,7 +385,7 @@ func TestService_ASGIfExists(t *testing.T) {
}
}

func TestService_CreateASG(t *testing.T) {
func TestServiceCreateASG(t *testing.T) {
mockCtrl := gomock.NewController(t)
defer mockCtrl.Finish()
tests := []struct {
Expand Down Expand Up @@ -536,7 +536,7 @@ func TestService_CreateASG(t *testing.T) {
}
}

func TestService_UpdateASG(t *testing.T) {
func TestServiceUpdateASG(t *testing.T) {
mockCtrl := gomock.NewController(t)
defer mockCtrl.Finish()

Expand Down Expand Up @@ -593,7 +593,7 @@ func TestService_UpdateASG(t *testing.T) {
}
}

func TestService_UpdateASGWithSubnetFilters(t *testing.T) {
func TestServiceUpdateASGWithSubnetFilters(t *testing.T) {
mockCtrl := gomock.NewController(t)
defer mockCtrl.Finish()

Expand Down Expand Up @@ -662,7 +662,7 @@ func TestService_UpdateASGWithSubnetFilters(t *testing.T) {
}
}

func TestService_UpdateResourceTags(t *testing.T) {
func TestServiceUpdateResourceTags(t *testing.T) {
mockCtrl := gomock.NewController(t)
defer mockCtrl.Finish()

Expand Down Expand Up @@ -778,7 +778,7 @@ func TestService_UpdateResourceTags(t *testing.T) {
}
}

func TestService_DeleteASG(t *testing.T) {
func TestServiceDeleteASG(t *testing.T) {
mockCtrl := gomock.NewController(t)
defer mockCtrl.Finish()

Expand Down Expand Up @@ -829,7 +829,7 @@ func TestService_DeleteASG(t *testing.T) {
}
}

func TestService_DeleteASGAndWait(t *testing.T) {
func TestServiceDeleteASGAndWait(t *testing.T) {
mockCtrl := gomock.NewController(t)
defer mockCtrl.Finish()

Expand Down Expand Up @@ -899,7 +899,7 @@ func TestService_DeleteASGAndWait(t *testing.T) {
}
}

func TestService_CanStartASGInstanceRefresh(t *testing.T) {
func TestServiceCanStartASGInstanceRefresh(t *testing.T) {
mockCtrl := gomock.NewController(t)
defer mockCtrl.Finish()

Expand Down Expand Up @@ -977,7 +977,7 @@ func TestService_CanStartASGInstanceRefresh(t *testing.T) {
}
}

func TestService_StartASGInstanceRefresh(t *testing.T) {
func TestServiceStartASGInstanceRefresh(t *testing.T) {
mockCtrl := gomock.NewController(t)
defer mockCtrl.Finish()

Expand Down
2 changes: 1 addition & 1 deletion pkg/cloud/services/ec2/ami_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import (
"sigs.k8s.io/cluster-api-provider-aws/test/mocks"
)

func Test_DefaultAMILookup(t *testing.T) {
func TestDefaultAMILookup(t *testing.T) {
mockCtrl := gomock.NewController(t)
defer mockCtrl.Finish()

Expand Down
4 changes: 2 additions & 2 deletions pkg/cloud/services/ec2/bastion_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import (
clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
)

func TestService_DeleteBastion(t *testing.T) {
func TestServiceDeleteBastion(t *testing.T) {
clusterName := "cluster"

describeInput := &ec2.DescribeInstancesInput{
Expand Down Expand Up @@ -226,7 +226,7 @@ func TestService_DeleteBastion(t *testing.T) {
}
}

func TestService_ReconcileBastion(t *testing.T) {
func TestServiceReconcileBastion(t *testing.T) {
clusterName := "cluster"

describeInput := &ec2.DescribeInstancesInput{
Expand Down
6 changes: 3 additions & 3 deletions pkg/cloud/services/ec2/launchtemplate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ func TestGetLaunchTemplate(t *testing.T) {
}
}

func TestService_SDKToLaunchTemplate(t *testing.T) {
func TestServiceSDKToLaunchTemplate(t *testing.T) {
tests := []struct {
name string
input *ec2.LaunchTemplateVersion
Expand Down Expand Up @@ -358,7 +358,7 @@ func TestService_SDKToLaunchTemplate(t *testing.T) {
}
}

func TestService_LaunchTemplateNeedsUpdate(t *testing.T) {
func TestServiceLaunchTemplateNeedsUpdate(t *testing.T) {
mockCtrl := gomock.NewController(t)
defer mockCtrl.Finish()

Expand Down Expand Up @@ -930,7 +930,7 @@ func TestCreateLaunchTemplate(t *testing.T) {
}
}

func Test_LaunchTemplateDataCreation(t *testing.T) {
func TestLaunchTemplateDataCreation(t *testing.T) {
mockCtrl := gomock.NewController(t)
defer mockCtrl.Finish()
t.Run("Should return error if failed to create launch template data", func(t *testing.T) {
Expand Down
1 change: 1 addition & 0 deletions pkg/cloud/services/eks/cluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ func TestParseEKSVersion(t *testing.T) {
})
}
}

func TestVersionToEKS(t *testing.T) {
testCases := []struct {
name string
Expand Down
2 changes: 1 addition & 1 deletion pkg/cloud/services/elb/loadbalancer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ func TestGenerateELBName(t *testing.T) {
}
}

func TestGetAPIServerClassicELBSpec_ControlPlaneLoadBalancer(t *testing.T) {
func TestGetAPIServerClassicELBSpecControlPlaneLoadBalancer(t *testing.T) {
tests := []struct {
name string
lb *infrav1.AWSLoadBalancerSpec
Expand Down
1 change: 1 addition & 0 deletions pkg/cloud/services/iamauth/crd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ func TestAddRoleMappingCRD(t *testing.T) {
})
}
}

func TestAddUserMappingCRD(t *testing.T) {
testCases := []struct {
name string
Expand Down
8 changes: 4 additions & 4 deletions pkg/cloud/services/s3/s3_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const (
testClusterNamespace = "test-namespace"
)

func Test_Reconcile_bucket(t *testing.T) {
func TestReconcile_bucket(t *testing.T) {
t.Parallel()

t.Run("does_nothing_when_bucket_management_is_disabled", func(t *testing.T) {
Expand Down Expand Up @@ -270,7 +270,7 @@ func Test_Reconcile_bucket(t *testing.T) {
})
}

func Test_Delete_bucket(t *testing.T) {
func TestDelete_bucket(t *testing.T) {
t.Parallel()

const bucketName = "foo"
Expand Down Expand Up @@ -355,7 +355,7 @@ func Test_Delete_bucket(t *testing.T) {
})
}

func Test_Create_object(t *testing.T) {
func TestCreate_object(t *testing.T) {
t.Parallel()

const (
Expand Down Expand Up @@ -565,7 +565,7 @@ func Test_Create_object(t *testing.T) {
})
}

func Test_Delete_object(t *testing.T) {
func TestDelete_object(t *testing.T) {
t.Parallel()

const nodeName = "aws-test1"
Expand Down
4 changes: 2 additions & 2 deletions pkg/cloud/services/secretsmanager/secret_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import (
clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
)

func TestService_Create(t *testing.T) {
func TestServiceCreate(t *testing.T) {
mockCtrl := gomock.NewController(t)
defer mockCtrl.Finish()

Expand Down Expand Up @@ -181,7 +181,7 @@ func TestService_Create(t *testing.T) {
}
}

func TestService_Delete(t *testing.T) {
func TestServiceDelete(t *testing.T) {
mockCtrl := gomock.NewController(t)
defer mockCtrl.Finish()

Expand Down
4 changes: 2 additions & 2 deletions pkg/cloud/services/ssm/secret_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import (
clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
)

func TestService_Create(t *testing.T) {
func TestServiceCreate(t *testing.T) {
mockCtrl := gomock.NewController(t)
defer mockCtrl.Finish()

Expand Down Expand Up @@ -177,7 +177,7 @@ func TestService_Create(t *testing.T) {
}
}

func TestService_Delete(t *testing.T) {
func TestServiceDelete(t *testing.T) {
mockCtrl := gomock.NewController(t)
defer mockCtrl.Finish()

Expand Down
8 changes: 4 additions & 4 deletions pkg/cloud/tags/tags_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ var (
}
)

func TestTags_ComputeDiff(t *testing.T) {
func TestTagsComputeDiff(t *testing.T) {
pName := "test"
pRole := "testrole"
bp := infrav1.BuildParams{
Expand Down Expand Up @@ -132,7 +132,7 @@ func TestTags_ComputeDiff(t *testing.T) {
}
}

func TestTags_EnsureWithEC2(t *testing.T) {
func TestTagsEnsureWithEC2(t *testing.T) {
tests := []struct {
name string
builder Builder
Expand Down Expand Up @@ -190,7 +190,7 @@ func TestTags_EnsureWithEC2(t *testing.T) {
}
}

func TestTags_EnsureWithEKS(t *testing.T) {
func TestTagsEnsureWithEKS(t *testing.T) {
tests := []struct {
name string
builder Builder
Expand Down Expand Up @@ -240,7 +240,7 @@ func TestTags_EnsureWithEKS(t *testing.T) {
}
}

func TestTags_BuildParamsToTagSpecification(t *testing.T) {
func TestTagsBuildParamsToTagSpecification(t *testing.T) {
g := NewWithT(t)
tagSpec := BuildParamsToTagSpecification("test-resource", bp)
expectedTagSpec := &ec2.TagSpecification{
Expand Down