Chore: Remove bus.Bus field (#47695)

* Chore: Remove bus.Bus field

* fix integration test
This commit is contained in:
Serge Zaitsev
2022-04-13 15:24:13 +02:00
committed by GitHub
parent 337d5bf423
commit e86b6662a1
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)