[MM-13833] Configured unit tests to log through t.Log (#10272)
* Rerouted the unit test logs through t.Log * resolving merge confilvts * Update testing.go * Update helper_test.go * Added godocs for NewTestingLogger * Added go docs for NewTestingLogger * Resolving conflicts
Этот коммит содержится в:
коммит произвёл
Jesse Hallam
родитель
a6d0b73c0d
Коммит
39ceaa3e86
@@ -19,7 +19,7 @@ import (
|
||||
)
|
||||
|
||||
func TestCreatePostDeduplicate(t *testing.T) {
|
||||
th := Setup().InitBasic()
|
||||
th := Setup(t).InitBasic()
|
||||
defer th.TearDown()
|
||||
|
||||
t.Run("duplicate create post is idempotent", func(t *testing.T) {
|
||||
@@ -188,7 +188,7 @@ func TestCreatePostDeduplicate(t *testing.T) {
|
||||
|
||||
func TestAttachFilesToPost(t *testing.T) {
|
||||
t.Run("should attach files", func(t *testing.T) {
|
||||
th := Setup().InitBasic()
|
||||
th := Setup(t).InitBasic()
|
||||
defer th.TearDown()
|
||||
|
||||
info1 := store.Must(th.App.Srv.Store.FileInfo().Save(&model.FileInfo{
|
||||
@@ -212,7 +212,7 @@ func TestAttachFilesToPost(t *testing.T) {
|
||||
})
|
||||
|
||||
t.Run("should update File.PostIds after failing to add files", func(t *testing.T) {
|
||||
th := Setup().InitBasic()
|
||||
th := Setup(t).InitBasic()
|
||||
defer th.TearDown()
|
||||
|
||||
info1 := store.Must(th.App.Srv.Store.FileInfo().Save(&model.FileInfo{
|
||||
@@ -244,7 +244,7 @@ func TestAttachFilesToPost(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestUpdatePostEditAt(t *testing.T) {
|
||||
th := Setup().InitBasic()
|
||||
th := Setup(t).InitBasic()
|
||||
defer th.TearDown()
|
||||
|
||||
post := &model.Post{}
|
||||
@@ -272,7 +272,7 @@ func TestUpdatePostEditAt(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestUpdatePostTimeLimit(t *testing.T) {
|
||||
th := Setup().InitBasic()
|
||||
th := Setup(t).InitBasic()
|
||||
defer th.TearDown()
|
||||
|
||||
post := &model.Post{}
|
||||
@@ -311,7 +311,7 @@ func TestUpdatePostTimeLimit(t *testing.T) {
|
||||
func TestPostReplyToPostWhereRootPosterLeftChannel(t *testing.T) {
|
||||
// This test ensures that when replying to a root post made by a user who has since left the channel, the reply
|
||||
// post completes successfully. This is a regression test for PLT-6523.
|
||||
th := Setup().InitBasic()
|
||||
th := Setup(t).InitBasic()
|
||||
defer th.TearDown()
|
||||
|
||||
channel := th.BasicChannel
|
||||
@@ -343,7 +343,7 @@ func TestPostReplyToPostWhereRootPosterLeftChannel(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestPostChannelMentions(t *testing.T) {
|
||||
th := Setup().InitBasic()
|
||||
th := Setup(t).InitBasic()
|
||||
defer th.TearDown()
|
||||
|
||||
channel := th.BasicChannel
|
||||
@@ -390,7 +390,7 @@ func TestPostChannelMentions(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestImageProxy(t *testing.T) {
|
||||
th := Setup().InitBasic()
|
||||
th := Setup(t).InitBasic()
|
||||
defer th.TearDown()
|
||||
|
||||
th.App.UpdateConfig(func(cfg *model.Config) {
|
||||
@@ -542,7 +542,7 @@ func TestMaxPostSize(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestDeletePostWithFileAttachments(t *testing.T) {
|
||||
th := Setup().InitBasic()
|
||||
th := Setup(t).InitBasic()
|
||||
defer th.TearDown()
|
||||
|
||||
// Create a post with a file attachment.
|
||||
@@ -588,7 +588,7 @@ func TestDeletePostWithFileAttachments(t *testing.T) {
|
||||
|
||||
func TestCreatePost(t *testing.T) {
|
||||
t.Run("call PreparePostForClient before returning", func(t *testing.T) {
|
||||
th := Setup().InitBasic()
|
||||
th := Setup(t).InitBasic()
|
||||
defer th.TearDown()
|
||||
|
||||
th.App.UpdateConfig(func(cfg *model.Config) {
|
||||
@@ -616,7 +616,7 @@ func TestCreatePost(t *testing.T) {
|
||||
|
||||
func TestPatchPost(t *testing.T) {
|
||||
t.Run("call PreparePostForClient before returning", func(t *testing.T) {
|
||||
th := Setup().InitBasic()
|
||||
th := Setup(t).InitBasic()
|
||||
defer th.TearDown()
|
||||
|
||||
th.App.UpdateConfig(func(cfg *model.Config) {
|
||||
@@ -652,7 +652,7 @@ func TestPatchPost(t *testing.T) {
|
||||
|
||||
func TestUpdatePost(t *testing.T) {
|
||||
t.Run("call PreparePostForClient before returning", func(t *testing.T) {
|
||||
th := Setup().InitBasic()
|
||||
th := Setup(t).InitBasic()
|
||||
defer th.TearDown()
|
||||
|
||||
th.App.UpdateConfig(func(cfg *model.Config) {
|
||||
|
||||
Ссылка в новой задаче
Block a user