Chore: Make Cfg field private in SQLStore (#85593)

* make cfg private in sqlstore

* fix db init in tests

* fix case

* fix folder test init

* fix imports

* make another Cfg private

* remove another Cfg

* remove unused variable

* use store cfg, it has side-effects

* fix mutated cfg in tests
This commit is contained in:
Serge Zaitsev
2024-04-24 10:38:40 +02:00
committed by GitHub
parent f6e472f879
commit 522a98c126
50 changed files with 325 additions and 344 deletions
@@ -28,7 +28,7 @@ func TestIntegrationDashboardFolderStore(t *testing.T) {
var dashboardStore dashboards.Store
setup := func() {
sqlStore, cfg = db.InitTestDBwithCfg(t)
sqlStore, cfg = db.InitTestDBWithCfg(t)
quotaService := quotatest.New(false, nil)
var err error
dashboardStore, err = database.ProvideDashboardStore(sqlStore, cfg, featuremgmt.WithFeatures(featuremgmt.FlagPanelTitleSearch), tagimpl.ProvideService(sqlStore), quotaService)
@@ -40,7 +40,7 @@ func TestIntegrationDashboardFolderStore(t *testing.T) {
title := "Very Unique Name"
var sqlStore db.DB
var folder1, folder2 *dashboards.Dashboard
sqlStore = db.InitTestDB(t)
sqlStore, cfg = db.InitTestDBWithCfg(t)
folderStore := ProvideDashboardFolderStore(sqlStore)
folder2 = insertTestFolder(t, dashboardStore, "TEST", orgId, "", "prod")
_ = insertTestDashboard(t, dashboardStore, title, orgId, folder2.ID, folder2.UID, "prod")