settings: return error instead of ignoring it

closes #11281
This commit is contained in:
bergquist
2018-03-28 22:32:58 +02:00
parent df89be4de9
commit 2ccbf12d1c
2 changed files with 26 additions and 6 deletions
+7
View File
@@ -37,6 +37,13 @@ func TestLoadingSettings(t *testing.T) {
So(appliedEnvOverrides, ShouldContain, "GF_SECURITY_ADMIN_PASSWORD=*********")
})
Convey("Should replace password when defined in environment2", func() {
os.Setenv("GF_DATABASE_URL", "postgres://grafana:sec{ret@postgres:5432/grafana")
err := NewConfigContext(&CommandLineArgs{HomePath: "../../"})
So(err, ShouldNotBeNil)
})
Convey("Should replace password in URL when url environment is defined", func() {
os.Setenv("GF_DATABASE_URL", "mysql://user:secret@localhost:3306/database")
NewConfigContext(&CommandLineArgs{HomePath: "../../"})