[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
@@ -19,6 +19,7 @@ import (
|
||||
)
|
||||
|
||||
func TestGetSessionIdleTimeoutInMinutes(t *testing.T) {
|
||||
mainHelper.Parallel(t)
|
||||
th := Setup(t)
|
||||
defer th.TearDown()
|
||||
|
||||
@@ -98,6 +99,7 @@ func TestGetSessionIdleTimeoutInMinutes(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestUpdateSessionOnPromoteDemote(t *testing.T) {
|
||||
mainHelper.Parallel(t)
|
||||
th := Setup(t).InitBasic()
|
||||
defer th.TearDown()
|
||||
|
||||
@@ -151,10 +153,13 @@ func TestUpdateSessionOnPromoteDemote(t *testing.T) {
|
||||
})
|
||||
}
|
||||
|
||||
const hourMillis int64 = 60 * 60 * 1000
|
||||
const dayMillis int64 = 24 * hourMillis
|
||||
const (
|
||||
hourMillis int64 = 60 * 60 * 1000
|
||||
dayMillis int64 = 24 * hourMillis
|
||||
)
|
||||
|
||||
func TestApp_GetSessionLengthInMillis(t *testing.T) {
|
||||
mainHelper.Parallel(t)
|
||||
th := Setup(t)
|
||||
defer th.TearDown()
|
||||
|
||||
@@ -222,7 +227,8 @@ func TestApp_GetSessionLengthInMillis(t *testing.T) {
|
||||
UserId: model.NewId(),
|
||||
Props: map[string]string{
|
||||
model.UserAuthServiceIsSaml: "true",
|
||||
}}
|
||||
},
|
||||
}
|
||||
session, err := th.App.CreateSession(th.Context, session)
|
||||
require.Nil(t, err)
|
||||
|
||||
@@ -243,6 +249,7 @@ func TestApp_GetSessionLengthInMillis(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestApp_ExtendExpiryIfNeeded(t *testing.T) {
|
||||
mainHelper.Parallel(t)
|
||||
th := Setup(t)
|
||||
defer th.TearDown()
|
||||
|
||||
@@ -284,7 +291,7 @@ func TestApp_ExtendExpiryIfNeeded(t *testing.T) {
|
||||
require.False(t, session.IsExpired())
|
||||
})
|
||||
|
||||
var tests = []struct {
|
||||
tests := []struct {
|
||||
enabled bool
|
||||
name string
|
||||
session *model.Session
|
||||
@@ -365,6 +372,7 @@ func TestGetCloudSession(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestGetRemoteClusterSession(t *testing.T) {
|
||||
mainHelper.Parallel(t)
|
||||
th := Setup(t)
|
||||
token := model.NewId()
|
||||
remoteID := model.NewId()
|
||||
@@ -400,6 +408,7 @@ func TestGetRemoteClusterSession(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSessionsLimit(t *testing.T) {
|
||||
mainHelper.Parallel(t)
|
||||
th := Setup(t).InitBasic()
|
||||
defer th.TearDown()
|
||||
|
||||
@@ -447,6 +456,7 @@ func TestSessionsLimit(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSetExtraSessionProps(t *testing.T) {
|
||||
mainHelper.Parallel(t)
|
||||
th := Setup(t).InitBasic()
|
||||
defer th.TearDown()
|
||||
|
||||
|
||||
Ссылка в новой задаче
Block a user