DashboardStore: Use ReplDB and get dashboard quotas from the ReadReplica (#90235)

* Use ReplDB in dashboard store and update all fixtures - no other changes

* just moving dashboard counts for now

* find the missing test fixture
This commit is contained in:
Kristin Laemmert
2024-07-12 10:47:49 -04:00
committed by GitHub
parent e64ef2245c
commit 8a6107cd35
35 changed files with 256 additions and 244 deletions
+3 -2
View File
@@ -53,7 +53,8 @@ func SetupTestEnv(tb testing.TB, baseInterval time.Duration) (*ngalert.AlertNG,
*cfg.UnifiedAlerting.Enabled = true
m := metrics.NewNGAlert(prometheus.NewRegistry())
sqlStore := db.InitTestDB(tb)
replStore := db.InitTestReplDB(tb)
sqlStore := replStore.DB()
secretsService := secretsManager.SetupTestService(tb, database.ProvideSecretsStore(sqlStore))
ac := acmock.New()
@@ -61,7 +62,7 @@ func SetupTestEnv(tb testing.TB, baseInterval time.Duration) (*ngalert.AlertNG,
tracer := tracing.InitializeTracerForTest()
bus := bus.ProvideBus(tracer)
folderStore := folderimpl.ProvideDashboardFolderStore(sqlStore)
dashboardService, dashboardStore := testutil.SetupDashboardService(tb, sqlStore, folderStore, cfg)
dashboardService, dashboardStore := testutil.SetupDashboardService(tb, replStore, folderStore, cfg)
features := featuremgmt.WithFeatures()
folderService := testutil.SetupFolderService(tb, cfg, sqlStore, dashboardStore, folderStore, bus, features, ac)
ruleStore, err := store.ProvideDBStore(cfg, featuremgmt.WithFeatures(), sqlStore, folderService, &dashboards.FakeDashboardService{}, ac)