From 9775e3124b7aecdb83046f3e56f5f8388be5a143 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joan=20L=C3=B3pez=20de=20la=20Franca=20Beltran?= Date: Wed, 1 Dec 2021 13:59:26 +0100 Subject: [PATCH] Fix tests --- pkg/setting/setting_test.go | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/pkg/setting/setting_test.go b/pkg/setting/setting_test.go index 85e801eb605..aa52cb60a14 100644 --- a/pkg/setting/setting_test.go +++ b/pkg/setting/setting_test.go @@ -78,16 +78,6 @@ func TestLoadingSettings(t *testing.T) { So(appliedEnvOverrides, ShouldContain, "GF_SECURITY_ADMIN_PASSWORD=*********") }) - Convey("Should return an error when url is invalid", func() { - err := os.Setenv("GF_DATABASE_URL", "postgres.%31://grafana:secret@postgres:5432/grafana") - require.NoError(t, err) - - cfg := NewCfg() - err = cfg.Load(&CommandLineArgs{HomePath: "../../"}) - - So(err, ShouldNotBeNil) - }) - Convey("Should replace password in URL when url environment is defined", func() { err := os.Setenv("GF_DATABASE_URL", "mysql://user:secret@localhost:3306/database") require.NoError(t, err) @@ -96,7 +86,7 @@ func TestLoadingSettings(t *testing.T) { err = cfg.Load(&CommandLineArgs{HomePath: "../../"}) So(err, ShouldBeNil) - So(appliedEnvOverrides, ShouldContain, "GF_DATABASE_URL=mysql://user:-redacted-@localhost:3306/database") + So(appliedEnvOverrides, ShouldContain, "GF_DATABASE_URL=mysql://user:xxxxx@localhost:3306/database") }) Convey("Should get property map from command line args array", func() {