Cleanup unit test names
@@ -9,8 +9,7 @@ import (
v1beta1 "k8s.io/api/extensions/v1beta1"
)
-func Test_UpdateSecretsAddOrUpdatesTheVolumeSpec(t *testing.T) {
- t.Run("No volume added if request secrets is nil", func(t *testing.T) {
+func Test_UpdateSecrets_DoesNotAddVolumeIfRequestSecretsIsNil(t *testing.T) {
request := requests.CreateFunctionRequest{
Service: "testfunc",
Secrets: nil,
@@ -38,9 +37,9 @@ func Test_UpdateSecretsAddOrUpdatesTheVolumeSpec(t *testing.T) {
validateEmptySecretVolumesAndMounts(t, deployment)
- })
+}
- t.Run("No volume added if request secrets is the empty slice", func(t *testing.T) {
+func Test_UpdateSecrets_DoesNotAddVolumeIfRequestSecretsIsEmpty(t *testing.T) {
request := requests.CreateFunctionRequest{
Service: "testfunc",
Secrets: []string{},
@@ -68,9 +67,9 @@ func Test_UpdateSecretsAddOrUpdatesTheVolumeSpec(t *testing.T) {
validateEmptySecretVolumesAndMounts(t, deployment)
- })
+}
- t.Run("Adds New Secrets Volume", func(t *testing.T) {
+func Test_UpdateSecrets_AddNewSecretVolume(t *testing.T) {
request := requests.CreateFunctionRequest{
Service: "testfunc",
Secrets: []string{"pullsecret", "testsecret"},
@@ -98,9 +97,9 @@ func Test_UpdateSecretsAddOrUpdatesTheVolumeSpec(t *testing.T) {
validateNewSecretVolumesAndMounts(t, deployment)
- })
+}
- t.Run("Replaces Previous SecretMount with new mount", func(t *testing.T) {
+func Test_UpdateSecrets_ReplacesPreviousSecretMountWithNewMount(t *testing.T) {
request := requests.CreateFunctionRequest{
Service: "testfunc",
Secrets: []string{"pullsecret", "testsecret"},
@@ -135,9 +134,9 @@ func Test_UpdateSecretsAddOrUpdatesTheVolumeSpec(t *testing.T) {
validateNewSecretVolumesAndMounts(t, deployment)
- })
+}
- t.Run("Removes secrets volumes if the request is empty or nil", func(t *testing.T) {
+func Test_UpdateSecrets_RemovesSecretsVolumeIfRequestSecretsIsEmptyOrNil(t *testing.T) {
request := requests.CreateFunctionRequest{
Service: "testfunc",
Secrets: []string{"pullsecret", "testsecret"},
@@ -175,7 +174,6 @@ func Test_UpdateSecretsAddOrUpdatesTheVolumeSpec(t *testing.T) {
}
validateEmptySecretVolumesAndMounts(t, deployment)
- })
}
func validateEmptySecretVolumesAndMounts(t *testing.T, deployment *v1beta1.Deployment) {
