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

@@ -4,13 +4,14 @@ import (
"testing"
"github.com/google/go-cmp/cmp"
"github.com/stretchr/testify/require"
"github.com/grafana/grafana/pkg/components/simplejson"
"github.com/grafana/grafana/pkg/kinds/librarypanel"
"github.com/grafana/grafana/pkg/services/dashboards"
"github.com/grafana/grafana/pkg/services/libraryelements/model"
"github.com/grafana/grafana/pkg/services/org"
"github.com/grafana/grafana/pkg/web"
"github.com/stretchr/testify/require"
)
func TestGetLibraryElement(t *testing.T) {
@@ -124,7 +125,7 @@ func TestGetLibraryElement(t *testing.T) {
Data: simplejson.NewFromAny(dashJSON),
}
// nolint:staticcheck
dashInDB := createDashboard(t, sc.sqlStore, sc.user, &dash, sc.folder.ID, sc.folder.UID)
dashInDB := createDashboard(t, sc.replStore, sc.user, &dash, sc.folder.ID, sc.folder.UID)
err := sc.service.ConnectElementsToDashboard(sc.reqContext.Req.Context(), sc.reqContext.SignedInUser, []string{sc.initialResult.Result.UID}, dashInDB.ID)
require.NoError(t, err)