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
@@ -47,8 +47,7 @@ func TestIntegrationDashboardFolderDataAccess(t *testing.T) {
var dashboardStore dashboards.Store
setup := func() {
sql := db.InitTestDB(t)
sqlStore, cfg = sql, sql.Cfg
sqlStore, cfg = db.InitTestDBWithCfg(t)
quotaService := quotatest.New(false, nil)
var err error
dashboardStore, err = ProvideDashboardStore(sqlStore, cfg, testFeatureToggles, tagimpl.ProvideService(sqlStore), quotaService)
@@ -147,8 +146,7 @@ func TestIntegrationDashboardFolderDataAccess(t *testing.T) {
var currentUser *user.SignedInUser
setup2 := func() {
sql := db.InitTestDB(t)
sqlStore, cfg = sql, sql.Cfg
sqlStore, cfg = db.InitTestDBWithCfg(t)
quotaService := quotatest.New(false, nil)
var err error
dashboardStore, err = ProvideDashboardStore(sqlStore, cfg, testFeatureToggles, tagimpl.ProvideService(sqlStore), quotaService)
@@ -253,8 +251,7 @@ func TestIntegrationDashboardInheritedFolderRBAC(t *testing.T) {
var viewer *user.SignedInUser
setup := func() {
sql := db.InitTestDB(t)
sqlStore, cfg = sql, sql.Cfg
sqlStore, cfg = db.InitTestDBWithCfg(t)
quotaService := quotatest.New(false, nil)
// enable nested folders so that the folder table is populated for all the tests