SQLStore: Fix setting query tries for integration tests (#64944)

* SQLStore: Pass testinfra database configuration to the test database

* Add test

* Bypass gocyclo check for initTestDB
This commit is contained in:
Sofia Papagiannaki
2023-03-17 17:31:03 +02:00
committed by GitHub
parent 7261c6f7cd
commit f5cb8c660e
2 changed files with 28 additions and 5 deletions

View File

@@ -53,6 +53,11 @@ func StartGrafanaEnv(t *testing.T, grafDir, cfgPath string) (string, *server.Tes
require.NoError(t, err)
require.NoError(t, env.SQLStore.Sync())
require.NotNil(t, env.SQLStore.Cfg)
dbSec, err := env.SQLStore.Cfg.Raw.GetSection("database")
require.NoError(t, err)
assert.Greater(t, dbSec.Key("query_retries").MustInt(), 0)
go func() {
// When the server runs, it will also build and initialize the service graph
if err := env.Server.Run(); err != nil {