This PR makes 2 main changes to the tests:
1. User logins were a huge part of the total CPU time because of the constant hashing of the password. There were 3 logins every time for every `Setup()` call. We remove the `LoginSystemManager` from the Setup call as it wasn't used in a lot of tests, and call that as needed.
2. We add the new app migrations that got added after the last preload optimization was done.

This shaves off around 3 mins from the test runtime. They are down from ~18m to ~15m.

```release-note
NONE
```

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
Agniva De Sarker
2022-09-06 13:55:06 +05:30
коммит произвёл GitHub
родитель bd42f0cd8c
Коммит 696b9e0872
7 изменённых файлов: 132 добавлений и 51 удалений

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

@@ -440,15 +440,11 @@ func (th *TestHelper) InitLogin() *TestHelper {
th.SystemManagerUser.Password = "Pa$$word11"
var wg sync.WaitGroup
wg.Add(3)
wg.Add(2)
go func() {
th.LoginSystemAdmin()
wg.Done()
}()
go func() {
th.LoginSystemManager()
wg.Done()
}()
go func() {
th.LoginTeamAdmin()
wg.Done()
@@ -527,10 +523,6 @@ func (th *TestHelper) CreateWebSocketSystemAdminClient() (*model.WebSocketClient
return model.NewWebSocketClient4(fmt.Sprintf("ws://localhost:%v", th.App.Srv().ListenAddr.Port), th.SystemAdminClient.AuthToken)
}
func (th *TestHelper) CreateWebSocketSystemManagerClient() (*model.WebSocketClient, error) {
return model.NewWebSocketClient4(fmt.Sprintf("ws://localhost:%v", th.App.Srv().ListenAddr.Port), th.SystemManagerClient.AuthToken)
}
func (th *TestHelper) CreateWebSocketClientWithClient(client *model.Client4) (*model.WebSocketClient, error) {
return model.NewWebSocketClient4(fmt.Sprintf("ws://localhost:%v", th.App.Srv().ListenAddr.Port), client.AuthToken)
}