Plugins: Refactor call resource API handling (#67234)

Moving call resource API stream handling within plugin management as a utility/wrapper. 

Closes #66889

Co-authored-by: Will Browne <wbrowne@users.noreply.github.com>
This commit is contained in:
Marcus Efraimsson
2023-04-28 14:02:27 +02:00
committed by GitHub
co-authored by Will Browne
parent b5fbce50b3
commit 4cbda914bd
6 changed files with 252 additions and 169 deletions
+3
View File
@@ -15,6 +15,7 @@ import (
"github.com/grafana/grafana/pkg/infra/db"
"github.com/grafana/grafana/pkg/infra/localcache"
"github.com/grafana/grafana/pkg/infra/log"
"github.com/grafana/grafana/pkg/infra/tracing"
"github.com/grafana/grafana/pkg/plugins/backendplugin/coreplugin"
"github.com/grafana/grafana/pkg/plugins/backendplugin/provider"
@@ -79,6 +80,7 @@ func TestCallResource(t *testing.T) {
hs.QuotaService = quotatest.New(false, nil)
hs.pluginStore = ps
hs.pluginClient = pluginClient.ProvideService(reg, pCfg)
hs.log = log.New("test")
})
t.Run("Test successful response is received for valid request", func(t *testing.T) {
@@ -117,6 +119,7 @@ func TestCallResource(t *testing.T) {
hs.QuotaService = quotatest.New(false, nil)
hs.pluginStore = ps
hs.pluginClient = pc
hs.log = log.New("test")
})
t.Run("Test error is properly propagated to API response", func(t *testing.T) {