MM28858 Basic framework for use of feature flags. Enviroment variable overrides. (#15544)
* Basic framework for use of feature flags. Enviroment variable overrides. * Use Apperr instead of error number increments. * Undo random viper change. * Update model/config_test.go Co-authored-by: Jesse Hallam <jesse.hallam@gmail.com> Co-authored-by: Jesse Hallam <jesse.hallam@gmail.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
61f08d397c
Коммит
e974b7b9be
@@ -1326,3 +1326,21 @@ func TestConfigMarketplaceDefaults(t *testing.T) {
|
||||
require.Equal(t, "https://marketplace.example.com", *c.PluginSettings.MarketplaceUrl)
|
||||
})
|
||||
}
|
||||
|
||||
func TestSetDefaultFeatureFlagBehaviour(t *testing.T) {
|
||||
cfg := Config{}
|
||||
cfg.SetDefaults()
|
||||
|
||||
require.NotNil(t, cfg.FeatureFlags)
|
||||
require.Equal(t, "off", cfg.FeatureFlags.TestFeature)
|
||||
|
||||
cfg = Config{
|
||||
FeatureFlags: &FeatureFlags{
|
||||
TestFeature: "somevalue",
|
||||
},
|
||||
}
|
||||
cfg.SetDefaults()
|
||||
require.NotNil(t, cfg.FeatureFlags)
|
||||
require.Equal(t, "somevalue", cfg.FeatureFlags.TestFeature)
|
||||
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user