Plugins: Move store init to dskit service (#111206)

This commit is contained in:
Todd Treece
2025-09-29 15:32:15 -04:00
committed by GitHub
parent 0a06183d84
commit 4cff7237d0
9 changed files with 231 additions and 101 deletions
@@ -26,7 +26,7 @@ func TestService_IsDisabled(t *testing.T) {
&setting.Cfg{
PreinstallPluginsAsync: []setting.InstallPlugin{{ID: "myplugin"}},
},
pluginstore.New(registry.NewInMemory(), &fakes.FakeLoader{}),
pluginstore.New(registry.NewInMemory(), &fakes.FakeLoader{}, &fakes.FakeSourceRegistry{}),
&fakes.FakePluginInstaller{},
prometheus.NewRegistry(),
&fakes.FakePluginRepo{},
@@ -160,12 +160,14 @@ func TestService_Run(t *testing.T) {
}
installed := 0
installedFromURL := 0
store, err := pluginstore.NewPluginStoreForTest(preg, &fakes.FakeLoader{}, &fakes.FakeSourceRegistry{})
require.NoError(t, err)
s, err := ProvideService(
&setting.Cfg{
PreinstallPluginsAsync: tt.pluginsToInstall,
PreinstallPluginsSync: tt.pluginsToInstallSync,
},
pluginstore.New(preg, &fakes.FakeLoader{}),
store,
&fakes.FakePluginInstaller{
AddFunc: func(ctx context.Context, pluginID string, version string, opts plugins.AddOpts) error {
for _, plugin := range tt.pluginsToFail {