mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
* replace sqlstore with db interface in a few packages * remove from stats * remove sqlstore in admin test * remove sqlstore from api plugin tests * fix another createUser * remove sqlstore in publicdashboards * remove sqlstore from orgs * clean up orguser test * more clean up in sso * clean up service accounts * further cleanup * more cleanup in accesscontrol * last cleanup in accesscontrol * clean up teams * more removals * split cfg from db in testenv * few remaining fixes * fix test with bus * pass cfg for testing inside db as an option * set query retries when no opts provided * revert golden test data * rebase and rollback
25 lines
959 B
Go
25 lines
959 B
Go
package correlationstest
|
|
|
|
import (
|
|
"github.com/grafana/grafana/pkg/api/routing"
|
|
"github.com/grafana/grafana/pkg/bus"
|
|
"github.com/grafana/grafana/pkg/infra/db"
|
|
"github.com/grafana/grafana/pkg/services/accesscontrol/acimpl"
|
|
"github.com/grafana/grafana/pkg/services/correlations"
|
|
"github.com/grafana/grafana/pkg/services/datasources"
|
|
fakeDatasources "github.com/grafana/grafana/pkg/services/datasources/fakes"
|
|
"github.com/grafana/grafana/pkg/services/quota/quotatest"
|
|
"github.com/grafana/grafana/pkg/setting"
|
|
)
|
|
|
|
func New(db db.DB, cfg *setting.Cfg, bus bus.Bus) *correlations.CorrelationsService {
|
|
ds := &fakeDatasources.FakeDataSourceService{
|
|
DataSources: []*datasources.DataSource{
|
|
{ID: 1, UID: "graphite", Type: datasources.DS_GRAPHITE},
|
|
},
|
|
}
|
|
|
|
correlationsSvc, _ := correlations.ProvideService(db, routing.NewRouteRegister(), ds, acimpl.ProvideAccessControl(setting.NewCfg()), bus, quotatest.New(false, nil), cfg)
|
|
return correlationsSvc
|
|
}
|