[MM-62408] Server Code Coverage with Fully Parallel Tests (#30078)
* TestPool * Store infra * Store tests updates * Bump maximum concurrent postgres connections * More infra * channels/jobs * channels/app * channels/api4 * Protect i18n from concurrent access * Replace some use of os.Setenv * Remove debug * Lint fixes * Fix more linting * Fix test * Remove use of Setenv in drafts tests * Fix flaky TestWebHubCloseConnOnDBFail * Fix merge * [MM-62408] Add CI job to generate test coverage (#30284) * Add CI job to generate test coverage * Remove use of Setenv in drafts tests * Fix flaky TestWebHubCloseConnOnDBFail * Fix more Setenv usage * Fix more potential flakyness * Remove parallelism from flaky test * Remove conflicting env var * Fix * Disable parallelism * Test atomic covermode * Disable parallelism * Enable parallelism * Add upload coverage step * Fix codecov.yml * Add codecov.yml * Remove redundant workspace field * Add Parallel() util methods and refactor * Fix formatting * More formatting fixes * Fix reporting
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
1cf2f08108
Коммит
611b2a8e79
@@ -195,6 +195,12 @@ func TestCreatePostDeduplicate(t *testing.T) {
|
||||
})
|
||||
|
||||
t.Run("duplicate create post after cache expires is not idempotent", func(t *testing.T) {
|
||||
originalCacheTTL := pendingPostIDsCacheTTL
|
||||
pendingPostIDsCacheTTL = time.Second
|
||||
t.Cleanup(func() {
|
||||
pendingPostIDsCacheTTL = originalCacheTTL
|
||||
})
|
||||
|
||||
session := &model.Session{
|
||||
UserId: th.BasicUser.Id,
|
||||
}
|
||||
@@ -212,7 +218,7 @@ func TestCreatePostDeduplicate(t *testing.T) {
|
||||
require.Nil(t, err)
|
||||
require.Equal(t, "message", post.Message)
|
||||
|
||||
time.Sleep(PendingPostIDsCacheTTL)
|
||||
time.Sleep(pendingPostIDsCacheTTL)
|
||||
|
||||
duplicatePost, err := th.App.CreatePostAsUser(th.Context.WithSession(session), &model.Post{
|
||||
UserId: th.BasicUser.Id,
|
||||
@@ -276,6 +282,7 @@ func TestCreatePostDeduplicate(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestAttachFilesToPost(t *testing.T) {
|
||||
mainHelper.Parallel(t)
|
||||
t.Run("should attach files", func(t *testing.T) {
|
||||
th := Setup(t).InitBasic()
|
||||
defer th.TearDown()
|
||||
@@ -343,6 +350,7 @@ func TestAttachFilesToPost(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestUpdatePostEditAt(t *testing.T) {
|
||||
mainHelper.Parallel(t)
|
||||
th := Setup(t).InitBasic()
|
||||
defer th.TearDown()
|
||||
|
||||
@@ -365,6 +373,7 @@ func TestUpdatePostEditAt(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestUpdatePostTimeLimit(t *testing.T) {
|
||||
mainHelper.Parallel(t)
|
||||
th := Setup(t).InitBasic()
|
||||
defer th.TearDown()
|
||||
|
||||
@@ -399,6 +408,7 @@ func TestUpdatePostTimeLimit(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestUpdatePostInArchivedChannel(t *testing.T) {
|
||||
mainHelper.Parallel(t)
|
||||
th := Setup(t).InitBasic()
|
||||
defer th.TearDown()
|
||||
|
||||
@@ -413,6 +423,7 @@ func TestUpdatePostInArchivedChannel(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestPostReplyToPostWhereRootPosterLeftChannel(t *testing.T) {
|
||||
mainHelper.Parallel(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(t).InitBasic()
|
||||
@@ -442,6 +453,7 @@ func TestPostReplyToPostWhereRootPosterLeftChannel(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestPostAttachPostToChildPost(t *testing.T) {
|
||||
mainHelper.Parallel(t)
|
||||
th := Setup(t).InitBasic()
|
||||
defer th.TearDown()
|
||||
|
||||
@@ -487,6 +499,7 @@ func TestPostAttachPostToChildPost(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestUpdatePostPluginHooks(t *testing.T) {
|
||||
mainHelper.Parallel(t)
|
||||
th := Setup(t).InitBasic()
|
||||
defer th.TearDown()
|
||||
|
||||
@@ -628,6 +641,7 @@ func TestUpdatePostPluginHooks(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestPostChannelMentions(t *testing.T) {
|
||||
mainHelper.Parallel(t)
|
||||
th := Setup(t).InitBasic()
|
||||
defer th.TearDown()
|
||||
|
||||
@@ -694,6 +708,7 @@ func TestPostChannelMentions(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestImageProxy(t *testing.T) {
|
||||
mainHelper.Parallel(t)
|
||||
th := SetupWithStoreMock(t)
|
||||
defer th.TearDown()
|
||||
|
||||
@@ -817,6 +832,7 @@ func TestImageProxy(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestDeletePostWithFileAttachments(t *testing.T) {
|
||||
mainHelper.Parallel(t)
|
||||
th := Setup(t).InitBasic()
|
||||
defer th.TearDown()
|
||||
|
||||
@@ -861,6 +877,7 @@ func TestDeletePostWithFileAttachments(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestDeletePostInArchivedChannel(t *testing.T) {
|
||||
mainHelper.Parallel(t)
|
||||
th := Setup(t).InitBasic()
|
||||
defer th.TearDown()
|
||||
|
||||
@@ -875,7 +892,9 @@ func TestDeletePostInArchivedChannel(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestCreatePost(t *testing.T) {
|
||||
mainHelper.Parallel(t)
|
||||
t.Run("call PreparePostForClient before returning", func(t *testing.T) {
|
||||
mainHelper.Parallel(t)
|
||||
th := Setup(t).InitBasic()
|
||||
defer th.TearDown()
|
||||
|
||||
@@ -904,6 +923,7 @@ func TestCreatePost(t *testing.T) {
|
||||
})
|
||||
|
||||
t.Run("Sets prop MENTION_HIGHLIGHT_DISABLED when it should", func(t *testing.T) {
|
||||
mainHelper.Parallel(t)
|
||||
th := Setup(t).InitBasic()
|
||||
defer th.TearDown()
|
||||
th.AddUserToChannel(th.BasicUser, th.BasicChannel)
|
||||
@@ -956,6 +976,7 @@ func TestCreatePost(t *testing.T) {
|
||||
})
|
||||
|
||||
t.Run("Sets PostPropsPreviewedPost when a permalink is the first link", func(t *testing.T) {
|
||||
mainHelper.Parallel(t)
|
||||
th := Setup(t).InitBasic()
|
||||
defer th.TearDown()
|
||||
th.AddUserToChannel(th.BasicUser, th.BasicChannel)
|
||||
@@ -991,6 +1012,7 @@ func TestCreatePost(t *testing.T) {
|
||||
})
|
||||
|
||||
t.Run("creates a single record for a permalink preview post", func(t *testing.T) {
|
||||
mainHelper.Parallel(t)
|
||||
th := Setup(t).InitBasic()
|
||||
defer th.TearDown()
|
||||
|
||||
@@ -1030,6 +1052,7 @@ func TestCreatePost(t *testing.T) {
|
||||
})
|
||||
|
||||
t.Run("sanitizes post metadata appropriately", func(t *testing.T) {
|
||||
mainHelper.Parallel(t)
|
||||
th := Setup(t).InitBasic()
|
||||
defer th.TearDown()
|
||||
|
||||
@@ -1092,6 +1115,7 @@ func TestCreatePost(t *testing.T) {
|
||||
})
|
||||
|
||||
t.Run("Should not allow to create posts on shared DMs", func(t *testing.T) {
|
||||
mainHelper.Parallel(t)
|
||||
th := setupSharedChannels(t).InitBasic()
|
||||
defer th.TearDown()
|
||||
|
||||
@@ -1131,6 +1155,7 @@ func TestCreatePost(t *testing.T) {
|
||||
})
|
||||
|
||||
t.Run("Should not allow to create posts on shared GMs", func(t *testing.T) {
|
||||
mainHelper.Parallel(t)
|
||||
th := setupSharedChannels(t).InitBasic()
|
||||
defer th.TearDown()
|
||||
|
||||
@@ -1171,6 +1196,7 @@ func TestCreatePost(t *testing.T) {
|
||||
})
|
||||
|
||||
t.Run("MM-40016 should not panic with `concurrent map read and map write`", func(t *testing.T) {
|
||||
mainHelper.Parallel(t)
|
||||
th := Setup(t).InitBasic()
|
||||
defer th.TearDown()
|
||||
|
||||
@@ -1222,6 +1248,7 @@ func TestCreatePost(t *testing.T) {
|
||||
})
|
||||
|
||||
t.Run("should sanitize the force notifications prop if the flag is not set", func(t *testing.T) {
|
||||
mainHelper.Parallel(t)
|
||||
th := Setup(t).InitBasic()
|
||||
defer th.TearDown()
|
||||
th.AddUserToChannel(th.BasicUser, th.BasicChannel)
|
||||
@@ -1238,6 +1265,7 @@ func TestCreatePost(t *testing.T) {
|
||||
})
|
||||
|
||||
t.Run("should add the force notifications prop if the flag is set", func(t *testing.T) {
|
||||
mainHelper.Parallel(t)
|
||||
th := Setup(t).InitBasic()
|
||||
defer th.TearDown()
|
||||
th.AddUserToChannel(th.BasicUser, th.BasicChannel)
|
||||
@@ -1254,7 +1282,9 @@ func TestCreatePost(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestPatchPost(t *testing.T) {
|
||||
mainHelper.Parallel(t)
|
||||
t.Run("call PreparePostForClient before returning", func(t *testing.T) {
|
||||
mainHelper.Parallel(t)
|
||||
th := Setup(t).InitBasic()
|
||||
defer th.TearDown()
|
||||
|
||||
@@ -1291,6 +1321,7 @@ func TestPatchPost(t *testing.T) {
|
||||
})
|
||||
|
||||
t.Run("Sets Prop MENTION_HIGHLIGHT_DISABLED when it should", func(t *testing.T) {
|
||||
mainHelper.Parallel(t)
|
||||
th := Setup(t).InitBasic()
|
||||
defer th.TearDown()
|
||||
|
||||
@@ -1341,7 +1372,9 @@ func TestPatchPost(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestCreatePostAsUser(t *testing.T) {
|
||||
mainHelper.Parallel(t)
|
||||
t.Run("marks channel as viewed for regular user", func(t *testing.T) {
|
||||
mainHelper.Parallel(t)
|
||||
th := Setup(t).InitBasic()
|
||||
defer th.TearDown()
|
||||
|
||||
@@ -1365,6 +1398,7 @@ func TestCreatePostAsUser(t *testing.T) {
|
||||
})
|
||||
|
||||
t.Run("does not mark channel as viewed for webhook from user", func(t *testing.T) {
|
||||
mainHelper.Parallel(t)
|
||||
th := Setup(t).InitBasic()
|
||||
defer th.TearDown()
|
||||
|
||||
@@ -1389,6 +1423,7 @@ func TestCreatePostAsUser(t *testing.T) {
|
||||
})
|
||||
|
||||
t.Run("does not mark channel as viewed for bot user in channel", func(t *testing.T) {
|
||||
mainHelper.Parallel(t)
|
||||
th := Setup(t).InitBasic()
|
||||
defer th.TearDown()
|
||||
|
||||
@@ -1420,6 +1455,7 @@ func TestCreatePostAsUser(t *testing.T) {
|
||||
})
|
||||
|
||||
t.Run("does not log warning for bot user not in channel", func(t *testing.T) {
|
||||
mainHelper.Parallel(t)
|
||||
th := Setup(t).InitBasic()
|
||||
defer th.TearDown()
|
||||
|
||||
@@ -1445,6 +1481,7 @@ func TestCreatePostAsUser(t *testing.T) {
|
||||
})
|
||||
|
||||
t.Run("marks channel as viewed for reply post when CRT is off", func(t *testing.T) {
|
||||
mainHelper.Parallel(t)
|
||||
th := Setup(t).InitBasic()
|
||||
defer th.TearDown()
|
||||
|
||||
@@ -1480,6 +1517,7 @@ func TestCreatePostAsUser(t *testing.T) {
|
||||
})
|
||||
|
||||
t.Run("does not mark channel as viewed for reply post when CRT is on", func(t *testing.T) {
|
||||
mainHelper.Parallel(t)
|
||||
th := Setup(t).InitBasic()
|
||||
defer th.TearDown()
|
||||
|
||||
@@ -1517,6 +1555,7 @@ func TestCreatePostAsUser(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestPatchPostInArchivedChannel(t *testing.T) {
|
||||
mainHelper.Parallel(t)
|
||||
th := Setup(t).InitBasic()
|
||||
defer th.TearDown()
|
||||
|
||||
@@ -1531,7 +1570,9 @@ func TestPatchPostInArchivedChannel(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestUpdateEphemeralPost(t *testing.T) {
|
||||
mainHelper.Parallel(t)
|
||||
t.Run("Post contains preview if the user has permissions", func(t *testing.T) {
|
||||
mainHelper.Parallel(t)
|
||||
th := Setup(t).InitBasic()
|
||||
defer th.TearDown()
|
||||
th.AddUserToChannel(th.BasicUser, th.BasicChannel)
|
||||
@@ -1566,6 +1607,7 @@ func TestUpdateEphemeralPost(t *testing.T) {
|
||||
})
|
||||
|
||||
t.Run("Post does not contain preview if the user has no permissions", func(t *testing.T) {
|
||||
mainHelper.Parallel(t)
|
||||
th := Setup(t).InitBasic()
|
||||
defer th.TearDown()
|
||||
privateChannel := th.CreatePrivateChannel(th.Context, th.BasicTeam)
|
||||
@@ -1601,7 +1643,9 @@ func TestUpdateEphemeralPost(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestUpdatePost(t *testing.T) {
|
||||
mainHelper.Parallel(t)
|
||||
t.Run("call PreparePostForClient before returning", func(t *testing.T) {
|
||||
mainHelper.Parallel(t)
|
||||
th := Setup(t).InitBasic()
|
||||
defer th.TearDown()
|
||||
|
||||
@@ -1637,6 +1681,7 @@ func TestUpdatePost(t *testing.T) {
|
||||
})
|
||||
|
||||
t.Run("Sets PostPropsPreviewedPost when a post is updated to have a permalink as the first link", func(t *testing.T) {
|
||||
mainHelper.Parallel(t)
|
||||
th := Setup(t).InitBasic()
|
||||
defer th.TearDown()
|
||||
th.AddUserToChannel(th.BasicUser, th.BasicChannel)
|
||||
@@ -1676,6 +1721,7 @@ func TestUpdatePost(t *testing.T) {
|
||||
})
|
||||
|
||||
t.Run("sanitizes post metadata appropriately", func(t *testing.T) {
|
||||
mainHelper.Parallel(t)
|
||||
th := Setup(t).InitBasic()
|
||||
defer th.TearDown()
|
||||
|
||||
@@ -1741,6 +1787,7 @@ func TestUpdatePost(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSearchPostsForUser(t *testing.T) {
|
||||
mainHelper.Parallel(t)
|
||||
perPage := 5
|
||||
searchTerm := "searchTerm"
|
||||
|
||||
@@ -1777,6 +1824,7 @@ func TestSearchPostsForUser(t *testing.T) {
|
||||
}
|
||||
|
||||
t.Run("should return everything as first page of posts from database", func(t *testing.T) {
|
||||
mainHelper.Parallel(t)
|
||||
th, posts := setup(t, false)
|
||||
defer th.TearDown()
|
||||
|
||||
@@ -1797,6 +1845,7 @@ func TestSearchPostsForUser(t *testing.T) {
|
||||
})
|
||||
|
||||
t.Run("should not return later pages of posts from database", func(t *testing.T) {
|
||||
mainHelper.Parallel(t)
|
||||
th, _ := setup(t, false)
|
||||
defer th.TearDown()
|
||||
|
||||
@@ -1809,6 +1858,7 @@ func TestSearchPostsForUser(t *testing.T) {
|
||||
})
|
||||
|
||||
t.Run("should return first page of posts from ElasticSearch", func(t *testing.T) {
|
||||
mainHelper.Parallel(t)
|
||||
th, posts := setup(t, true)
|
||||
defer th.TearDown()
|
||||
|
||||
@@ -1839,6 +1889,7 @@ func TestSearchPostsForUser(t *testing.T) {
|
||||
})
|
||||
|
||||
t.Run("should return later pages of posts from ElasticSearch", func(t *testing.T) {
|
||||
mainHelper.Parallel(t)
|
||||
th, posts := setup(t, true)
|
||||
defer th.TearDown()
|
||||
|
||||
@@ -1866,6 +1917,7 @@ func TestSearchPostsForUser(t *testing.T) {
|
||||
})
|
||||
|
||||
t.Run("should fall back to database if ElasticSearch fails on first page", func(t *testing.T) {
|
||||
mainHelper.Parallel(t)
|
||||
th, posts := setup(t, true)
|
||||
defer th.TearDown()
|
||||
|
||||
@@ -1898,6 +1950,7 @@ func TestSearchPostsForUser(t *testing.T) {
|
||||
})
|
||||
|
||||
t.Run("should return nothing if ElasticSearch fails on later pages", func(t *testing.T) {
|
||||
mainHelper.Parallel(t)
|
||||
th, _ := setup(t, true)
|
||||
defer th.TearDown()
|
||||
|
||||
@@ -1922,6 +1975,7 @@ func TestSearchPostsForUser(t *testing.T) {
|
||||
})
|
||||
|
||||
t.Run("should return the same results if there is a tilde in the channel name", func(t *testing.T) {
|
||||
mainHelper.Parallel(t)
|
||||
th, _ := setup(t, false)
|
||||
defer th.TearDown()
|
||||
|
||||
@@ -1943,6 +1997,7 @@ func TestSearchPostsForUser(t *testing.T) {
|
||||
})
|
||||
|
||||
t.Run("should return the same results if there is an 'at' in the user", func(t *testing.T) {
|
||||
mainHelper.Parallel(t)
|
||||
th, _ := setup(t, false)
|
||||
defer th.TearDown()
|
||||
|
||||
@@ -1965,7 +2020,9 @@ func TestSearchPostsForUser(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestCountMentionsFromPost(t *testing.T) {
|
||||
mainHelper.Parallel(t)
|
||||
t.Run("should not count posts without mentions", func(t *testing.T) {
|
||||
mainHelper.Parallel(t)
|
||||
th := Setup(t).InitBasic()
|
||||
defer th.TearDown()
|
||||
|
||||
@@ -2001,6 +2058,7 @@ func TestCountMentionsFromPost(t *testing.T) {
|
||||
})
|
||||
|
||||
t.Run("should count keyword mentions", func(t *testing.T) {
|
||||
mainHelper.Parallel(t)
|
||||
th := Setup(t).InitBasic()
|
||||
defer th.TearDown()
|
||||
|
||||
@@ -2040,6 +2098,7 @@ func TestCountMentionsFromPost(t *testing.T) {
|
||||
})
|
||||
|
||||
t.Run("should count channel-wide mentions when enabled", func(t *testing.T) {
|
||||
mainHelper.Parallel(t)
|
||||
th := Setup(t).InitBasic()
|
||||
defer th.TearDown()
|
||||
|
||||
@@ -2079,6 +2138,7 @@ func TestCountMentionsFromPost(t *testing.T) {
|
||||
})
|
||||
|
||||
t.Run("should not count channel-wide mentions when disabled for user", func(t *testing.T) {
|
||||
mainHelper.Parallel(t)
|
||||
th := Setup(t).InitBasic()
|
||||
defer th.TearDown()
|
||||
|
||||
@@ -2116,6 +2176,7 @@ func TestCountMentionsFromPost(t *testing.T) {
|
||||
})
|
||||
|
||||
t.Run("should not count channel-wide mentions when disabled for channel", func(t *testing.T) {
|
||||
mainHelper.Parallel(t)
|
||||
th := Setup(t).InitBasic()
|
||||
defer th.TearDown()
|
||||
|
||||
@@ -2158,6 +2219,7 @@ func TestCountMentionsFromPost(t *testing.T) {
|
||||
})
|
||||
|
||||
t.Run("should count comment mentions when using COMMENTS_NOTIFY_ROOT", func(t *testing.T) {
|
||||
mainHelper.Parallel(t)
|
||||
th := Setup(t).InitBasic()
|
||||
defer th.TearDown()
|
||||
|
||||
@@ -2212,6 +2274,7 @@ func TestCountMentionsFromPost(t *testing.T) {
|
||||
})
|
||||
|
||||
t.Run("should count comment mentions when using COMMENTS_NOTIFY_ANY", func(t *testing.T) {
|
||||
mainHelper.Parallel(t)
|
||||
th := Setup(t).InitBasic()
|
||||
defer th.TearDown()
|
||||
|
||||
@@ -2266,6 +2329,7 @@ func TestCountMentionsFromPost(t *testing.T) {
|
||||
})
|
||||
|
||||
t.Run("should count mentions caused by being added to the channel", func(t *testing.T) {
|
||||
mainHelper.Parallel(t)
|
||||
th := Setup(t).InitBasic()
|
||||
defer th.TearDown()
|
||||
|
||||
@@ -2315,6 +2379,7 @@ func TestCountMentionsFromPost(t *testing.T) {
|
||||
})
|
||||
|
||||
t.Run("should return the number of posts made by the other user for a direct channel", func(t *testing.T) {
|
||||
mainHelper.Parallel(t)
|
||||
th := Setup(t).InitBasic()
|
||||
defer th.TearDown()
|
||||
|
||||
@@ -2350,6 +2415,7 @@ func TestCountMentionsFromPost(t *testing.T) {
|
||||
})
|
||||
|
||||
t.Run("should return the number of posts made by the other user for a group message", func(t *testing.T) {
|
||||
mainHelper.Parallel(t)
|
||||
th := Setup(t).InitBasic()
|
||||
defer th.TearDown()
|
||||
|
||||
@@ -2393,6 +2459,7 @@ func TestCountMentionsFromPost(t *testing.T) {
|
||||
})
|
||||
|
||||
t.Run("should not count mentions from the before the given post", func(t *testing.T) {
|
||||
mainHelper.Parallel(t)
|
||||
th := Setup(t).InitBasic()
|
||||
defer th.TearDown()
|
||||
|
||||
@@ -2430,6 +2497,7 @@ func TestCountMentionsFromPost(t *testing.T) {
|
||||
})
|
||||
|
||||
t.Run("should not count mentions from the user's own posts", func(t *testing.T) {
|
||||
mainHelper.Parallel(t)
|
||||
th := Setup(t).InitBasic()
|
||||
defer th.TearDown()
|
||||
|
||||
@@ -2461,6 +2529,7 @@ func TestCountMentionsFromPost(t *testing.T) {
|
||||
})
|
||||
|
||||
t.Run("should include comments made before the given post when counting comment mentions", func(t *testing.T) {
|
||||
mainHelper.Parallel(t)
|
||||
th := Setup(t).InitBasic()
|
||||
defer th.TearDown()
|
||||
|
||||
@@ -2508,6 +2577,7 @@ func TestCountMentionsFromPost(t *testing.T) {
|
||||
})
|
||||
|
||||
t.Run("should not include comments made before the given post when rootPost is inaccessible", func(t *testing.T) {
|
||||
mainHelper.Parallel(t)
|
||||
th := Setup(t).InitBasic()
|
||||
defer th.TearDown()
|
||||
|
||||
@@ -2568,6 +2638,7 @@ func TestCountMentionsFromPost(t *testing.T) {
|
||||
})
|
||||
|
||||
t.Run("should count mentions from the user's webhook posts", func(t *testing.T) {
|
||||
mainHelper.Parallel(t)
|
||||
th := Setup(t).InitBasic()
|
||||
defer th.TearDown()
|
||||
|
||||
@@ -2608,6 +2679,7 @@ func TestCountMentionsFromPost(t *testing.T) {
|
||||
})
|
||||
|
||||
t.Run("should count multiple pages of mentions", func(t *testing.T) {
|
||||
mainHelper.Parallel(t)
|
||||
th := Setup(t).InitBasic()
|
||||
defer th.TearDown()
|
||||
|
||||
@@ -2644,6 +2716,7 @@ func TestCountMentionsFromPost(t *testing.T) {
|
||||
})
|
||||
|
||||
t.Run("should count urgent mentions", func(t *testing.T) {
|
||||
mainHelper.Parallel(t)
|
||||
th := Setup(t).InitBasic()
|
||||
defer th.TearDown()
|
||||
|
||||
@@ -2700,7 +2773,9 @@ func TestCountMentionsFromPost(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestFillInPostProps(t *testing.T) {
|
||||
mainHelper.Parallel(t)
|
||||
t.Run("should not add disable group highlight to post props for user with group mention permissions", func(t *testing.T) {
|
||||
mainHelper.Parallel(t)
|
||||
th := Setup(t).InitBasic()
|
||||
defer th.TearDown()
|
||||
th.App.Srv().SetLicense(model.NewTestLicense("ldap"))
|
||||
@@ -2723,6 +2798,7 @@ func TestFillInPostProps(t *testing.T) {
|
||||
})
|
||||
|
||||
t.Run("should not add disable group highlight to post props for app without license", func(t *testing.T) {
|
||||
mainHelper.Parallel(t)
|
||||
th := Setup(t).InitBasic()
|
||||
defer th.TearDown()
|
||||
|
||||
@@ -2755,6 +2831,7 @@ func TestFillInPostProps(t *testing.T) {
|
||||
})
|
||||
|
||||
t.Run("should add disable group highlight to post props for guest user", func(t *testing.T) {
|
||||
mainHelper.Parallel(t)
|
||||
th := Setup(t).InitBasic()
|
||||
defer th.TearDown()
|
||||
th.App.Srv().SetLicense(model.NewTestLicense("ldap"))
|
||||
@@ -2789,7 +2866,9 @@ func TestFillInPostProps(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestThreadMembership(t *testing.T) {
|
||||
mainHelper.Parallel(t)
|
||||
t.Run("should update memberships for conversation participants", func(t *testing.T) {
|
||||
mainHelper.Parallel(t)
|
||||
th := Setup(t).InitBasic()
|
||||
defer th.TearDown()
|
||||
th.App.UpdateConfig(func(cfg *model.Config) {
|
||||
@@ -2850,6 +2929,7 @@ func TestThreadMembership(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestFollowThreadSkipsParticipants(t *testing.T) {
|
||||
mainHelper.Parallel(t)
|
||||
th := Setup(t).InitBasic()
|
||||
defer th.TearDown()
|
||||
|
||||
@@ -2919,6 +2999,7 @@ func TestFollowThreadSkipsParticipants(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestAutofollowBasedOnRootPost(t *testing.T) {
|
||||
mainHelper.Parallel(t)
|
||||
th := Setup(t).InitBasic()
|
||||
defer th.TearDown()
|
||||
|
||||
@@ -2947,6 +3028,7 @@ func TestAutofollowBasedOnRootPost(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestViewChannelShouldNotUpdateThreads(t *testing.T) {
|
||||
mainHelper.Parallel(t)
|
||||
th := Setup(t).InitBasic()
|
||||
defer th.TearDown()
|
||||
|
||||
@@ -2981,6 +3063,7 @@ func TestViewChannelShouldNotUpdateThreads(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestCollapsedThreadFetch(t *testing.T) {
|
||||
mainHelper.Parallel(t)
|
||||
th := Setup(t).InitBasic()
|
||||
defer th.TearDown()
|
||||
|
||||
@@ -3197,6 +3280,7 @@ func TestReplyToPostWithLag(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSharedChannelSyncForPostActions(t *testing.T) {
|
||||
mainHelper.Parallel(t)
|
||||
t.Run("creating a post in a shared channel performs a content sync when sync service is running on that node", func(t *testing.T) {
|
||||
th := setupSharedChannels(t).InitBasic()
|
||||
defer th.TearDown()
|
||||
@@ -3281,6 +3365,7 @@ func TestSharedChannelSyncForPostActions(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestAutofollowOnPostingAfterUnfollow(t *testing.T) {
|
||||
mainHelper.Parallel(t)
|
||||
th := Setup(t).InitBasic()
|
||||
defer th.TearDown()
|
||||
|
||||
@@ -3322,6 +3407,7 @@ func TestAutofollowOnPostingAfterUnfollow(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestGetPostIfAuthorized(t *testing.T) {
|
||||
mainHelper.Parallel(t)
|
||||
th := Setup(t).InitBasic()
|
||||
defer th.TearDown()
|
||||
|
||||
@@ -3386,6 +3472,7 @@ func TestGetPostIfAuthorized(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestShouldNotRefollowOnOthersReply(t *testing.T) {
|
||||
mainHelper.Parallel(t)
|
||||
th := Setup(t).InitBasic()
|
||||
defer th.TearDown()
|
||||
|
||||
@@ -3435,6 +3522,7 @@ func TestShouldNotRefollowOnOthersReply(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestGetLastAccessiblePostTime(t *testing.T) {
|
||||
mainHelper.Parallel(t)
|
||||
th := SetupWithStoreMock(t)
|
||||
defer th.TearDown()
|
||||
|
||||
@@ -3468,6 +3556,7 @@ func TestGetLastAccessiblePostTime(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestComputeLastAccessiblePostTime(t *testing.T) {
|
||||
mainHelper.Parallel(t)
|
||||
t.Run("Updates the time, if cloud limit is applicable", func(t *testing.T) {
|
||||
th := SetupWithStoreMock(t)
|
||||
defer th.TearDown()
|
||||
@@ -3525,6 +3614,7 @@ func TestComputeLastAccessiblePostTime(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestGetEditHistoryForPost(t *testing.T) {
|
||||
mainHelper.Parallel(t)
|
||||
th := Setup(t).InitBasic()
|
||||
defer th.TearDown()
|
||||
|
||||
@@ -3666,6 +3756,7 @@ func TestGetEditHistoryForPost(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestCopyWranglerPostlist(t *testing.T) {
|
||||
mainHelper.Parallel(t)
|
||||
th := Setup(t).InitBasic()
|
||||
defer th.TearDown()
|
||||
|
||||
@@ -3718,6 +3809,7 @@ func TestCopyWranglerPostlist(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestValidateMoveOrCopy(t *testing.T) {
|
||||
mainHelper.Parallel(t)
|
||||
th := Setup(t).InitBasic()
|
||||
defer th.TearDown()
|
||||
|
||||
@@ -3842,6 +3934,7 @@ func TestValidateMoveOrCopy(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestPermanentDeletePost(t *testing.T) {
|
||||
mainHelper.Parallel(t)
|
||||
th := Setup(t).InitBasic()
|
||||
defer th.TearDown()
|
||||
|
||||
@@ -3933,6 +4026,7 @@ func TestPermanentDeletePost(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSendTestMessage(t *testing.T) {
|
||||
mainHelper.Parallel(t)
|
||||
th := Setup(t).InitBasic()
|
||||
defer th.TearDown()
|
||||
t.Run("Should create the post with the correct prop", func(t *testing.T) {
|
||||
@@ -3943,6 +4037,7 @@ func TestSendTestMessage(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestPopulateEditHistoryFileMetadata(t *testing.T) {
|
||||
mainHelper.Parallel(t)
|
||||
th := Setup(t).InitBasic()
|
||||
defer th.TearDown()
|
||||
|
||||
|
||||
Ссылка в новой задаче
Block a user