[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
Этот коммит содержится в:
Claudio Costa
2025-05-30 05:58:26 -06:00
коммит произвёл GitHub
родитель 1cf2f08108
Коммит 611b2a8e79
191 изменённых файлов: 2719 добавлений и 496 удалений

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

@@ -23,6 +23,7 @@ import (
)
func TestCreateIncomingWebhookForChannel(t *testing.T) {
mainHelper.Parallel(t)
th := Setup(t).InitBasic()
defer th.TearDown()
@@ -155,6 +156,7 @@ func TestCreateIncomingWebhookForChannel(t *testing.T) {
}
func TestUpdateIncomingWebhook(t *testing.T) {
mainHelper.Parallel(t)
th := Setup(t).InitBasic()
defer th.TearDown()
@@ -293,6 +295,7 @@ func TestUpdateIncomingWebhook(t *testing.T) {
}
func TestCreateWebhookPost(t *testing.T) {
mainHelper.Parallel(t)
testCluster := &testlib.FakeClusterInterface{}
th := SetupWithClusterMock(t, testCluster).InitBasic()
defer th.TearDown()
@@ -502,6 +505,7 @@ func TestCreateWebhookPostWithOverriddenIcon(t *testing.T) {
}
func TestCreateWebhookPostWithPriority(t *testing.T) {
mainHelper.Parallel(t)
testCluster := &testlib.FakeClusterInterface{}
th := SetupWithClusterMock(t, testCluster).InitBasic()
defer th.TearDown()
@@ -552,6 +556,7 @@ func TestCreateWebhookPostWithPriority(t *testing.T) {
}
func TestCreateWebhookPostLinks(t *testing.T) {
mainHelper.Parallel(t)
th := Setup(t).InitBasic()
defer th.TearDown()
@@ -586,6 +591,7 @@ func TestCreateWebhookPostLinks(t *testing.T) {
}
func TestSplitWebhookPost(t *testing.T) {
mainHelper.Parallel(t)
type TestCase struct {
Post *model.Post
Expected []*model.Post
@@ -699,6 +705,7 @@ func makePost(message int, attachments []int) *model.Post {
}
func TestSplitWebhookPostAttachments(t *testing.T) {
mainHelper.Parallel(t)
maxPostSize := 10000
testCases := []struct {
name string
@@ -759,6 +766,7 @@ func TestSplitWebhookPostAttachments(t *testing.T) {
}
func TestCreateOutGoingWebhookWithUsernameAndIconURL(t *testing.T) {
mainHelper.Parallel(t)
th := Setup(t).InitBasic()
defer th.TearDown()
@@ -790,6 +798,7 @@ func TestCreateOutGoingWebhookWithUsernameAndIconURL(t *testing.T) {
}
func TestTriggerOutGoingWebhookWithUsernameAndIconURL(t *testing.T) {
mainHelper.Parallel(t)
getPayload := func(hook *model.OutgoingWebhook, th *TestHelper, channel *model.Channel) *model.OutgoingWebhookPayload {
return &model.OutgoingWebhookPayload{
Token: hook.Token,
@@ -931,6 +940,7 @@ func TestTriggerOutGoingWebhookWithUsernameAndIconURL(t *testing.T) {
}
func TestTriggerOutGoingWebhookWithMultipleURLs(t *testing.T) {
mainHelper.Parallel(t)
getPayload := func(hook *model.OutgoingWebhook, th *TestHelper, channel *model.Channel) *model.OutgoingWebhookPayload {
return &model.OutgoingWebhookPayload{
Token: hook.Token,
@@ -1038,6 +1048,7 @@ func (r InfiniteReader) Read(p []byte) (n int, err error) {
}
func TestDoOutgoingWebhookRequest(t *testing.T) {
mainHelper.Parallel(t)
th := Setup(t)
defer th.TearDown()