[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 удалений

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

@@ -27,6 +27,7 @@ import (
)
func TestImportImportScheme(t *testing.T) {
mainHelper.Parallel(t)
th := Setup(t)
defer th.TearDown()
@@ -223,6 +224,7 @@ func TestImportImportScheme(t *testing.T) {
}
func TestImportImportSchemeWithoutGuestRoles(t *testing.T) {
mainHelper.Parallel(t)
th := Setup(t)
defer th.TearDown()
@@ -411,6 +413,7 @@ func TestImportImportSchemeWithoutGuestRoles(t *testing.T) {
}
func TestImportImportRole(t *testing.T) {
mainHelper.Parallel(t)
th := Setup(t)
defer th.TearDown()
@@ -502,6 +505,7 @@ func TestImportImportRole(t *testing.T) {
}
func TestImportImportTeam(t *testing.T) {
mainHelper.Parallel(t)
th := Setup(t)
defer th.TearDown()
@@ -599,6 +603,7 @@ func TestImportImportTeam(t *testing.T) {
}
func TestImportImportChannel(t *testing.T) {
mainHelper.Parallel(t)
th := Setup(t)
defer th.TearDown()
@@ -745,6 +750,7 @@ func TestImportImportChannel(t *testing.T) {
}
func TestImportImportUser(t *testing.T) {
mainHelper.Parallel(t)
th := Setup(t)
defer th.TearDown()
@@ -1741,6 +1747,7 @@ func TestImportImportUser(t *testing.T) {
}
func TestImportUserTeams(t *testing.T) {
mainHelper.Parallel(t)
th := Setup(t).InitBasic()
defer th.TearDown()
team2 := th.CreateTeam()
@@ -1963,6 +1970,7 @@ func TestImportUserTeams(t *testing.T) {
}
func TestImportUserChannels(t *testing.T) {
mainHelper.Parallel(t)
th := Setup(t).InitBasic()
defer th.TearDown()
channel2 := th.CreateChannel(th.Context, th.BasicTeam)
@@ -2097,6 +2105,7 @@ func TestImportUserChannels(t *testing.T) {
}
func TestImportUserDefaultNotifyProps(t *testing.T) {
mainHelper.Parallel(t)
th := Setup(t)
defer th.TearDown()
@@ -2136,6 +2145,7 @@ func TestImportUserDefaultNotifyProps(t *testing.T) {
}
func TestImportimportMultiplePostLines(t *testing.T) {
mainHelper.Parallel(t)
th := Setup(t)
defer th.TearDown()
@@ -3195,6 +3205,7 @@ func TestImportimportMultiplePostLines(t *testing.T) {
}
func TestImportImportPost(t *testing.T) {
mainHelper.Parallel(t)
th := Setup(t)
defer th.TearDown()
@@ -3802,6 +3813,7 @@ func TestImportImportPost(t *testing.T) {
}
func TestImportImportDirectChannel(t *testing.T) {
mainHelper.Parallel(t)
th := Setup(t).InitBasic()
defer th.TearDown()
user3 := th.CreateUser()
@@ -4173,6 +4185,7 @@ func TestImportImportDirectChannel(t *testing.T) {
}
func TestImportImportDirectPost(t *testing.T) {
mainHelper.Parallel(t)
th := Setup(t).InitBasic()
defer th.TearDown()
@@ -5120,6 +5133,7 @@ func TestImportImportDirectPost(t *testing.T) {
}
func TestImportImportEmoji(t *testing.T) {
mainHelper.Parallel(t)
th := Setup(t)
defer th.TearDown()
@@ -5171,6 +5185,7 @@ func TestImportImportEmoji(t *testing.T) {
}
func TestImportAttachment(t *testing.T) {
mainHelper.Parallel(t)
th := Setup(t)
defer th.TearDown()
@@ -5193,6 +5208,7 @@ func TestImportAttachment(t *testing.T) {
}
func TestImportPostAndRepliesWithAttachments(t *testing.T) {
mainHelper.Parallel(t)
th := Setup(t)
defer th.TearDown()
@@ -5434,6 +5450,7 @@ func TestImportPostAndRepliesWithAttachments(t *testing.T) {
}
func TestImportDirectPostWithAttachments(t *testing.T) {
mainHelper.Parallel(t)
th := Setup(t)
defer th.TearDown()
@@ -5561,6 +5578,7 @@ func TestImportDirectPostWithAttachments(t *testing.T) {
}
func TestZippedImportPostAndRepliesWithAttachments(t *testing.T) {
mainHelper.Parallel(t)
th := Setup(t)
defer th.TearDown()
@@ -5762,6 +5780,7 @@ func TestZippedImportPostAndRepliesWithAttachments(t *testing.T) {
}
func TestCompareFilesContent(t *testing.T) {
mainHelper.Parallel(t)
t.Run("empty", func(t *testing.T) {
ok, err := compareFilesContent(strings.NewReader(""), strings.NewReader(""), 0)
require.NoError(t, err)