Fix back-end tests on Windows (#26355)

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
This commit is contained in:
Arve Knudsen
2020-07-15 20:09:03 +02:00
committed by GitHub
parent 5046e54918
commit 5fe27ee959
3 changed files with 6 additions and 5 deletions
+3 -3
View File
@@ -9,7 +9,7 @@ import (
"io"
"io/ioutil"
"os"
"path"
"path/filepath"
"github.com/grafana/grafana/pkg/infra/log"
"github.com/grafana/grafana/pkg/util/errutil"
@@ -85,7 +85,7 @@ func readPluginManifest(body []byte) (*pluginManifest, error) {
// getPluginSignatureState returns the signature state for a plugin.
func getPluginSignatureState(log log.Logger, plugin *PluginBase) PluginSignature {
log.Debug("Getting signature state of plugin", "plugin", plugin.Id)
manifestPath := path.Join(plugin.PluginDir, "MANIFEST.txt")
manifestPath := filepath.Join(plugin.PluginDir, "MANIFEST.txt")
byteValue, err := ioutil.ReadFile(manifestPath)
if err != nil || len(byteValue) < 10 {
@@ -106,7 +106,7 @@ func getPluginSignatureState(log log.Logger, plugin *PluginBase) PluginSignature
log.Debug("Verifying contents of plugin manifest", "plugin", plugin.Id)
for p, hash := range manifest.Files {
// Open the file
fp := path.Join(plugin.PluginDir, p)
fp := filepath.Join(plugin.PluginDir, p)
f, err := os.Open(fp)
if err != nil {
return PluginSignatureModified
+1 -1
View File
@@ -160,7 +160,7 @@ func TestPluginManager_Init(t *testing.T) {
err := pm.Init()
require.NoError(t, err)
assert.Empty(t, pm.scanningErrors)
require.Empty(t, pm.scanningErrors)
assert.Equal(t, []string{"gel"}, fm.registeredPlugins)
})
}