Chore: Rename testdata plugin with a fully qualified name (#75104)

This commit is contained in:
Andres Martinez Gotor
2023-09-22 14:00:40 +02:00
committed by GitHub
parent d6db9eaeb2
commit c70623fb85
98 changed files with 88 additions and 79 deletions

View File

@ -6196,6 +6196,50 @@ exports[`better eslint`] = {
[0, 0, 0, "Styles should be written using objects.", "0"], [0, 0, 0, "Styles should be written using objects.", "0"],
[0, 0, 0, "Styles should be written using objects.", "1"] [0, 0, 0, "Styles should be written using objects.", "1"]
], ],
"public/app/plugins/datasource/grafana-testdata-datasource/ConfigEditor.tsx:5381": [
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
],
"public/app/plugins/datasource/grafana-testdata-datasource/QueryEditor.tsx:5381": [
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
[0, 0, 0, "Do not use any type assertions.", "1"],
[0, 0, 0, "Do not use any type assertions.", "2"],
[0, 0, 0, "Unexpected any. Specify a different type.", "3"],
[0, 0, 0, "Unexpected any. Specify a different type.", "4"],
[0, 0, 0, "Do not use any type assertions.", "5"],
[0, 0, 0, "Unexpected any. Specify a different type.", "6"]
],
"public/app/plugins/datasource/grafana-testdata-datasource/components/RandomWalkEditor.tsx:5381": [
[0, 0, 0, "Do not use any type assertions.", "0"],
[0, 0, 0, "Do not use any type assertions.", "1"],
[0, 0, 0, "Unexpected any. Specify a different type.", "2"],
[0, 0, 0, "Do not use any type assertions.", "3"]
],
"public/app/plugins/datasource/grafana-testdata-datasource/components/RawFrameEditor.tsx:5381": [
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
],
"public/app/plugins/datasource/grafana-testdata-datasource/components/SimulationQueryEditor.tsx:5381": [
[0, 0, 0, "Do not use any type assertions.", "0"],
[0, 0, 0, "Do not use any type assertions.", "1"],
[0, 0, 0, "Unexpected any. Specify a different type.", "2"],
[0, 0, 0, "Unexpected any. Specify a different type.", "3"]
],
"public/app/plugins/datasource/grafana-testdata-datasource/components/SimulationSchemaForm.tsx:5381": [
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
[0, 0, 0, "Unexpected any. Specify a different type.", "1"],
[0, 0, 0, "Styles should be written using objects.", "2"]
],
"public/app/plugins/datasource/grafana-testdata-datasource/datasource.ts:5381": [
[0, 0, 0, "Do not use any type assertions.", "0"],
[0, 0, 0, "Unexpected any. Specify a different type.", "1"]
],
"public/app/plugins/datasource/grafana-testdata-datasource/nodeGraphUtils.ts:5381": [
[0, 0, 0, "Do not use any type assertions.", "0"],
[0, 0, 0, "Unexpected any. Specify a different type.", "1"],
[0, 0, 0, "Unexpected any. Specify a different type.", "2"]
],
"public/app/plugins/datasource/grafana-testdata-datasource/runStreams.ts:5381": [
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
],
"public/app/plugins/datasource/grafana/components/AnnotationQueryEditor.tsx:5381": [ "public/app/plugins/datasource/grafana/components/AnnotationQueryEditor.tsx:5381": [
[0, 0, 0, "Do not use any type assertions.", "0"] [0, 0, 0, "Do not use any type assertions.", "0"]
], ],
@ -7259,50 +7303,6 @@ exports[`better eslint`] = {
[0, 0, 0, "Unexpected any. Specify a different type.", "0"], [0, 0, 0, "Unexpected any. Specify a different type.", "0"],
[0, 0, 0, "Unexpected any. Specify a different type.", "1"] [0, 0, 0, "Unexpected any. Specify a different type.", "1"]
], ],
"public/app/plugins/datasource/testdata/ConfigEditor.tsx:5381": [
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
],
"public/app/plugins/datasource/testdata/QueryEditor.tsx:5381": [
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
[0, 0, 0, "Do not use any type assertions.", "1"],
[0, 0, 0, "Do not use any type assertions.", "2"],
[0, 0, 0, "Unexpected any. Specify a different type.", "3"],
[0, 0, 0, "Unexpected any. Specify a different type.", "4"],
[0, 0, 0, "Do not use any type assertions.", "5"],
[0, 0, 0, "Unexpected any. Specify a different type.", "6"]
],
"public/app/plugins/datasource/testdata/components/RandomWalkEditor.tsx:5381": [
[0, 0, 0, "Do not use any type assertions.", "0"],
[0, 0, 0, "Do not use any type assertions.", "1"],
[0, 0, 0, "Unexpected any. Specify a different type.", "2"],
[0, 0, 0, "Do not use any type assertions.", "3"]
],
"public/app/plugins/datasource/testdata/components/RawFrameEditor.tsx:5381": [
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
],
"public/app/plugins/datasource/testdata/components/SimulationQueryEditor.tsx:5381": [
[0, 0, 0, "Do not use any type assertions.", "0"],
[0, 0, 0, "Do not use any type assertions.", "1"],
[0, 0, 0, "Unexpected any. Specify a different type.", "2"],
[0, 0, 0, "Unexpected any. Specify a different type.", "3"]
],
"public/app/plugins/datasource/testdata/components/SimulationSchemaForm.tsx:5381": [
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
[0, 0, 0, "Unexpected any. Specify a different type.", "1"],
[0, 0, 0, "Styles should be written using objects.", "2"]
],
"public/app/plugins/datasource/testdata/datasource.ts:5381": [
[0, 0, 0, "Do not use any type assertions.", "0"],
[0, 0, 0, "Unexpected any. Specify a different type.", "1"]
],
"public/app/plugins/datasource/testdata/nodeGraphUtils.ts:5381": [
[0, 0, 0, "Do not use any type assertions.", "0"],
[0, 0, 0, "Unexpected any. Specify a different type.", "1"],
[0, 0, 0, "Unexpected any. Specify a different type.", "2"]
],
"public/app/plugins/datasource/testdata/runStreams.ts:5381": [
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
],
"public/app/plugins/datasource/zipkin/ConfigEditor.tsx:5381": [ "public/app/plugins/datasource/zipkin/ConfigEditor.tsx:5381": [
[0, 0, 0, "Styles should be written using objects.", "0"] [0, 0, 0, "Styles should be written using objects.", "0"]
], ],

