[MM-13833] Configured unit tests to log through t.Log (#10272)
* Rerouted the unit test logs through t.Log * resolving merge confilvts * Update testing.go * Update helper_test.go * Added godocs for NewTestingLogger * Added go docs for NewTestingLogger * Resolving conflicts
Этот коммит содержится в:
коммит произвёл
Jesse Hallam
родитель
a6d0b73c0d
Коммит
39ceaa3e86
@@ -18,11 +18,11 @@ import (
|
||||
|
||||
"github.com/mattermost/mattermost-server/einterfaces"
|
||||
"github.com/mattermost/mattermost-server/model"
|
||||
"github.com/mattermost/mattermost-server/model/gitlab"
|
||||
oauthgitlab "github.com/mattermost/mattermost-server/model/gitlab"
|
||||
)
|
||||
|
||||
func TestIsUsernameTaken(t *testing.T) {
|
||||
th := Setup().InitBasic()
|
||||
th := Setup(t).InitBasic()
|
||||
defer th.TearDown()
|
||||
|
||||
user := th.BasicUser
|
||||
@@ -43,7 +43,7 @@ func TestIsUsernameTaken(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestCheckUserDomain(t *testing.T) {
|
||||
th := Setup().InitBasic()
|
||||
th := Setup(t).InitBasic()
|
||||
defer th.TearDown()
|
||||
|
||||
user := th.BasicUser
|
||||
@@ -71,7 +71,7 @@ func TestCheckUserDomain(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestCreateOAuthUser(t *testing.T) {
|
||||
th := Setup().InitBasic()
|
||||
th := Setup(t).InitBasic()
|
||||
defer th.TearDown()
|
||||
|
||||
r := rand.New(rand.NewSource(time.Now().UnixNano()))
|
||||
@@ -117,7 +117,7 @@ func TestCreateProfileImage(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSetDefaultProfileImage(t *testing.T) {
|
||||
th := Setup().InitBasic()
|
||||
th := Setup(t).InitBasic()
|
||||
defer th.TearDown()
|
||||
|
||||
err := th.App.SetDefaultProfileImage(&model.User{
|
||||
@@ -136,7 +136,7 @@ func TestSetDefaultProfileImage(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestUpdateUserToRestrictedDomain(t *testing.T) {
|
||||
th := Setup()
|
||||
th := Setup(t)
|
||||
defer th.TearDown()
|
||||
|
||||
user := th.CreateUser()
|
||||
@@ -155,7 +155,7 @@ func TestUpdateUserToRestrictedDomain(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestUpdateUserActive(t *testing.T) {
|
||||
th := Setup()
|
||||
th := Setup(t)
|
||||
defer th.TearDown()
|
||||
|
||||
user := th.CreateUser()
|
||||
@@ -173,7 +173,7 @@ func TestUpdateUserActive(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestUpdateOAuthUserAttrs(t *testing.T) {
|
||||
th := Setup()
|
||||
th := Setup(t)
|
||||
defer th.TearDown()
|
||||
|
||||
id := model.NewId()
|
||||
@@ -321,7 +321,7 @@ func createGitlabUser(t *testing.T, a *App, username string, email string) (*mod
|
||||
}
|
||||
|
||||
func TestGetUsersByStatus(t *testing.T) {
|
||||
th := Setup()
|
||||
th := Setup(t)
|
||||
defer th.TearDown()
|
||||
|
||||
team := th.CreateTeam()
|
||||
@@ -450,7 +450,7 @@ func TestGetUsersByStatus(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestCreateUserWithToken(t *testing.T) {
|
||||
th := Setup().InitBasic()
|
||||
th := Setup(t).InitBasic()
|
||||
defer th.TearDown()
|
||||
|
||||
user := model.User{Email: strings.ToLower(model.NewId()) + "success+test@example.com", Nickname: "Darth Vader", Username: "vader" + model.NewId(), Password: "passwd1", AuthService: ""}
|
||||
@@ -520,7 +520,7 @@ func TestCreateUserWithToken(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestPermanentDeleteUser(t *testing.T) {
|
||||
th := Setup().InitBasic()
|
||||
th := Setup(t).InitBasic()
|
||||
defer th.TearDown()
|
||||
|
||||
b := []byte("testimage")
|
||||
|
||||
Ссылка в новой задаче
Block a user