Mono repo -> Master (#22553)
Combines the following repositories into one: https://github.com/mattermost/mattermost-server https://github.com/mattermost/mattermost-webapp https://github.com/mattermost/focalboard https://github.com/mattermost/mattermost-plugin-playbooks
Этот коммит содержится в:
@@ -12,6 +12,7 @@ import (
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/mattermost/mattermost-server/v6/model"
|
||||
"github.com/mattermost/mattermost-server/v6/server/platform/shared/mlog"
|
||||
)
|
||||
|
||||
func TestAvailablePlugins(t *testing.T) {
|
||||
@@ -21,8 +22,10 @@ func TestAvailablePlugins(t *testing.T) {
|
||||
os.RemoveAll(dir)
|
||||
})
|
||||
|
||||
testLogger, _ := mlog.NewLogger()
|
||||
env := Environment{
|
||||
pluginDir: dir,
|
||||
logger: testLogger,
|
||||
}
|
||||
|
||||
t.Run("Should be able to load available plugins", func(t *testing.T) {
|
||||
@@ -70,4 +73,26 @@ func TestAvailablePlugins(t *testing.T) {
|
||||
require.NoError(t, err)
|
||||
require.Len(t, bundles, 0)
|
||||
})
|
||||
|
||||
t.Run("Should not load bundles on blocklist", func(t *testing.T) {
|
||||
bundle := model.BundleInfo{
|
||||
Manifest: &model.Manifest{
|
||||
Id: "playbooks",
|
||||
Version: "1",
|
||||
},
|
||||
}
|
||||
err := os.Mkdir(filepath.Join(dir, "plugin4"), 0700)
|
||||
require.NoError(t, err)
|
||||
defer os.RemoveAll(filepath.Join(dir, "plugin4"))
|
||||
|
||||
path := filepath.Join(dir, "plugin4", "plugin.json")
|
||||
manifestJSON, jsonErr := json.Marshal(bundle.Manifest)
|
||||
require.NoError(t, jsonErr)
|
||||
err = os.WriteFile(path, manifestJSON, 0644)
|
||||
require.NoError(t, err)
|
||||
|
||||
bundles, err := env.Available()
|
||||
require.NoError(t, err)
|
||||
require.Len(t, bundles, 0)
|
||||
})
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user