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 19:11:20 +02:00
committed by GitHub
co-authored by Serge Zaitsev
parent 5332a2db05
commit f01f1073b8
38 changed files with 70 additions and 204 deletions
@@ -20,7 +20,6 @@ import (
"github.com/prometheus/common/model"
"github.com/stretchr/testify/require"
"github.com/grafana/grafana/pkg/bus"
"github.com/grafana/grafana/pkg/infra/tracing"
"github.com/grafana/grafana/pkg/models"
apimodels "github.com/grafana/grafana/pkg/services/ngalert/api/tooling/definitions"
@@ -43,7 +42,6 @@ func TestTestReceivers(t *testing.T) {
})
grafanaListedAddr, env := testinfra.StartGrafanaEnv(t, dir, path)
env.SQLStore.Bus = bus.GetBus()
createUser(t, env.SQLStore, models.CreateUserCommand{
DefaultOrgRole: string(models.ROLE_EDITOR),
@@ -77,7 +75,6 @@ func TestTestReceivers(t *testing.T) {
})
grafanaListedAddr, env := testinfra.StartGrafanaEnv(t, dir, path)
env.SQLStore.Bus = bus.GetBus()
createUser(t, env.SQLStore, models.CreateUserCommand{
DefaultOrgRole: string(models.ROLE_EDITOR),
@@ -162,7 +159,6 @@ func TestTestReceivers(t *testing.T) {
})
grafanaListedAddr, env := testinfra.StartGrafanaEnv(t, dir, path)
env.SQLStore.Bus = bus.GetBus()
createUser(t, env.SQLStore, models.CreateUserCommand{
DefaultOrgRole: string(models.ROLE_EDITOR),
@@ -242,7 +238,6 @@ func TestTestReceivers(t *testing.T) {
})
grafanaListedAddr, env := testinfra.StartGrafanaEnv(t, dir, path)
env.SQLStore.Bus = bus.GetBus()
createUser(t, env.SQLStore, models.CreateUserCommand{
DefaultOrgRole: string(models.ROLE_EDITOR),
@@ -332,7 +327,6 @@ func TestTestReceivers(t *testing.T) {
})
grafanaListedAddr, env := testinfra.StartGrafanaEnv(t, dir, path)
env.SQLStore.Bus = bus.GetBus()
createUser(t, env.SQLStore, models.CreateUserCommand{
DefaultOrgRole: string(models.ROLE_EDITOR),
@@ -448,7 +442,6 @@ func TestTestReceiversAlertCustomization(t *testing.T) {
})
grafanaListedAddr, env := testinfra.StartGrafanaEnv(t, dir, path)
env.SQLStore.Bus = bus.GetBus()
createUser(t, env.SQLStore, models.CreateUserCommand{
DefaultOrgRole: string(models.ROLE_EDITOR),
@@ -544,7 +537,6 @@ func TestTestReceiversAlertCustomization(t *testing.T) {
})
grafanaListedAddr, env := testinfra.StartGrafanaEnv(t, dir, path)
env.SQLStore.Bus = bus.GetBus()
createUser(t, env.SQLStore, models.CreateUserCommand{
DefaultOrgRole: string(models.ROLE_EDITOR),
@@ -635,7 +627,6 @@ func TestTestReceiversAlertCustomization(t *testing.T) {
})
grafanaListedAddr, env := testinfra.StartGrafanaEnv(t, dir, path)
env.SQLStore.Bus = bus.GetBus()
createUser(t, env.SQLStore, models.CreateUserCommand{
DefaultOrgRole: string(models.ROLE_EDITOR),
@@ -727,7 +718,6 @@ func TestNotificationChannels(t *testing.T) {
})
grafanaListedAddr, env := testinfra.StartGrafanaEnv(t, dir, path)
env.SQLStore.Bus = bus.GetBus()
mockChannel := newMockNotificationChannel(t, grafanaListedAddr)
amConfig := getAlertmanagerConfig(mockChannel.server.Addr)