[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
@@ -27,6 +27,7 @@ import (
|
||||
)
|
||||
|
||||
func TestDoesNotifyPropsAllowPushNotification(t *testing.T) {
|
||||
mainHelper.Parallel(t)
|
||||
tt := []struct {
|
||||
name string
|
||||
userNotifySetting string
|
||||
@@ -431,6 +432,7 @@ func TestDoesNotifyPropsAllowPushNotification(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestDoesStatusAllowPushNotification(t *testing.T) {
|
||||
mainHelper.Parallel(t)
|
||||
th := Setup(t).InitBasic()
|
||||
defer th.TearDown()
|
||||
|
||||
@@ -646,6 +648,7 @@ func TestDoesStatusAllowPushNotification(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestGetPushNotificationMessage(t *testing.T) {
|
||||
mainHelper.Parallel(t)
|
||||
th := SetupWithStoreMock(t)
|
||||
defer th.TearDown()
|
||||
|
||||
@@ -1028,6 +1031,7 @@ func TestGetPushNotificationMessage(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestBuildPushNotificationMessageMentions(t *testing.T) {
|
||||
mainHelper.Parallel(t)
|
||||
th := Setup(t).InitBasic()
|
||||
defer th.TearDown()
|
||||
|
||||
@@ -1084,6 +1088,7 @@ func TestBuildPushNotificationMessageMentions(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSendPushNotifications(t *testing.T) {
|
||||
mainHelper.Parallel(t)
|
||||
th := Setup(t).InitBasic()
|
||||
defer th.TearDown()
|
||||
_, err := th.App.CreateSession(th.Context, &model.Session{
|
||||
@@ -1104,6 +1109,7 @@ func TestSendPushNotifications(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestShouldSendPushNotifications(t *testing.T) {
|
||||
mainHelper.Parallel(t)
|
||||
th := Setup(t).InitBasic()
|
||||
defer th.TearDown()
|
||||
t.Run("should return true if forced", func(t *testing.T) {
|
||||
@@ -1238,6 +1244,7 @@ func (h *testPushNotificationHandler) notificationAcks() []*model.PushNotificati
|
||||
}
|
||||
|
||||
func TestClearPushNotificationSync(t *testing.T) {
|
||||
mainHelper.Parallel(t)
|
||||
th := SetupWithStoreMock(t)
|
||||
defer th.TearDown()
|
||||
|
||||
@@ -1314,6 +1321,7 @@ func TestClearPushNotificationSync(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestUpdateMobileAppBadgeSync(t *testing.T) {
|
||||
mainHelper.Parallel(t)
|
||||
th := SetupWithStoreMock(t)
|
||||
defer th.TearDown()
|
||||
|
||||
@@ -1373,6 +1381,7 @@ func TestUpdateMobileAppBadgeSync(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSendTestPushNotification(t *testing.T) {
|
||||
mainHelper.Parallel(t)
|
||||
th := Setup(t)
|
||||
defer th.TearDown()
|
||||
|
||||
@@ -1400,6 +1409,7 @@ func TestSendTestPushNotification(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSendAckToPushProxy(t *testing.T) {
|
||||
mainHelper.Parallel(t)
|
||||
th := SetupWithStoreMock(t)
|
||||
defer th.TearDown()
|
||||
|
||||
@@ -1444,6 +1454,7 @@ func TestSendAckToPushProxy(t *testing.T) {
|
||||
// TestAllPushNotifications is a master test which sends all various types
|
||||
// of notifications and verifies they have been properly sent.
|
||||
func TestAllPushNotifications(t *testing.T) {
|
||||
mainHelper.Parallel(t)
|
||||
if testing.Short() {
|
||||
t.Skip("skipping all push notifications test in short mode")
|
||||
}
|
||||
@@ -1554,6 +1565,7 @@ func TestAllPushNotifications(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestPushNotificationRace(t *testing.T) {
|
||||
mainHelper.Parallel(t)
|
||||
th := Setup(t)
|
||||
defer th.TearDown()
|
||||
|
||||
@@ -1610,6 +1622,7 @@ func TestPushNotificationRace(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestPushNotificationAttachment(t *testing.T) {
|
||||
mainHelper.Parallel(t)
|
||||
th := Setup(t)
|
||||
defer th.TearDown()
|
||||
|
||||
|
||||
Ссылка в новой задаче
Block a user