Chore: Remove bus.Bus field (#47695) (#47704)

* Chore: Remove bus.Bus field

* fix integration test

(cherry picked from commit e86b6662a1)

Co-authored-by: Serge Zaitsev <serge.zaitsev@grafana.com>
This commit is contained in:
Grot (@grafanabot)
2022-04-13 13:11:20 -04:00
committed by GitHub
parent 5332a2db05
commit f01f1073b8
38 changed files with 70 additions and 204 deletions
@@ -14,7 +14,6 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/grafana/grafana/pkg/bus"
"github.com/grafana/grafana/pkg/infra/tracing"
"github.com/grafana/grafana/pkg/models"
dashboardsstore "github.com/grafana/grafana/pkg/services/dashboards/database"
@@ -35,8 +34,6 @@ func TestPrometheusRules(t *testing.T) {
})
grafanaListedAddr, store := testinfra.StartGrafana(t, dir, path)
// override bus to get the GetSignedInUserQuery handler
store.Bus = bus.GetBus()
// Create the namespace under default organisation (orgID = 1) where we'll save our alerts to.
_, err = createFolder(t, store, 0, "default")
@@ -330,8 +327,6 @@ func TestPrometheusRulesFilterByDashboard(t *testing.T) {
})
grafanaListedAddr, store := testinfra.StartGrafana(t, dir, path)
// override bus to get the GetSignedInUserQuery handler
store.Bus = bus.GetBus()
// Create the namespace under default organisation (orgID = 1) where we'll save our alerts to.
dashboardUID, err := createFolder(t, store, 0, "default")
@@ -625,8 +620,6 @@ func TestPrometheusRulesPermissions(t *testing.T) {
grafanaListedAddr, store := testinfra.StartGrafana(t, dir, path)
dashboardsStore := dashboardsstore.ProvideDashboardStore(store)
// override bus to get the GetSignedInUserQuery handler
store.Bus = bus.GetBus()
// Create a user to make authenticated requests
createUser(t, store, models.CreateUserCommand{