fix plugin test (#7436)
* fix plugin test * ugh. global state * Fix plugin test * Fix TestDeleteChannel * Remove plugin config listener when shutting down
Этот коммит содержится в:
коммит произвёл
Joram Wilander
родитель
b066b6df13
Коммит
4731b8f9b9
@@ -26,17 +26,21 @@ func TestPlugin(t *testing.T) {
|
||||
os.RemoveAll(webappDir)
|
||||
}()
|
||||
|
||||
th := Setup().InitBasic().InitSystemAdmin()
|
||||
th := SetupEnterprise().InitBasic().InitSystemAdmin()
|
||||
defer TearDown()
|
||||
|
||||
th.App.InitPlugins(pluginDir, webappDir)
|
||||
|
||||
enablePlugins := *utils.Cfg.PluginSettings.Enable
|
||||
defer func() {
|
||||
*utils.Cfg.PluginSettings.Enable = enablePlugins
|
||||
}()
|
||||
*utils.Cfg.PluginSettings.Enable = true
|
||||
|
||||
th.App.InitPlugins(pluginDir, webappDir)
|
||||
defer func() {
|
||||
th.App.ShutDownPlugins()
|
||||
th.App.PluginEnv = nil
|
||||
}()
|
||||
|
||||
path, _ := utils.FindDir("tests")
|
||||
file, err := os.Open(path + "/testplugin.tar.gz")
|
||||
if err != nil {
|
||||
@@ -108,7 +112,5 @@ func TestPlugin(t *testing.T) {
|
||||
CheckForbiddenStatus(t, resp)
|
||||
|
||||
_, resp = th.SystemAdminClient.RemovePlugin("bad.id")
|
||||
CheckNotFoundStatus(t, resp)
|
||||
|
||||
th.App.PluginEnv = nil
|
||||
CheckBadRequestStatus(t, resp)
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user