Various unit test related improvements (#9865)
* api4: improved error handling * system_store: more logs * integrate go-junit-report into test-te/test-ee * add CI_MINIO_HOST and CI_INBUCKET_HOST instead of CI_HOST * comment re: minio configuration issue * fix TestStartServerPortUnavailable to pass even when root can bind to :21 * skip TestFindManifest_FolderPermission while running as root
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
c24c518a14
Коммит
136d8ca5c4
@@ -218,6 +218,7 @@ func (me *TestHelper) InitBasic() *TestHelper {
|
||||
me.TeamAdminUser = me.CreateUser()
|
||||
me.App.UpdateUserRoles(me.TeamAdminUser.Id, model.SYSTEM_USER_ROLE_ID, false)
|
||||
me.LoginTeamAdmin()
|
||||
|
||||
me.BasicTeam = me.CreateTeam()
|
||||
me.BasicChannel = me.CreatePublicChannel()
|
||||
me.BasicPrivateChannel = me.CreatePrivateChannel()
|
||||
@@ -285,7 +286,10 @@ func (me *TestHelper) CreateTeamWithClient(client *model.Client4) *model.Team {
|
||||
}
|
||||
|
||||
utils.DisableDebugLogForTest()
|
||||
rteam, _ := client.CreateTeam(team)
|
||||
rteam, resp := client.CreateTeam(team)
|
||||
if resp.Error != nil {
|
||||
panic(resp.Error)
|
||||
}
|
||||
utils.EnableDebugLogForTest()
|
||||
return rteam
|
||||
}
|
||||
@@ -337,7 +341,10 @@ func (me *TestHelper) CreateChannelWithClientAndTeam(client *model.Client4, chan
|
||||
}
|
||||
|
||||
utils.DisableDebugLogForTest()
|
||||
rchannel, _ := client.CreateChannel(channel)
|
||||
rchannel, resp := client.CreateChannel(channel)
|
||||
if resp.Error != nil {
|
||||
panic(resp.Error)
|
||||
}
|
||||
utils.EnableDebugLogForTest()
|
||||
return rchannel
|
||||
}
|
||||
@@ -447,25 +454,37 @@ func (me *TestHelper) LoginSystemAdmin() {
|
||||
|
||||
func (me *TestHelper) LoginBasicWithClient(client *model.Client4) {
|
||||
utils.DisableDebugLogForTest()
|
||||
client.Login(me.BasicUser.Email, me.BasicUser.Password)
|
||||
_, resp := client.Login(me.BasicUser.Email, me.BasicUser.Password)
|
||||
if resp.Error != nil {
|
||||
panic(resp.Error)
|
||||
}
|
||||
utils.EnableDebugLogForTest()
|
||||
}
|
||||
|
||||
func (me *TestHelper) LoginBasic2WithClient(client *model.Client4) {
|
||||
utils.DisableDebugLogForTest()
|
||||
client.Login(me.BasicUser2.Email, me.BasicUser2.Password)
|
||||
_, resp := client.Login(me.BasicUser2.Email, me.BasicUser2.Password)
|
||||
if resp.Error != nil {
|
||||
panic(resp.Error)
|
||||
}
|
||||
utils.EnableDebugLogForTest()
|
||||
}
|
||||
|
||||
func (me *TestHelper) LoginTeamAdminWithClient(client *model.Client4) {
|
||||
utils.DisableDebugLogForTest()
|
||||
client.Login(me.TeamAdminUser.Email, me.TeamAdminUser.Password)
|
||||
_, resp := client.Login(me.TeamAdminUser.Email, me.TeamAdminUser.Password)
|
||||
if resp.Error != nil {
|
||||
panic(resp.Error)
|
||||
}
|
||||
utils.EnableDebugLogForTest()
|
||||
}
|
||||
|
||||
func (me *TestHelper) LoginSystemAdminWithClient(client *model.Client4) {
|
||||
utils.DisableDebugLogForTest()
|
||||
client.Login(me.SystemAdminUser.Email, me.SystemAdminUser.Password)
|
||||
_, resp := client.Login(me.SystemAdminUser.Email, me.SystemAdminUser.Password)
|
||||
if resp.Error != nil {
|
||||
panic(resp.Error)
|
||||
}
|
||||
utils.EnableDebugLogForTest()
|
||||
}
|
||||
|
||||
|
||||
Ссылка в новой задаче
Block a user