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

View File

@@ -41,7 +41,7 @@ func TestIntegrationAnnotationListingWithRBAC(t *testing.T) {
if testing.Short() {
t.Skip("skipping integration test")
}
sql := db.InitTestDB(t)
sql := db.InitTestReplDB(t)
cfg := setting.NewCfg()
cfg.AnnotationMaximumTagsLength = 60
@@ -210,7 +210,7 @@ func TestIntegrationAnnotationListingWithInheritedRBAC(t *testing.T) {
annotationsTexts := make([]string, 0, folder.MaxNestedFolderDepth+1)
setupFolderStructure := func() db.DB {
sql, cfg := db.InitTestDBWithCfg(t)
sql, cfg := db.InitTestReplDBWithCfg(t)
// enable nested folders so that the folder table is populated for all the tests
features := featuremgmt.WithFeatures(featuremgmt.FlagNestedFolders)

View File

@@ -11,6 +11,7 @@ import (
"time"
"github.com/prometheus/client_golang/prometheus"
"github.com/stretchr/testify/require"
"github.com/grafana/grafana/pkg/components/simplejson"
"github.com/grafana/grafana/pkg/infra/db"
@@ -29,8 +30,6 @@ import (
historymodel "github.com/grafana/grafana/pkg/services/ngalert/state/historian/model"
"github.com/grafana/grafana/pkg/setting"
"github.com/grafana/grafana/pkg/tests/testsuite"
"github.com/stretchr/testify/require"
)
func TestMain(m *testing.M) {
@@ -42,7 +41,7 @@ func TestIntegrationAlertStateHistoryStore(t *testing.T) {
t.Skip("skipping integration test")
}
sql, cfg := db.InitTestDBWithCfg(t)
sql, cfg := db.InitTestReplDBWithCfg(t)
dashboard1 := testutil.CreateDashboard(t, sql, cfg, featuremgmt.WithFeatures(), dashboards.SaveDashboardCommand{
UserID: 1,

View File

@@ -29,7 +29,7 @@ func TestIntegrationAnnotations(t *testing.T) {
if testing.Short() {
t.Skip("skipping integration test")
}
sql := db.InitTestDB(t)
sql := db.InitTestReplDB(t)
cfg := setting.NewCfg()
cfg.AnnotationMaximumTagsLength = 60