mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Chore: Remove unused code/dependencies in testdata datasource (#69386)
This commit is contained in:
parent
cf1945d0c3
commit
dcc1169ab2
@ -61,7 +61,7 @@ func TestCallResource(t *testing.T) {
|
|||||||
cfg.Azure = &azsettings.AzureSettings{}
|
cfg.Azure = &azsettings.AzureSettings{}
|
||||||
|
|
||||||
coreRegistry := coreplugin.ProvideCoreRegistry(nil, &cloudwatch.CloudWatchService{}, nil, nil, nil, nil,
|
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())
|
pCfg, err := config.ProvideConfig(setting.ProvideProvider(cfg), cfg, featuremgmt.WithFeatures())
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
reg := registry.ProvideService()
|
reg := registry.ProvideService()
|
||||||
|
@ -102,7 +102,7 @@ func TestIntegrationPluginManager(t *testing.T) {
|
|||||||
otsdb := opentsdb.ProvideService(hcp)
|
otsdb := opentsdb.ProvideService(hcp)
|
||||||
pr := prometheus.ProvideService(hcp, cfg, features, tracer)
|
pr := prometheus.ProvideService(hcp, cfg, features, tracer)
|
||||||
tmpo := tempo.ProvideService(hcp)
|
tmpo := tempo.ProvideService(hcp)
|
||||||
td := testdatasource.ProvideService(cfg, features)
|
td := testdatasource.ProvideService(cfg)
|
||||||
pg := postgres.ProvideService(cfg)
|
pg := postgres.ProvideService(cfg)
|
||||||
my := mysql.ProvideService(cfg, hcp)
|
my := mysql.ProvideService(cfg, hcp)
|
||||||
ms := mssql.ProvideService(cfg)
|
ms := mssql.ProvideService(cfg)
|
||||||
|
@ -17,9 +17,7 @@ func TestCSVFileScenario(t *testing.T) {
|
|||||||
cfg.DataPath = t.TempDir()
|
cfg.DataPath = t.TempDir()
|
||||||
cfg.StaticRootPath = "../../../public"
|
cfg.StaticRootPath = "../../../public"
|
||||||
|
|
||||||
s := &Service{
|
s := &Service{}
|
||||||
cfg: cfg,
|
|
||||||
}
|
|
||||||
|
|
||||||
t.Run("loadCsvFile", func(t *testing.T) {
|
t.Run("loadCsvFile", func(t *testing.T) {
|
||||||
files := []string{"simple", "mixed", "labels"}
|
files := []string{"simple", "mixed", "labels"}
|
||||||
|
@ -10,14 +10,12 @@ import (
|
|||||||
"github.com/grafana/grafana-plugin-sdk-go/data"
|
"github.com/grafana/grafana-plugin-sdk-go/data"
|
||||||
|
|
||||||
"github.com/grafana/grafana/pkg/infra/log"
|
"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/setting"
|
||||||
"github.com/grafana/grafana/pkg/tsdb/testdatasource/sims"
|
"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{
|
s := &Service{
|
||||||
features: features,
|
|
||||||
queryMux: datasource.NewQueryTypeMux(),
|
queryMux: datasource.NewQueryTypeMux(),
|
||||||
scenarios: map[string]*Scenario{},
|
scenarios: map[string]*Scenario{},
|
||||||
frame: data.NewFrame("testdata",
|
frame: data.NewFrame("testdata",
|
||||||
@ -55,7 +53,6 @@ type Service struct {
|
|||||||
labelFrame *data.Frame
|
labelFrame *data.Frame
|
||||||
queryMux *datasource.QueryTypeMux
|
queryMux *datasource.QueryTypeMux
|
||||||
resourceHandler backend.CallResourceHandler
|
resourceHandler backend.CallResourceHandler
|
||||||
features featuremgmt.FeatureToggles
|
|
||||||
sims *sims.SimulationEngine
|
sims *sims.SimulationEngine
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8,15 +8,11 @@ import (
|
|||||||
|
|
||||||
"github.com/grafana/grafana-plugin-sdk-go/backend"
|
"github.com/grafana/grafana-plugin-sdk-go/backend"
|
||||||
"github.com/grafana/grafana-plugin-sdk-go/experimental"
|
"github.com/grafana/grafana-plugin-sdk-go/experimental"
|
||||||
"github.com/grafana/grafana/pkg/setting"
|
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestUSAScenario(t *testing.T) {
|
func TestUSAScenario(t *testing.T) {
|
||||||
cfg := setting.NewCfg()
|
p := &Service{}
|
||||||
p := &Service{
|
|
||||||
cfg: cfg,
|
|
||||||
}
|
|
||||||
|
|
||||||
t.Run("usa query modes", func(t *testing.T) {
|
t.Run("usa query modes", func(t *testing.T) {
|
||||||
start := time.Date(2020, time.January, 10, 23, 0, 0, 0, time.UTC)
|
start := time.Date(2020, time.January, 10, 23, 0, 0, 0, time.UTC)
|
||||||
|
Loading…
Reference in New Issue
Block a user