MM-23261 plugin stderr debug logs (#14166)

* explicitly assert panic as error log

* Revert "[MM-18150] plugin panic trace should not be lost (#13559)"

This reverts commit 5d928b4f94, while leaving the unit tests intact
and now asserting debug logs instead.

* missing license header
Этот коммит содержится в:
Jesse Hallam
2020-03-30 15:00:45 -03:00
коммит произвёл GitHub
родитель 383e45b13d
Коммит f149ada16a
5 изменённых файлов: 36 добавлений и 23 удалений

Просмотреть файл

@@ -13,7 +13,6 @@ import (
"net/http/httptest"
"os"
"path/filepath"
"strings"
"testing"
"time"
@@ -21,8 +20,10 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/mattermost/mattermost-server/v5/mlog"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/plugin"
"github.com/mattermost/mattermost-server/v5/testlib"
"github.com/mattermost/mattermost-server/v5/utils"
"github.com/mattermost/mattermost-server/v5/utils/fileutils"
)
@@ -665,8 +666,7 @@ func TestPluginPanicLogs(t *testing.T) {
_, err := th.App.CreatePost(post, th.BasicChannel, false)
assert.Nil(t, err)
logs := th.LogBuffer.String()
assert.True(t, strings.Contains(logs, "some text from panic"))
testlib.AssertLog(t, th.LogBuffer, mlog.LevelDebug, "panic: some text from panic")
})
}