Files
grafana/pkg/tests/apis/plugins/discovery_test.go
T
Charandas 16f5eab786 MTFF: Allow viewers access in cloud (#114607)
* Reapply "K8s: read resource configs from API Enablement for API Builders" (#114475)

This reverts commit 4130bd9cd3.

* revert part that broke things

* FF service changes are gonna come later

* MTFF: allow viewers access to MTFF by enforcing runtime_config for custom routes

* unused var

* removed now

* pass the test, include defaults

* revert sample.ini change
2025-12-08 17:37:10 -08:00

92 lines
1.7 KiB
Go

package plugins
import (
"testing"
"github.com/stretchr/testify/require"
"github.com/grafana/grafana/pkg/util/testutil"
)
func TestIntegrationPluginsIntegrationDiscovery(t *testing.T) {
testutil.SkipIntegrationTestInShortMode(t)
t.Run("discovery", func(t *testing.T) {
helper := setupHelper(t)
disco, err := helper.GetGroupVersionInfoJSON("plugins.grafana.app")
require.NoError(t, err)
require.JSONEq(t, `[
{
"version": "v0alpha1",
"freshness": "Current",
"resources": [
{
"resource": "pluginmetas",
"responseKind": {
"group": "",
"kind": "PluginMeta",
"version": ""
},
"scope": "Namespaced",
"singularResource": "pluginmeta",
"subresources": [
{
"responseKind": {
"group": "",
"kind": "PluginMeta",
"version": ""
},
"subresource": "status",
"verbs": [
"get",
"patch",
"update"
]
}
],
"verbs": [
"get",
"list"
]
},
{
"resource": "plugins",
"responseKind": {
"group": "",
"kind": "Plugin",
"version": ""
},
"scope": "Namespaced",
"singularResource": "plugins",
"subresources": [
{
"responseKind": {
"group": "",
"kind": "Plugin",
"version": ""
},
"subresource": "status",
"verbs": [
"get",
"patch",
"update"
]
}
],
"verbs": [
"create",
"delete",
"deletecollection",
"get",
"list",
"patch",
"update",
"watch"
]
}
]
}
]`, disco)
})
}