"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "pkg/plugins/manager/manager_test.go" between
grafana-8.0.0.tar.gz and grafana-8.0.1.tar.gz

About: Grafana is a visualization tool for monitoring, metric analytics and dashboards for Graphite, InfluxDB, Prometheus and many more.

manager_test.go  (grafana-8.0.0):manager_test.go  (grafana-8.0.1)
skipping to change at line 285 skipping to change at line 285
pm := createManager(t, func(pm *PluginManager) { pm := createManager(t, func(pm *PluginManager) {
pm.Cfg.PluginsPath = "testdata/valid-v2-pvt-signature" pm.Cfg.PluginsPath = "testdata/valid-v2-pvt-signature"
}) })
err := pm.Init() err := pm.Init()
require.NoError(t, err) require.NoError(t, err)
assert.Equal(t, []error{fmt.Errorf(`plugin 'test' has an invalid signature`)}, pm.scanningErrors) assert.Equal(t, []error{fmt.Errorf(`plugin 'test' has an invalid signature`)}, pm.scanningErrors)
assert.Nil(t, pm.plugins[("test")]) assert.Nil(t, pm.plugins[("test")])
}) })
t.Run("With back-end plugin with valid v2 private signature (plugin root
URL ignores trailing slash)", func(t *testing.T) {
origAppURL := setting.AppUrl
origAppSubURL := setting.AppSubUrl
t.Cleanup(func() {
setting.AppUrl = origAppURL
setting.AppSubUrl = origAppSubURL
})
setting.AppUrl = "http://localhost:3000/"
setting.AppSubUrl = "/grafana"
pm := createManager(t, func(pm *PluginManager) {
pm.Cfg.PluginsPath = "testdata/valid-v2-pvt-signature-roo
t-url-uri"
})
err := pm.Init()
require.NoError(t, err)
require.Empty(t, pm.scanningErrors)
const pluginID = "test"
assert.NotNil(t, pm.plugins[pluginID])
assert.Equal(t, "datasource", pm.plugins[pluginID].Type)
assert.Equal(t, "Test", pm.plugins[pluginID].Name)
assert.Equal(t, pluginID, pm.plugins[pluginID].Id)
assert.Equal(t, "1.0.0", pm.plugins[pluginID].Info.Version)
assert.Equal(t, plugins.PluginSignatureValid, pm.plugins[pluginID
].Signature)
assert.Equal(t, plugins.PrivateType, pm.plugins[pluginID].Signatu
reType)
assert.Equal(t, "Will Browne", pm.plugins[pluginID].SignatureOrg)
assert.False(t, pm.plugins[pluginID].IsCorePlugin)
})
t.Run("With back-end plugin with valid v2 private signature", func(t *tes ting.T) { t.Run("With back-end plugin with valid v2 private signature", func(t *tes ting.T) {
origAppURL := setting.AppUrl origAppURL := setting.AppUrl
t.Cleanup(func() { t.Cleanup(func() {
setting.AppUrl = origAppURL setting.AppUrl = origAppURL
}) })
setting.AppUrl = "http://localhost:3000/" setting.AppUrl = "http://localhost:3000/"
pm := createManager(t, func(pm *PluginManager) { pm := createManager(t, func(pm *PluginManager) {
pm.Cfg.PluginsPath = "testdata/valid-v2-pvt-signature" pm.Cfg.PluginsPath = "testdata/valid-v2-pvt-signature"
}) })
 End of changes. 1 change blocks. 
0 lines changed or deleted 33 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)