fix sample.ini (#37106) (#37107)

(cherry picked from commit 6b2d33dc14)

Co-authored-by: Alexander Emelin <frvzmb@gmail.com>
This commit is contained in:
Grot (@grafanabot)
2021-07-22 17:25:47 +02:00
committed by GitHub
co-authored by Alexander Emelin
parent 2b15e1a962
commit bc9ac1199b
2 changed files with 16 additions and 6 deletions
+10
View File
@@ -54,6 +54,16 @@ func TestLoadingSettings(t *testing.T) {
}
})
Convey("sample.ini should load successfully", func() {
customInitPath := CustomInitPath
CustomInitPath = "conf/sample.ini"
cfg := NewCfg()
err := cfg.Load(&CommandLineArgs{HomePath: "../../"})
So(err, ShouldBeNil)
// Restore CustomInitPath to avoid side effects.
CustomInitPath = customInitPath
})
Convey("Should be able to override via environment variables", func() {
err := os.Setenv("GF_SECURITY_ADMIN_USER", "superduper")
require.NoError(t, err)