Chore: Remove context.TODO() (#43409)
* Remove context.TODO() from services * Fix live test * Remove context.TODO
This commit is contained in:
@@ -21,27 +21,27 @@ const (
|
||||
func TestConfigReader(t *testing.T) {
|
||||
t.Run("Broken yaml should return error", func(t *testing.T) {
|
||||
reader := newConfigReader(log.New("test logger"), nil)
|
||||
_, err := reader.readConfig(brokenYaml)
|
||||
_, err := reader.readConfig(context.Background(), brokenYaml)
|
||||
require.Error(t, err)
|
||||
})
|
||||
|
||||
t.Run("Skip invalid directory", func(t *testing.T) {
|
||||
cfgProvider := newConfigReader(log.New("test logger"), nil)
|
||||
cfg, err := cfgProvider.readConfig(emptyFolder)
|
||||
cfg, err := cfgProvider.readConfig(context.Background(), emptyFolder)
|
||||
require.NoError(t, err)
|
||||
require.Len(t, cfg, 0)
|
||||
})
|
||||
|
||||
t.Run("Unknown app plugin should return error", func(t *testing.T) {
|
||||
cfgProvider := newConfigReader(log.New("test logger"), fakePluginStore{})
|
||||
_, err := cfgProvider.readConfig(unknownApp)
|
||||
_, err := cfgProvider.readConfig(context.Background(), unknownApp)
|
||||
require.Error(t, err)
|
||||
require.Equal(t, "plugin not installed: \"nonexisting\"", err.Error())
|
||||
})
|
||||
|
||||
t.Run("Read incorrect properties", func(t *testing.T) {
|
||||
cfgProvider := newConfigReader(log.New("test logger"), nil)
|
||||
_, err := cfgProvider.readConfig(incorrectSettings)
|
||||
_, err := cfgProvider.readConfig(context.Background(), incorrectSettings)
|
||||
require.Error(t, err)
|
||||
require.Equal(t, "app item 1 in configuration doesn't contain required field type", err.Error())
|
||||
})
|
||||
@@ -61,7 +61,7 @@ func TestConfigReader(t *testing.T) {
|
||||
})
|
||||
|
||||
cfgProvider := newConfigReader(log.New("test logger"), pm)
|
||||
cfg, err := cfgProvider.readConfig(correctProperties)
|
||||
cfg, err := cfgProvider.readConfig(context.Background(), correctProperties)
|
||||
require.NoError(t, err)
|
||||
require.Len(t, cfg, 1)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user