[WIP] Plugins: Refactoring backend initialization flow (#42247)

* refactoring store interface and init flow

* fix import

* fix linter

* refactor resource calling

* load with class

* re-order args

* fix tests

* fix linter

* remove old creator

* add custom config struct

* fix some tests

* cleanup

* fix linter

* add connect failure error

* remove unused err

* convert test over
This commit is contained in:
Will Browne
2022-01-14 13:30:39 +01:00
committed by GitHub
parent 7ffefc069f
commit 7694fff0ef
20 changed files with 566 additions and 580 deletions
@@ -7,6 +7,7 @@ import (
"testing"
"github.com/grafana/grafana/pkg/plugins"
"github.com/grafana/grafana/pkg/plugins/backendplugin/provider"
"github.com/grafana/grafana/pkg/plugins/manager/loader"
"github.com/grafana/grafana/pkg/plugins/manager/signature"
"github.com/grafana/grafana/pkg/services/licensing"
@@ -42,9 +43,10 @@ func TestPluginManager_int_init(t *testing.T) {
license := &licensing.OSSLicensingService{
Cfg: cfg,
}
pm := newManager(cfg, nil, loader.New(license, cfg, &signature.UnsignedPluginAuthorizer{Cfg: cfg}), nil)
err = pm.init()
pmCfg := plugins.FromGrafanaCfg(cfg)
pm, err := ProvideService(cfg, nil, loader.New(pmCfg, license,
&signature.UnsignedPluginAuthorizer{Cfg: pmCfg}, &provider.Service{}), nil)
require.NoError(t, err)
verifyCorePluginCatalogue(t, pm)