MM-27149: optimize initBasic (#15063)
* MM-27149: optimize initBasic Mostly, all tests just needed the user initialization part and not the channel and group creation. So we move the user initialization inside the Setup call. This avoids unnecessary DB calls which take around 250-300ms on average. And we make the login requests concurrently to shave off a few more ms. According to my tests, the 2 login calls take 140 ms on average, which shaves off 70ms. So approximately, we shave off 350ms per test. And there are 114 occurences of these. So around 39 seconds. * make initlogin only for Setup/SetupEnterprise Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
30bd506e76
Коммит
4a2715974d
@@ -12,7 +12,7 @@ import (
|
||||
)
|
||||
|
||||
func TestTestLdap(t *testing.T) {
|
||||
th := Setup(t).InitBasic()
|
||||
th := Setup(t)
|
||||
defer th.TearDown()
|
||||
|
||||
th.TestForSystemAdminAndLocal(t, func(t *testing.T, client *model.Client4) {
|
||||
@@ -37,7 +37,7 @@ func TestTestLdap(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSyncLdap(t *testing.T) {
|
||||
th := Setup(t).InitBasic()
|
||||
th := Setup(t)
|
||||
defer th.TearDown()
|
||||
|
||||
th.TestForSystemAdminAndLocal(t, func(t *testing.T, client *model.Client4) {
|
||||
@@ -59,7 +59,7 @@ func TestSyncLdap(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestGetLdapGroups(t *testing.T) {
|
||||
th := Setup(t).InitBasic()
|
||||
th := Setup(t)
|
||||
defer th.TearDown()
|
||||
|
||||
_, resp := th.Client.GetLdapGroups()
|
||||
@@ -74,7 +74,7 @@ func TestGetLdapGroups(t *testing.T) {
|
||||
func TestLinkLdapGroup(t *testing.T) {
|
||||
const entryUUID string = "foo"
|
||||
|
||||
th := Setup(t).InitBasic()
|
||||
th := Setup(t)
|
||||
defer th.TearDown()
|
||||
|
||||
_, resp := th.Client.LinkLdapGroup(entryUUID)
|
||||
@@ -87,7 +87,7 @@ func TestLinkLdapGroup(t *testing.T) {
|
||||
func TestUnlinkLdapGroup(t *testing.T) {
|
||||
const entryUUID string = "foo"
|
||||
|
||||
th := Setup(t).InitBasic()
|
||||
th := Setup(t)
|
||||
defer th.TearDown()
|
||||
|
||||
_, resp := th.Client.UnlinkLdapGroup(entryUUID)
|
||||
@@ -98,7 +98,7 @@ func TestUnlinkLdapGroup(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestMigrateIdLdap(t *testing.T) {
|
||||
th := Setup(t).InitBasic()
|
||||
th := Setup(t)
|
||||
defer th.TearDown()
|
||||
|
||||
_, resp := th.Client.MigrateIdLdap("objectGUID")
|
||||
|
||||
Ссылка в новой задаче
Block a user