View File

@ -96,8 +96,8 @@
}, },
{ {
"files": [ "files": [
"public/app/plugins/datasource/testdata/*.{ts,tsx}", "public/app/plugins/datasource/grafana-testdata-datasource/*.{ts,tsx}",
"public/app/plugins/datasource/testdata/**/*.{ts,tsx}" "public/app/plugins/datasource/grafana-testdata-datasource/**/*.{ts,tsx}"
], ],
"rules": { "rules": {
"no-restricted-imports": [ "no-restricted-imports": [

4
.github/CODEOWNERS vendored
View File

@ -288,7 +288,7 @@
/pkg/services/datasources/ @grafana/plugins-platform-backend /pkg/services/datasources/ @grafana/plugins-platform-backend
/pkg/services/pluginsintegration/ @grafana/plugins-platform-backend /pkg/services/pluginsintegration/ @grafana/plugins-platform-backend
/pkg/plugins/pfs/ @grafana/plugins-platform-backend @grafana/grafana-as-code /pkg/plugins/pfs/ @grafana/plugins-platform-backend @grafana/grafana-as-code
/pkg/tsdb/testdatasource/ @grafana/plugins-platform-backend /pkg/tsdb/grafana-testdata-datasource/ @grafana/plugins-platform-backend
/pkg/services/pluginsintegration/pluginsettings/ @grafana/plugins-platform-backend /pkg/services/pluginsintegration/pluginsettings/ @grafana/plugins-platform-backend
# Backend code docs # Backend code docs
@ -520,7 +520,7 @@ cypress.config.js @grafana/grafana-frontend-platform
/public/app/plugins/datasource/cloudwatch/ @grafana/aws-datasources /public/app/plugins/datasource/cloudwatch/ @grafana/aws-datasources
/public/app/plugins/datasource/elasticsearch/ @grafana/observability-logs /public/app/plugins/datasource/elasticsearch/ @grafana/observability-logs
/public/app/plugins/datasource/grafana/ @grafana/grafana-frontend-platform /public/app/plugins/datasource/grafana/ @grafana/grafana-frontend-platform
/public/app/plugins/datasource/testdata/ @grafana/plugins-platform-frontend /public/app/plugins/datasource/grafana-testdata-datasource/ @grafana/plugins-platform-frontend
/public/app/plugins/datasource/azuremonitor/ @grafana/partner-datasources /public/app/plugins/datasource/azuremonitor/ @grafana/partner-datasources
/public/app/plugins/datasource/graphite/ @grafana/observability-metrics /public/app/plugins/datasource/graphite/ @grafana/observability-metrics
/public/app/plugins/datasource/influxdb/ @grafana/observability-metrics /public/app/plugins/datasource/influxdb/ @grafana/observability-metrics

View File

@ -53,7 +53,10 @@ deny = [
{ pkg = "github.com/grafana/grafana/pkg/tests", desc = "Core plugins are not allowed to depend on Grafana core packages" }, { pkg = "github.com/grafana/grafana/pkg/tests", desc = "Core plugins are not allowed to depend on Grafana core packages" },
{ pkg = "github.com/grafana/grafana/pkg/web", desc = "Core plugins are not allowed to depend on Grafana core packages" }, { pkg = "github.com/grafana/grafana/pkg/web", desc = "Core plugins are not allowed to depend on Grafana core packages" },
] ]
files = ["**/pkg/tsdb/testdatasource/*", "**/pkg/tsdb/testdatasource/**/*"] files = [
"**/pkg/tsdb/grafana-testdata-datasource/*",
"**/pkg/tsdb/grafana-testdata-datasource/**/*",
]
[linters-settings.gocritic] [linters-settings.gocritic]
enabled-checks = ["ruleguard"] enabled-checks = ["ruleguard"]

View File

@ -34,7 +34,7 @@ import (
"github.com/grafana/grafana/pkg/services/user" "github.com/grafana/grafana/pkg/services/user"
"github.com/grafana/grafana/pkg/setting" "github.com/grafana/grafana/pkg/setting"
"github.com/grafana/grafana/pkg/tsdb/cloudwatch" "github.com/grafana/grafana/pkg/tsdb/cloudwatch"
"github.com/grafana/grafana/pkg/tsdb/testdatasource" testdatasource "github.com/grafana/grafana/pkg/tsdb/grafana-testdata-datasource"
"github.com/grafana/grafana/pkg/web/webtest" "github.com/grafana/grafana/pkg/web/webtest"
) )
@ -67,7 +67,7 @@ func TestCallResource(t *testing.T) {
}) })
t.Run("Test successful response is received for valid request", func(t *testing.T) { t.Run("Test successful response is received for valid request", func(t *testing.T) {
req := srv.NewPostRequest("/api/plugins/testdata/resources/test", strings.NewReader("{ \"test\": true }")) req := srv.NewPostRequest("/api/plugins/grafana-testdata-datasource/resources/test", strings.NewReader("{ \"test\": true }"))
webtest.RequestWithSignedInUser(req, &user.SignedInUser{UserID: 1, OrgID: 1, Permissions: map[int64]map[string][]string{ webtest.RequestWithSignedInUser(req, &user.SignedInUser{UserID: 1, OrgID: 1, Permissions: map[int64]map[string][]string{
1: accesscontrol.GroupScopesByAction([]accesscontrol.Permission{ 1: accesscontrol.GroupScopesByAction([]accesscontrol.Permission{
{Action: pluginaccesscontrol.ActionAppAccess, Scope: pluginaccesscontrol.ScopeProvider.GetResourceAllScope()}, {Action: pluginaccesscontrol.ActionAppAccess, Scope: pluginaccesscontrol.ScopeProvider.GetResourceAllScope()},
@ -106,7 +106,7 @@ func TestCallResource(t *testing.T) {
}) })
t.Run("Test error is properly propagated to API response", func(t *testing.T) { t.Run("Test error is properly propagated to API response", func(t *testing.T) {
req := srv.NewGetRequest("/api/plugins/testdata/resources/scenarios") req := srv.NewGetRequest("/api/plugins/grafana-testdata-datasource/resources/scenarios")
webtest.RequestWithSignedInUser(req, &user.SignedInUser{UserID: 1, OrgID: 1, Permissions: map[int64]map[string][]string{ webtest.RequestWithSignedInUser(req, &user.SignedInUser{UserID: 1, OrgID: 1, Permissions: map[int64]map[string][]string{
1: accesscontrol.GroupScopesByAction([]accesscontrol.Permission{ 1: accesscontrol.GroupScopesByAction([]accesscontrol.Permission{
{Action: pluginaccesscontrol.ActionAppAccess, Scope: pluginaccesscontrol.ScopeProvider.GetResourceAllScope()}, {Action: pluginaccesscontrol.ActionAppAccess, Scope: pluginaccesscontrol.ScopeProvider.GetResourceAllScope()},

View File

@ -296,6 +296,7 @@ var irregularPluginNames = map[string]string{
"azuremonitor": "grafana-azure-monitor-datasource", "azuremonitor": "grafana-azure-monitor-datasource",
"microsoftsqlserver": "mssql", "microsoftsqlserver": "mssql",
"postgresql": "postgres", "postgresql": "postgres",
"testdata": "grafana-testdata-datasource",
} }
func buildComposableLinks(pp plugindef.PluginDef, cp kindsys.ComposableProperties) KindLinks { func buildComposableLinks(pp plugindef.PluginDef, cp kindsys.ComposableProperties) KindLinks {

View File

@ -1841,6 +1841,7 @@
"testdatadataquery": { "testdatadataquery": {
"category": "composable", "category": "composable",
"codeowners": [ "codeowners": [
"grafana/plugins-platform-backend",
"grafana/plugins-platform-frontend" "grafana/plugins-platform-frontend"
], ],
"currentVersion": [ "currentVersion": [
@ -1851,9 +1852,9 @@
"lineageIsGroup": false, "lineageIsGroup": false,
"links": { "links": {
"docs": "https://grafana.com/docs/grafana/next/developers/kinds/composable/testdatadataquery/schema-reference", "docs": "https://grafana.com/docs/grafana/next/developers/kinds/composable/testdatadataquery/schema-reference",
"go": "https://github.com/grafana/grafana/tree/main/pkg/tsdb/testdata/kinds/dataquery/types_dataquery_gen.go", "go": "https://github.com/grafana/grafana/tree/main/pkg/tsdb/grafana-testdata-datasource/kinds/dataquery/types_dataquery_gen.go",
"schema": "https://github.com/grafana/grafana/tree/main/public/app/plugins/datasource/testdata/dataquery.cue", "schema": "https://github.com/grafana/grafana/tree/main/public/app/plugins/datasource/grafana-testdata-datasource/dataquery.cue",
"ts": "https://github.com/grafana/grafana/tree/main/public/app/plugins/datasource/testdata/dataquery.gen.ts" "ts": "https://github.com/grafana/grafana/tree/main/public/app/plugins/datasource/grafana-testdata-datasource/dataquery.gen.ts"
}, },
"machineName": "testdatadataquery", "machineName": "testdatadataquery",
"maturity": "experimental", "maturity": "experimental",

View File

@ -14,6 +14,7 @@ import (
"github.com/grafana/grafana/pkg/tsdb/cloudwatch" "github.com/grafana/grafana/pkg/tsdb/cloudwatch"
"github.com/grafana/grafana/pkg/tsdb/elasticsearch" "github.com/grafana/grafana/pkg/tsdb/elasticsearch"
pyroscope "github.com/grafana/grafana/pkg/tsdb/grafana-pyroscope-datasource" pyroscope "github.com/grafana/grafana/pkg/tsdb/grafana-pyroscope-datasource"
testdatasource "github.com/grafana/grafana/pkg/tsdb/grafana-testdata-datasource"
"github.com/grafana/grafana/pkg/tsdb/grafanads" "github.com/grafana/grafana/pkg/tsdb/grafanads"
"github.com/grafana/grafana/pkg/tsdb/graphite" "github.com/grafana/grafana/pkg/tsdb/graphite"
"github.com/grafana/grafana/pkg/tsdb/influxdb" "github.com/grafana/grafana/pkg/tsdb/influxdb"
@ -25,7 +26,6 @@ import (
"github.com/grafana/grafana/pkg/tsdb/postgres" "github.com/grafana/grafana/pkg/tsdb/postgres"
"github.com/grafana/grafana/pkg/tsdb/prometheus" "github.com/grafana/grafana/pkg/tsdb/prometheus"
"github.com/grafana/grafana/pkg/tsdb/tempo" "github.com/grafana/grafana/pkg/tsdb/tempo"
"github.com/grafana/grafana/pkg/tsdb/testdatasource"
) )
const ( const (
@ -39,7 +39,7 @@ const (
OpenTSDB = "opentsdb" OpenTSDB = "opentsdb"
Prometheus = "prometheus" Prometheus = "prometheus"
Tempo = "tempo" Tempo = "tempo"
TestData = "testdata" TestData = "grafana-testdata-datasource"
PostgreSQL = "postgres" PostgreSQL = "postgres"
MySQL = "mysql" MySQL = "mysql"
MSSQL = "mssql" MSSQL = "mssql"

View File

@ -84,6 +84,8 @@ func AliasDecorateFunc(_ context.Context, p *plugins.Plugin) (*plugins.Plugin, e
switch p.ID { switch p.ID {
case "grafana-pyroscope-datasource": // rebranding case "grafana-pyroscope-datasource": // rebranding
p.Alias = "phlare" p.Alias = "phlare"
case "grafana-testdata-datasource":
p.Alias = "testdata"
case "debug": // panel plugin used for testing case "debug": // panel plugin used for testing
p.Alias = "debugX" p.Alias = "debugX"
} }

View File

@ -40,6 +40,7 @@ func corePlugins(rt *thema.Runtime) []pfs.ParsedPlugin {
parsePluginOrPanic("public/app/plugins/datasource/elasticsearch", "elasticsearch", rt), parsePluginOrPanic("public/app/plugins/datasource/elasticsearch", "elasticsearch", rt),
parsePluginOrPanic("public/app/plugins/datasource/grafana", "grafana", rt), parsePluginOrPanic("public/app/plugins/datasource/grafana", "grafana", rt),
parsePluginOrPanic("public/app/plugins/datasource/grafana-pyroscope-datasource", "grafana_pyroscope_datasource", rt), parsePluginOrPanic("public/app/plugins/datasource/grafana-pyroscope-datasource", "grafana_pyroscope_datasource", rt),
parsePluginOrPanic("public/app/plugins/datasource/grafana-testdata-datasource", "grafana_testdata_datasource", rt),
parsePluginOrPanic("public/app/plugins/datasource/graphite", "graphite", rt), parsePluginOrPanic("public/app/plugins/datasource/graphite", "graphite", rt),
parsePluginOrPanic("public/app/plugins/datasource/jaeger", "jaeger", rt), parsePluginOrPanic("public/app/plugins/datasource/jaeger", "jaeger", rt),
parsePluginOrPanic("public/app/plugins/datasource/loki", "loki", rt), parsePluginOrPanic("public/app/plugins/datasource/loki", "loki", rt),
@ -49,7 +50,6 @@ func corePlugins(rt *thema.Runtime) []pfs.ParsedPlugin {
parsePluginOrPanic("public/app/plugins/datasource/postgres", "postgres", rt), parsePluginOrPanic("public/app/plugins/datasource/postgres", "postgres", rt),
parsePluginOrPanic("public/app/plugins/datasource/prometheus", "prometheus", rt), parsePluginOrPanic("public/app/plugins/datasource/prometheus", "prometheus", rt),
parsePluginOrPanic("public/app/plugins/datasource/tempo", "tempo", rt), parsePluginOrPanic("public/app/plugins/datasource/tempo", "tempo", rt),
parsePluginOrPanic("public/app/plugins/datasource/testdata", "testdata", rt),
parsePluginOrPanic("public/app/plugins/datasource/zipkin", "zipkin", rt), parsePluginOrPanic("public/app/plugins/datasource/zipkin", "zipkin", rt),
parsePluginOrPanic("public/app/plugins/panel/alertGroups", "alertGroups", rt), parsePluginOrPanic("public/app/plugins/panel/alertGroups", "alertGroups", rt),
parsePluginOrPanic("public/app/plugins/panel/alertlist", "alertlist", rt), parsePluginOrPanic("public/app/plugins/panel/alertlist", "alertlist", rt),

View File

@ -16,7 +16,7 @@ schemas: [{
// grafana.com, then the plugin `id` has to follow the naming // grafana.com, then the plugin `id` has to follow the naming
// conventions. // conventions.
id: string & strings.MinRunes(1) id: string & strings.MinRunes(1)
id: =~"^([0-9a-z]+\\-([0-9a-z]+\\-)?(\(strings.Join([ for t in _types {t}], "|"))))|(alertGroups|alertlist|annolist|barchart|bargauge|candlestick|canvas|dashlist|debug|datagrid|gauge|geomap|gettingstarted|graph|heatmap|histogram|icon|live|logs|news|nodeGraph|piechart|pluginlist|stat|state-timeline|status-history|table|table-old|text|timeseries|trend|traces|welcome|xychart|alertmanager|cloudwatch|dashboard|elasticsearch|grafana|grafana-azure-monitor-datasource|graphite|influxdb|jaeger|loki|mixed|mssql|mysql|opentsdb|postgres|prometheus|stackdriver|tempo|testdata|zipkin|phlare|parca)$" id: =~"^([0-9a-z]+\\-([0-9a-z]+\\-)?(\(strings.Join([ for t in _types {t}], "|"))))|(alertGroups|alertlist|annolist|barchart|bargauge|candlestick|canvas|dashlist|debug|datagrid|gauge|geomap|gettingstarted|graph|heatmap|histogram|icon|live|logs|news|nodeGraph|piechart|pluginlist|stat|state-timeline|status-history|table|table-old|text|timeseries|trend|traces|welcome|xychart|alertmanager|cloudwatch|dashboard|elasticsearch|grafana|grafana-azure-monitor-datasource|graphite|influxdb|jaeger|loki|mixed|mssql|mysql|opentsdb|postgres|prometheus|stackdriver|tempo|grafana-testdata-datasource|zipkin|phlare|parca)$"
// Human-readable name of the plugin that is shown to the user in // Human-readable name of the plugin that is shown to the user in
// the UI. // the UI.

View File

@ -132,6 +132,8 @@ func ReadPluginJSON(reader io.Reader) (JSONData, error) {
plugin.Name = "Pie Chart (old)" plugin.Name = "Pie Chart (old)"
case "grafana-pyroscope-datasource": // rebranding case "grafana-pyroscope-datasource": // rebranding
plugin.Alias = "phlare" plugin.Alias = "phlare"
case "grafana-testdata-datasource":
plugin.Alias = "testdata"
case "debug": // panel plugin used for testing case "debug": // panel plugin used for testing
plugin.Alias = "debugX" plugin.Alias = "debugX"
} }

View File

@ -143,6 +143,7 @@ import (
"github.com/grafana/grafana/pkg/tsdb/cloudwatch" "github.com/grafana/grafana/pkg/tsdb/cloudwatch"
"github.com/grafana/grafana/pkg/tsdb/elasticsearch" "github.com/grafana/grafana/pkg/tsdb/elasticsearch"
pyroscope "github.com/grafana/grafana/pkg/tsdb/grafana-pyroscope-datasource" pyroscope "github.com/grafana/grafana/pkg/tsdb/grafana-pyroscope-datasource"
testdatasource "github.com/grafana/grafana/pkg/tsdb/grafana-testdata-datasource"
"github.com/grafana/grafana/pkg/tsdb/grafanads" "github.com/grafana/grafana/pkg/tsdb/grafanads"
"github.com/grafana/grafana/pkg/tsdb/graphite" "github.com/grafana/grafana/pkg/tsdb/graphite"
"github.com/grafana/grafana/pkg/tsdb/influxdb" "github.com/grafana/grafana/pkg/tsdb/influxdb"
@ -156,7 +157,6 @@ import (
"github.com/grafana/grafana/pkg/tsdb/postgres" "github.com/grafana/grafana/pkg/tsdb/postgres"
"github.com/grafana/grafana/pkg/tsdb/prometheus" "github.com/grafana/grafana/pkg/tsdb/prometheus"
"github.com/grafana/grafana/pkg/tsdb/tempo" "github.com/grafana/grafana/pkg/tsdb/tempo"
"github.com/grafana/grafana/pkg/tsdb/testdatasource"
) )
var wireBasicSet = wire.NewSet( var wireBasicSet = wire.NewSet(

View File

@ -28,7 +28,7 @@ const (
DS_ES_OPEN_DISTRO = "grafana-es-open-distro-datasource" DS_ES_OPEN_DISTRO = "grafana-es-open-distro-datasource"
DS_ES_OPENSEARCH = "grafana-opensearch-datasource" DS_ES_OPENSEARCH = "grafana-opensearch-datasource"
DS_AZURE_MONITOR = "grafana-azure-monitor-datasource" DS_AZURE_MONITOR = "grafana-azure-monitor-datasource"
DS_TESTDATA = "testdata" DS_TESTDATA = "grafana-testdata-datasource"
// CustomHeaderName is the prefix that is used to store the name of a custom header. // CustomHeaderName is the prefix that is used to store the name of a custom header.
CustomHeaderName = "httpHeaderName" CustomHeaderName = "httpHeaderName"
// CustomHeaderValue is the prefix that is used to store the value of a custom header. // CustomHeaderValue is the prefix that is used to store the value of a custom header.

View File

@ -28,6 +28,7 @@ import (
"github.com/grafana/grafana/pkg/tsdb/cloudwatch" "github.com/grafana/grafana/pkg/tsdb/cloudwatch"
"github.com/grafana/grafana/pkg/tsdb/elasticsearch" "github.com/grafana/grafana/pkg/tsdb/elasticsearch"
pyroscope "github.com/grafana/grafana/pkg/tsdb/grafana-pyroscope-datasource" pyroscope "github.com/grafana/grafana/pkg/tsdb/grafana-pyroscope-datasource"
testdatasource "github.com/grafana/grafana/pkg/tsdb/grafana-testdata-datasource"
"github.com/grafana/grafana/pkg/tsdb/grafanads" "github.com/grafana/grafana/pkg/tsdb/grafanads"
"github.com/grafana/grafana/pkg/tsdb/graphite" "github.com/grafana/grafana/pkg/tsdb/graphite"
"github.com/grafana/grafana/pkg/tsdb/influxdb" "github.com/grafana/grafana/pkg/tsdb/influxdb"
@ -39,7 +40,6 @@ import (
"github.com/grafana/grafana/pkg/tsdb/postgres" "github.com/grafana/grafana/pkg/tsdb/postgres"
"github.com/grafana/grafana/pkg/tsdb/prometheus" "github.com/grafana/grafana/pkg/tsdb/prometheus"
"github.com/grafana/grafana/pkg/tsdb/tempo" "github.com/grafana/grafana/pkg/tsdb/tempo"
"github.com/grafana/grafana/pkg/tsdb/testdatasource"
) )
func TestIntegrationPluginManager(t *testing.T) { func TestIntegrationPluginManager(t *testing.T) {
@ -113,7 +113,7 @@ func verifyPluginQuery(t *testing.T, ctx context.Context, c plugins.Client) {
now := time.Unix(1661420870, 0) now := time.Unix(1661420870, 0)
req := &backend.QueryDataRequest{ req := &backend.QueryDataRequest{
PluginContext: backend.PluginContext{ PluginContext: backend.PluginContext{
PluginID: "testdata", PluginID: "grafana-testdata-datasource",
}, },
Queries: []backend.DataQuery{ Queries: []backend.DataQuery{
{ {
@ -184,7 +184,7 @@ func verifyCorePluginCatalogue(t *testing.T, ctx context.Context, ps *pluginstor
"opentsdb": {}, "opentsdb": {},
"prometheus": {}, "prometheus": {},
"tempo": {}, "tempo": {},
"testdata": {}, "grafana-testdata-datasource": {},
"postgres": {}, "postgres": {},
"mysql": {}, "mysql": {},
"mssql": {}, "mssql": {},

View File

@ -19,7 +19,7 @@ import (
"github.com/grafana/grafana/pkg/services/quota/quotatest" "github.com/grafana/grafana/pkg/services/quota/quotatest"
"github.com/grafana/grafana/pkg/services/user" "github.com/grafana/grafana/pkg/services/user"
"github.com/grafana/grafana/pkg/setting" "github.com/grafana/grafana/pkg/setting"
"github.com/grafana/grafana/pkg/tsdb/testdatasource" testdatasource "github.com/grafana/grafana/pkg/tsdb/grafana-testdata-datasource"
) )
var ( var (

View File

@ -145,14 +145,14 @@ func TestIntegrationPluginAssets(t *testing.T) {
{ {
desc: "should return no-cache settings for Dev env", desc: "should return no-cache settings for Dev env",
env: setting.Dev, env: setting.Dev,
url: "http://%s/public/plugins/testdata/img/testdata.svg", url: "http://%s/public/plugins/grafana-testdata-datasource/img/testdata.svg",
expStatus: http.StatusOK, expStatus: http.StatusOK,
expCacheControl: "max-age=0, must-revalidate, no-cache", expCacheControl: "max-age=0, must-revalidate, no-cache",
}, },
{ {
desc: "should return cache settings for Prod env", desc: "should return cache settings for Prod env",
env: setting.Prod, env: setting.Prod,
url: "http://%s/public/plugins/testdata/img/testdata.svg", url: "http://%s/public/plugins/grafana-testdata-datasource/img/testdata.svg",
expStatus: http.StatusOK, expStatus: http.StatusOK,
expCacheControl: "public, max-age=3600", expCacheControl: "public, max-age=3600",
}, },

View File

@ -1598,7 +1598,7 @@
{ {
"name": "TestData", "name": "TestData",
"type": "datasource", "type": "datasource",
"id": "testdata", "id": "grafana-testdata-datasource",
"enabled": true, "enabled": true,
"pinned": false, "pinned": false,
"info": { "info": {
@ -1609,8 +1609,8 @@
"description": "Generates test data in different forms", "description": "Generates test data in different forms",
"links": null, "links": null,
"logos": { "logos": {
"small": "/public/app/plugins/datasource/testdata/img/testdata.svg", "small": "/public/app/plugins/datasource/grafana-testdata-datasource/img/testdata.svg",
"large": "/public/app/plugins/datasource/testdata/img/testdata.svg" "large": "/public/app/plugins/datasource/grafana-testdata-datasource/img/testdata.svg"
}, },
"build": {}, "build": {},
"screenshots": null, "screenshots": null,
@ -1624,7 +1624,7 @@
}, },
"latestVersion": "", "latestVersion": "",
"hasUpdate": false, "hasUpdate": false,
"defaultNavUrl": "/plugins/testdata/", "defaultNavUrl": "/plugins/grafana-testdata-datasource/",
"category": "", "category": "",
"state": "", "state": "",
"signature": "internal", "signature": "internal",

View File

@ -9,7 +9,7 @@ import (
"github.com/grafana/grafana-plugin-sdk-go/backend/log" "github.com/grafana/grafana-plugin-sdk-go/backend/log"
"github.com/grafana/grafana-plugin-sdk-go/backend/resource/httpadapter" "github.com/grafana/grafana-plugin-sdk-go/backend/resource/httpadapter"
"github.com/grafana/grafana-plugin-sdk-go/data" "github.com/grafana/grafana-plugin-sdk-go/data"
"github.com/grafana/grafana/pkg/tsdb/testdatasource/sims" "github.com/grafana/grafana/pkg/tsdb/grafana-testdata-datasource/sims"
) )
func ProvideService() *Service { func ProvideService() *Service {

View File

@ -17,7 +17,7 @@ import (
"github.com/grafana/grafana/pkg/services/datasources" "github.com/grafana/grafana/pkg/services/datasources"
"github.com/grafana/grafana/pkg/services/searchV2" "github.com/grafana/grafana/pkg/services/searchV2"
"github.com/grafana/grafana/pkg/services/store" "github.com/grafana/grafana/pkg/services/store"
"github.com/grafana/grafana/pkg/tsdb/testdatasource" testdatasource "github.com/grafana/grafana/pkg/tsdb/grafana-testdata-datasource"
) )
// DatasourceName is the string constant used as the datasource name in requests // DatasourceName is the string constant used as the datasource name in requests

View File

@ -28,7 +28,7 @@ const prometheusPlugin = async () =>
const mssqlPlugin = async () => const mssqlPlugin = async () =>
await import(/* webpackChunkName: "mssqlPlugin" */ 'app/plugins/datasource/mssql/module'); await import(/* webpackChunkName: "mssqlPlugin" */ 'app/plugins/datasource/mssql/module');
const testDataDSPlugin = async () => const testDataDSPlugin = async () =>
await import(/* webpackChunkName: "testDataDSPlugin" */ 'app/plugins/datasource/testdata/module'); await import(/* webpackChunkName: "testDataDSPlugin" */ 'app/plugins/datasource/grafana-testdata-datasource/module');
const cloudMonitoringPlugin = async () => const cloudMonitoringPlugin = async () =>
await import(/* webpackChunkName: "cloudMonitoringPlugin" */ 'app/plugins/datasource/cloud-monitoring/module'); await import(/* webpackChunkName: "cloudMonitoringPlugin" */ 'app/plugins/datasource/cloud-monitoring/module');
const azureMonitorPlugin = async () => const azureMonitorPlugin = async () =>
@ -97,7 +97,7 @@ const builtInPlugins: Record<string, System.Module | (() => Promise<System.Modul
'core:plugin/postgres': postgresPlugin, 'core:plugin/postgres': postgresPlugin,
'core:plugin/mssql': mssqlPlugin, 'core:plugin/mssql': mssqlPlugin,
'core:plugin/prometheus': prometheusPlugin, 'core:plugin/prometheus': prometheusPlugin,
'core:plugin/testdata': testDataDSPlugin, 'core:plugin/grafana-testdata-datasource': testDataDSPlugin,
'core:plugin/cloud-monitoring': cloudMonitoringPlugin, 'core:plugin/cloud-monitoring': cloudMonitoringPlugin,
'core:plugin/azuremonitor': azureMonitorPlugin, 'core:plugin/azuremonitor': azureMonitorPlugin,
'core:plugin/tempo': tempoPlugin, 'core:plugin/tempo': tempoPlugin,

View File

@ -7,7 +7,7 @@ import {
SceneGridItem, SceneGridItem,
PanelBuilders, PanelBuilders,
} from '@grafana/scenes'; } from '@grafana/scenes';
import { TestDataQueryType } from 'app/plugins/datasource/testdata/dataquery.gen'; import { TestDataQueryType } from 'app/plugins/datasource/grafana-testdata-datasource/dataquery.gen';
import { DashboardScene } from '../../dashboard-scene/scene/DashboardScene'; import { DashboardScene } from '../../dashboard-scene/scene/DashboardScene';

View File

@ -7,7 +7,7 @@ import {
SceneGridItem, SceneGridItem,
PanelBuilders, PanelBuilders,
} from '@grafana/scenes'; } from '@grafana/scenes';
import { TestDataQueryType } from 'app/plugins/datasource/testdata/dataquery.gen'; import { TestDataQueryType } from 'app/plugins/datasource/grafana-testdata-datasource/dataquery.gen';
import { DashboardScene } from '../../dashboard-scene/scene/DashboardScene'; import { DashboardScene } from '../../dashboard-scene/scene/DashboardScene';

View File

@ -1,5 +1,5 @@
import { QueryRunnerState, SceneQueryRunner } from '@grafana/scenes'; import { QueryRunnerState, SceneQueryRunner } from '@grafana/scenes';
import { TestData } from 'app/plugins/datasource/testdata/dataquery.gen'; import { TestData } from 'app/plugins/datasource/grafana-testdata-datasource/dataquery.gen';
export function getQueryRunnerWithRandomWalkQuery( export function getQueryRunnerWithRandomWalkQuery(
overrides?: Partial<TestData>, overrides?: Partial<TestData>,

View File

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@ -1,7 +1,7 @@
{ {
"type": "datasource", "type": "datasource",
"name": "TestData", "name": "TestData",
"id": "testdata", "id": "grafana-testdata-datasource",
"metrics": true, "metrics": true,
"logs": true, "logs": true,