Chore: Remove unused code/dependencies in testdata datasource (#69386)

This commit is contained in:
Marcus Efraimsson 2023-06-05 11:34:02 +02:00 committed by GitHub
parent cf1945d0c3
commit dcc1169ab2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 5 additions and 14 deletions

View File

@ -61,7 +61,7 @@ func TestCallResource(t *testing.T) {
cfg.Azure = &azsettings.AzureSettings{}
coreRegistry := coreplugin.ProvideCoreRegistry(nil, &cloudwatch.CloudWatchService{}, nil, nil, nil, nil,
nil, nil, nil, nil, testdatasource.ProvideService(cfg, featuremgmt.WithFeatures()), nil, nil, nil, nil, nil, nil)
nil, nil, nil, nil, testdatasource.ProvideService(cfg), nil, nil, nil, nil, nil, nil)
pCfg, err := config.ProvideConfig(setting.ProvideProvider(cfg), cfg, featuremgmt.WithFeatures())
require.NoError(t, err)
reg := registry.ProvideService()

View File

@ -102,7 +102,7 @@ func TestIntegrationPluginManager(t *testing.T) {
otsdb := opentsdb.ProvideService(hcp)
pr := prometheus.ProvideService(hcp, cfg, features, tracer)
tmpo := tempo.ProvideService(hcp)
td := testdatasource.ProvideService(cfg, features)
td := testdatasource.ProvideService(cfg)
pg := postgres.ProvideService(cfg)
my := mysql.ProvideService(cfg, hcp)
ms := mssql.ProvideService(cfg)

View File

@ -17,9 +17,7 @@ func TestCSVFileScenario(t *testing.T) {
cfg.DataPath = t.TempDir()
cfg.StaticRootPath = "../../../public"
s := &Service{
cfg: cfg,
}
s := &Service{}
t.Run("loadCsvFile", func(t *testing.T) {
files := []string{"simple", "mixed", "labels"}

View File

@ -10,14 +10,12 @@ import (
"github.com/grafana/grafana-plugin-sdk-go/data"
"github.com/grafana/grafana/pkg/infra/log"
"github.com/grafana/grafana/pkg/services/featuremgmt"
"github.com/grafana/grafana/pkg/setting"
"github.com/grafana/grafana/pkg/tsdb/testdatasource/sims"
)
func ProvideService(cfg *setting.Cfg, features featuremgmt.FeatureToggles) *Service {
func ProvideService(cfg *setting.Cfg) *Service {
s := &Service{
features: features,
queryMux: datasource.NewQueryTypeMux(),
scenarios: map[string]*Scenario{},
frame: data.NewFrame("testdata",
@ -55,7 +53,6 @@ type Service struct {
labelFrame *data.Frame
queryMux *datasource.QueryTypeMux
resourceHandler backend.CallResourceHandler
features featuremgmt.FeatureToggles
sims *sims.SimulationEngine
}

View File

@ -8,15 +8,11 @@ import (
"github.com/grafana/grafana-plugin-sdk-go/backend"
"github.com/grafana/grafana-plugin-sdk-go/experimental"
"github.com/grafana/grafana/pkg/setting"
"github.com/stretchr/testify/require"
)
func TestUSAScenario(t *testing.T) {
cfg := setting.NewCfg()
p := &Service{
cfg: cfg,
}
p := &Service{}
t.Run("usa query modes", func(t *testing.T) {
start := time.Date(2020, time.January, 10, 23, 0, 0, 0, time.UTC)