mirror of
https://github.com/grafana/grafana.git
synced 2025-07-31 02:02:31 +08:00
Chore: Remove bus.Bus field (#47695)
* Chore: Remove bus.Bus field * fix integration test
This commit is contained in:
@ -16,7 +16,6 @@ import (
|
||||
"github.com/grafana/grafana/pkg/api/dtos"
|
||||
"github.com/grafana/grafana/pkg/api/response"
|
||||
"github.com/grafana/grafana/pkg/api/routing"
|
||||
"github.com/grafana/grafana/pkg/bus"
|
||||
"github.com/grafana/grafana/pkg/components/simplejson"
|
||||
"github.com/grafana/grafana/pkg/infra/usagestats"
|
||||
"github.com/grafana/grafana/pkg/models"
|
||||
@ -46,7 +45,7 @@ func TestGetHomeDashboard(t *testing.T) {
|
||||
cfg.StaticRootPath = "../../public/"
|
||||
|
||||
hs := &HTTPServer{
|
||||
Cfg: cfg, Bus: bus.New(),
|
||||
Cfg: cfg,
|
||||
pluginStore: &fakePluginStore{},
|
||||
SQLStore: mockstore.NewSQLStoreMock(),
|
||||
}
|
||||
@ -96,7 +95,7 @@ func newTestLive(t *testing.T, store *sqlstore.SQLStore) *live.GrafanaLive {
|
||||
nil,
|
||||
&usagestats.UsageStatsMock{T: t},
|
||||
nil,
|
||||
features, nil, accesscontrolmock.New())
|
||||
features, accesscontrolmock.New())
|
||||
require.NoError(t, err)
|
||||
return gLive
|
||||
}
|
||||
@ -991,7 +990,6 @@ func postDashboardScenario(t *testing.T, desc string, url string, routePattern s
|
||||
t.Run(fmt.Sprintf("%s %s", desc, url), func(t *testing.T) {
|
||||
cfg := setting.NewCfg()
|
||||
hs := HTTPServer{
|
||||
Bus: bus.GetBus(),
|
||||
Cfg: cfg,
|
||||
ProvisioningService: provisioning.NewProvisioningServiceMock(context.Background()),
|
||||
Live: newTestLive(t, sqlstore.InitTestDB(t)),
|
||||
@ -1027,7 +1025,6 @@ func postDiffScenario(t *testing.T, desc string, url string, routePattern string
|
||||
cfg := setting.NewCfg()
|
||||
hs := HTTPServer{
|
||||
Cfg: cfg,
|
||||
Bus: bus.GetBus(),
|
||||
ProvisioningService: provisioning.NewProvisioningServiceMock(context.Background()),
|
||||
Live: newTestLive(t, sqlstore.InitTestDB(t)),
|
||||
QuotaService: "a.QuotaService{Cfg: cfg},
|
||||
@ -1062,7 +1059,6 @@ func restoreDashboardVersionScenario(t *testing.T, desc string, url string, rout
|
||||
mockSQLStore := mockstore.NewSQLStoreMock()
|
||||
hs := HTTPServer{
|
||||
Cfg: cfg,
|
||||
Bus: bus.GetBus(),
|
||||
ProvisioningService: provisioning.NewProvisioningServiceMock(context.Background()),
|
||||
Live: newTestLive(t, sqlstore.InitTestDB(t)),
|
||||
QuotaService: "a.QuotaService{Cfg: cfg},
|
||||
|
Reference in New Issue
Block a user