Plugins: Create single point of entry for adding / removing plugins (#55463)

* split out plugin manager

* remove whitespace

* fix tests

* split up tests

* updating naming conventions

* simplify manager

* tidy

* explorations

* fix build

* tidy

* fix tests

* add logger helper

* pass the tests

* tidying

* fix tests

* tidy and re-add test

* store depends on loader

* enrich tests

* fix test

* undo gomod changes
This commit is contained in:
Will Browne
2022-09-23 14:27:01 +02:00
committed by GitHub
parent 003a1cdaa0
commit d0d8544ded
21 changed files with 785 additions and 622 deletions

View File

@ -49,7 +49,7 @@ import (
"github.com/grafana/grafana/pkg/tsdb/testdatasource"
)
func TestIntegrationPluginManager_Run(t *testing.T) {
func TestIntegrationPluginManager(t *testing.T) {
t.Helper()
staticRootPath, err := filepath.Abs("../../../public/")
@ -110,16 +110,15 @@ func TestIntegrationPluginManager_Run(t *testing.T) {
pCfg := config.ProvideConfig(setting.ProvideProvider(cfg), cfg)
reg := registry.ProvideService()
pm, err := ProvideService(pCfg, cfg, reg, loader.New(pCfg, license, signature.NewUnsignedAuthorizer(pCfg),
provider.ProvideService(coreRegistry)), nil)
l := loader.ProvideService(pCfg, license, signature.NewUnsignedAuthorizer(pCfg), reg, provider.ProvideService(coreRegistry))
ps, err := store.ProvideService(cfg, pCfg, reg, l)
require.NoError(t, err)
ps := store.ProvideService(reg)
ctx := context.Background()
verifyCorePluginCatalogue(t, ctx, ps)
verifyBundledPlugins(t, ctx, ps)
verifyPluginStaticRoutes(t, ctx, ps)
verifyBackendProcesses(t, pm.pluginRegistry.Plugins(ctx))
verifyBackendProcesses(t, reg.Plugins(ctx))
verifyPluginQuery(t, ctx, client.ProvideService(reg))
}