Plugins: Fix loading of dist folders (#80015)

* end to end

* tidy

* fix whitespace

* remove unused code

* fix linter

* fix gosec + add sort

* fix test

* apply cr feedback
This commit is contained in:
Will Browne
2024-01-08 11:45:03 +01:00
committed by GitHub
parent 0440b29ebf
commit 78ae795e06
6 changed files with 114 additions and 93 deletions

View File

@ -51,30 +51,20 @@ func TestIntegrationPluginManager(t *testing.T) {
bundledPluginsPath, err := filepath.Abs("../../../plugins-bundled/internal")
require.NoError(t, err)
// We use the raw config here as it forms the basis for the setting.Provider implementation
// The plugin manager also relies directly on the setting.Cfg struct to provide Grafana specific
// properties such as the loading paths
raw, err := ini.Load([]byte(`
app_mode = production
[plugin.test-app]
path=../../plugins/manager/testdata/test-app
[plugin.test-panel]
not=included
`),
)
require.NoError(t, err)
features := featuremgmt.WithFeatures()
cfg := &setting.Cfg{
Raw: raw,
Raw: ini.Empty(),
StaticRootPath: staticRootPath,
BundledPluginsPath: bundledPluginsPath,
Azure: &azsettings.AzureSettings{},
// nolint:staticcheck
IsFeatureToggleEnabled: features.IsEnabledGlobally,
PluginSettings: map[string]map[string]string{
"test-app": {
"path": "../../plugins/manager/testdata/test-app",
},
"test-panel": {
"not": "included",
},
},
}
tracer := tracing.InitializeTracerForTest()