From 9f46665d937830b764183077dabfb54c7b83eff7 Mon Sep 17 00:00:00 2001 From: Aleksandr Bezobchuk Date: Thu, 1 Dec 2022 16:18:33 -0500 Subject: [PATCH] chore: Test for Server Config Read #14125 --- server/config/config_test.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/server/config/config_test.go b/server/config/config_test.go index 042b1ebd1612..c18244d36220 100644 --- a/server/config/config_test.go +++ b/server/config/config_test.go @@ -54,6 +54,18 @@ prefix = ""` require.Contains(t, buffer.String(), expectedContents, "config file contents") } +func TestReadConfig(t *testing.T) { + cfg := DefaultConfig() + tmpFile := filepath.Join(t.TempDir(), "config") + WriteConfigFile(tmpFile, cfg) + + v := viper.New() + otherCfg, err := GetConfig(v) + require.NoError(t, err) + + require.Equal(t, *cfg, otherCfg) +} + func TestIndexEventsWriteRead(t *testing.T) { expected := []string{"key3", "key4"}