From b76ddc98acda4b195bfb344b498a7d60fbe27f41 Mon Sep 17 00:00:00 2001 From: Vladimir Kozhukalov Date: Tue, 15 Sep 2020 14:13:47 +0300 Subject: [PATCH] Fix TestPersistConfig testutil.InitConfig writes sample configs to files, and if we just check that these files exist after calling PersistConfig function, then don't test anything. We have to change config file paths before calling PersistConfig and then we can check if these files exist. Change-Id: Ibaee17a57a86251f7016bb57b2d8bd9976cefac0 --- pkg/config/config_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/config/config_test.go b/pkg/config/config_test.go index 331725271..64df3ee7c 100644 --- a/pkg/config/config_test.go +++ b/pkg/config/config_test.go @@ -113,6 +113,9 @@ func TestPersistConfig(t *testing.T) { conf, cleanup := testutil.InitConfig(t) defer cleanup(t) + conf.SetLoadedConfigPath(conf.LoadedConfigPath() + ".new") + conf.SetKubeConfigPath(conf.KubeConfigPath() + ".new") + err := conf.PersistConfig(true) require.NoError(t, err)