Skip to content

Commit

Permalink
add missing tests
Browse files Browse the repository at this point in the history
Signed-off-by: odubajDT <ondrej.dubaj@dynatrace.com>
  • Loading branch information
odubajDT committed Nov 16, 2023
1 parent 5a92721 commit 5689770
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion apis/core/v1beta1/common/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func EnvVarKey(prefix string, suffix string) string {

// unique string used to create unique volume mount and file name
func FeatureFlagConfigurationId(namespace, name string) string {
return fmt.Sprintf("%s_%s", namespace, name)
return EnvVarKey(namespace, name)
}

// unique key (and filename) for configMap data
Expand Down
10 changes: 9 additions & 1 deletion apis/core/v1beta1/common/common_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@ func Test_FeatureFlagSource_SyncProvider(t *testing.T) {
require.False(t, g.IsHttp())
}

func Test_FLagSourceConfiguration_envVarKey(t *testing.T) {
func Test_FLagSourceConfiguration_EnvVarKey(t *testing.T) {
require.Equal(t, "pre_suf", EnvVarKey("pre", "suf"))
}

func Test_FLagSourceConfiguration_FeatureFlagConfigurationId(t *testing.T) {
require.Equal(t, "pre_suf", FeatureFlagConfigurationId("pre", "suf"))
}

func Test_FLagSourceConfiguration_FeatureFlagConfigMapKey(t *testing.T) {
require.Equal(t, "pre_suf.flagd.json", FeatureFlagConfigMapKey("pre", "suf"))
}

0 comments on commit 5689770

Please sign in to comment.