AzureMonitor: Remove deprecated code (#48328)

This commit is contained in:
Andres Martinez Gotor
2022-04-28 01:27:39 -07:00
committed by GitHub
parent 07bd261cff
commit 6edefe5147
42 changed files with 39 additions and 3523 deletions

View File

@@ -14,41 +14,11 @@ import (
"github.com/grafana/grafana/pkg/infra/tracing"
"github.com/grafana/grafana/pkg/setting"
"github.com/grafana/grafana/pkg/tsdb/azuremonitor/deprecated"
"github.com/grafana/grafana/pkg/tsdb/azuremonitor/types"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
func TestProvideService(t *testing.T) {
t.Run("it should skip insight analytics and app insights with Grafana 9", func(t *testing.T) {
currentV := setting.BuildVersion
t.Cleanup(func() {
setting.BuildVersion = currentV
})
versions := []struct {
version string
shouldIncludeInsights bool
}{
{"8.5.0", true},
{"9.0.0-beta1", false},
{"9.0.0", false},
}
for _, v := range versions {
setting.BuildVersion = v.version
s := ProvideService(setting.NewCfg(), httpclient.NewProvider(), nil)
if v.shouldIncludeInsights {
assert.NotNil(t, s.executors[deprecated.InsightsAnalytics])
assert.NotNil(t, s.executors[deprecated.AppInsights])
} else {
assert.Nil(t, s.executors[deprecated.InsightsAnalytics])
assert.Nil(t, s.executors[deprecated.AppInsights])
}
}
})
}
func TestNewInstanceSettings(t *testing.T) {
tests := []struct {
name string