summaryrefslogtreecommitdiffstats
path: root/app/apptestlib.go
diff options
context:
space:
mode:
authorMartin Kraft <martinkraft@gmail.com>2018-05-24 08:40:52 -0400
committerMartin Kraft <martinkraft@gmail.com>2018-05-24 08:40:52 -0400
commit69304fb54da5300941a49364e4344c2c65e654d6 (patch)
treede20c2e8a479ae3d13bcd21abc3dff067afa602e /app/apptestlib.go
parente46b94fa66c029b9a493fdc6ff7bcb98e9651568 (diff)
parent47f3c064db885c2cb2e75c195ea24e2ef687891d (diff)
downloadchat-69304fb54da5300941a49364e4344c2c65e654d6.tar.gz
chat-69304fb54da5300941a49364e4344c2c65e654d6.tar.bz2
chat-69304fb54da5300941a49364e4344c2c65e654d6.zip
Merge remote-tracking branch 'origin/master' into advanced-permissions-phase-2
Diffstat (limited to 'app/apptestlib.go')
-rw-r--r--app/apptestlib.go30
1 files changed, 19 insertions, 11 deletions
diff --git a/app/apptestlib.go b/app/apptestlib.go
index ffd1da055..ec4992a75 100644
--- a/app/apptestlib.go
+++ b/app/apptestlib.go
@@ -370,6 +370,10 @@ func (s *mockPluginSupervisor) Start(api plugin.API) error {
return s.hooks.OnActivate(api)
}
+func (s *mockPluginSupervisor) Wait() error {
+ return nil
+}
+
func (s *mockPluginSupervisor) Stop() error {
return nil
}
@@ -387,17 +391,6 @@ func (me *TestHelper) InstallPlugin(manifest *model.Manifest, hooks plugin.Hooks
me.tempWorkspace = dir
}
- pluginDir := filepath.Join(me.tempWorkspace, "plugins")
- webappDir := filepath.Join(me.tempWorkspace, "webapp")
- me.App.InitPlugins(pluginDir, webappDir, func(bundle *model.BundleInfo) (plugin.Supervisor, error) {
- if hooks, ok := me.pluginHooks[bundle.Manifest.Id]; ok {
- return &mockPluginSupervisor{hooks}, nil
- }
- return pluginenv.DefaultSupervisorProvider(bundle)
- })
-
- me.pluginHooks[manifest.Id] = hooks
-
manifestCopy := *manifest
if manifestCopy.Backend == nil {
manifestCopy.Backend = &model.ManifestBackend{}
@@ -407,6 +400,9 @@ func (me *TestHelper) InstallPlugin(manifest *model.Manifest, hooks plugin.Hooks
panic(err)
}
+ pluginDir := filepath.Join(me.tempWorkspace, "plugins")
+ webappDir := filepath.Join(me.tempWorkspace, "webapp")
+
if err := os.MkdirAll(filepath.Join(pluginDir, manifest.Id), 0700); err != nil {
panic(err)
}
@@ -414,6 +410,15 @@ func (me *TestHelper) InstallPlugin(manifest *model.Manifest, hooks plugin.Hooks
if err := ioutil.WriteFile(filepath.Join(pluginDir, manifest.Id, "plugin.json"), manifestBytes, 0600); err != nil {
panic(err)
}
+
+ me.App.InitPlugins(pluginDir, webappDir, func(bundle *model.BundleInfo) (plugin.Supervisor, error) {
+ if hooks, ok := me.pluginHooks[bundle.Manifest.Id]; ok {
+ return &mockPluginSupervisor{hooks}, nil
+ }
+ return pluginenv.DefaultSupervisorProvider(bundle)
+ })
+
+ me.pluginHooks[manifest.Id] = hooks
}
func (me *TestHelper) ResetRoleMigration() {
@@ -449,6 +454,9 @@ func (me *FakeClusterInterface) GetClusterStats() ([]*model.ClusterStats, *model
func (me *FakeClusterInterface) GetLogs(page, perPage int) ([]string, *model.AppError) {
return []string{}, nil
}
+func (me *FakeClusterInterface) GetPluginStatuses() (model.PluginStatuses, *model.AppError) {
+ return nil, nil
+}
func (me *FakeClusterInterface) ConfigChanged(previousConfig *model.Config, newConfig *model.Config, sendToOtherServer bool) *model.AppError {
return nil
}