Passing t to all tests setup functions (#13841)
* Passing t to all tests setup functions * Fixing build
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
3b732fe257
Коммит
1d1ab03c38
@@ -20,7 +20,7 @@ import (
|
||||
)
|
||||
|
||||
func TestGetPing(t *testing.T) {
|
||||
th := Setup().InitBasic()
|
||||
th := Setup(t).InitBasic()
|
||||
defer th.TearDown()
|
||||
|
||||
t.Run("basic ping", func(t *testing.T) {
|
||||
@@ -66,7 +66,7 @@ func TestGetPing(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestGetAudits(t *testing.T) {
|
||||
th := Setup().InitBasic()
|
||||
th := Setup(t).InitBasic()
|
||||
defer th.TearDown()
|
||||
Client := th.Client
|
||||
|
||||
@@ -94,7 +94,7 @@ func TestGetAudits(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestEmailTest(t *testing.T) {
|
||||
th := Setup().InitBasic()
|
||||
th := Setup(t).InitBasic()
|
||||
defer th.TearDown()
|
||||
Client := th.Client
|
||||
|
||||
@@ -148,7 +148,7 @@ func TestEmailTest(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSiteURLTest(t *testing.T) {
|
||||
th := Setup().InitBasic()
|
||||
th := Setup(t).InitBasic()
|
||||
defer th.TearDown()
|
||||
Client := th.Client
|
||||
|
||||
@@ -189,7 +189,7 @@ func TestSiteURLTest(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestDatabaseRecycle(t *testing.T) {
|
||||
th := Setup().InitBasic()
|
||||
th := Setup(t).InitBasic()
|
||||
defer th.TearDown()
|
||||
Client := th.Client
|
||||
|
||||
@@ -212,7 +212,7 @@ func TestDatabaseRecycle(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestInvalidateCaches(t *testing.T) {
|
||||
th := Setup().InitBasic()
|
||||
th := Setup(t).InitBasic()
|
||||
defer th.TearDown()
|
||||
Client := th.Client
|
||||
|
||||
@@ -238,7 +238,7 @@ func TestInvalidateCaches(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestGetLogs(t *testing.T) {
|
||||
th := Setup().InitBasic()
|
||||
th := Setup(t).InitBasic()
|
||||
defer th.TearDown()
|
||||
Client := th.Client
|
||||
|
||||
@@ -271,7 +271,7 @@ func TestGetLogs(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestPostLog(t *testing.T) {
|
||||
th := Setup().InitBasic()
|
||||
th := Setup(t).InitBasic()
|
||||
defer th.TearDown()
|
||||
Client := th.Client
|
||||
|
||||
@@ -312,7 +312,7 @@ func TestPostLog(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestGetAnalyticsOld(t *testing.T) {
|
||||
th := Setup().InitBasic()
|
||||
th := Setup(t).InitBasic()
|
||||
defer th.TearDown()
|
||||
Client := th.Client
|
||||
|
||||
@@ -380,7 +380,7 @@ func TestGetAnalyticsOld(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestS3TestConnection(t *testing.T) {
|
||||
th := Setup().InitBasic()
|
||||
th := Setup(t).InitBasic()
|
||||
defer th.TearDown()
|
||||
Client := th.Client
|
||||
|
||||
@@ -447,7 +447,7 @@ func TestS3TestConnection(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSupportedTimezones(t *testing.T) {
|
||||
th := Setup().InitBasic()
|
||||
th := Setup(t).InitBasic()
|
||||
defer th.TearDown()
|
||||
Client := th.Client
|
||||
|
||||
@@ -470,7 +470,7 @@ func TestRedirectLocation(t *testing.T) {
|
||||
|
||||
mockBitlyLink := testServer.URL
|
||||
|
||||
th := Setup().InitBasic()
|
||||
th := Setup(t).InitBasic()
|
||||
defer th.TearDown()
|
||||
Client := th.Client
|
||||
enableLinkPreviews := *th.App.Config().ServiceSettings.EnableLinkPreviews
|
||||
@@ -515,7 +515,7 @@ func TestRedirectLocation(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSetServerBusy(t *testing.T) {
|
||||
th := Setup().InitBasic()
|
||||
th := Setup(t).InitBasic()
|
||||
defer th.TearDown()
|
||||
|
||||
const secs = 30
|
||||
@@ -536,7 +536,7 @@ func TestSetServerBusy(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSetServerBusyInvalidParam(t *testing.T) {
|
||||
th := Setup().InitBasic()
|
||||
th := Setup(t).InitBasic()
|
||||
defer th.TearDown()
|
||||
|
||||
t.Run("as system admin, invalid param", func(t *testing.T) {
|
||||
@@ -551,7 +551,7 @@ func TestSetServerBusyInvalidParam(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestClearServerBusy(t *testing.T) {
|
||||
th := Setup().InitBasic()
|
||||
th := Setup(t).InitBasic()
|
||||
defer th.TearDown()
|
||||
|
||||
th.App.Srv.Busy.Set(time.Second * 30)
|
||||
@@ -572,7 +572,7 @@ func TestClearServerBusy(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestGetServerBusyExpires(t *testing.T) {
|
||||
th := Setup().InitBasic()
|
||||
th := Setup(t).InitBasic()
|
||||
defer th.TearDown()
|
||||
|
||||
th.App.Srv.Busy.Set(time.Second * 30)
|
||||
@@ -590,7 +590,7 @@ func TestGetServerBusyExpires(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestServerBusy503(t *testing.T) {
|
||||
th := Setup().InitBasic()
|
||||
th := Setup(t).InitBasic()
|
||||
defer th.TearDown()
|
||||
|
||||
th.App.Srv.Busy.Set(time.Second * 30)
|
||||
@@ -629,7 +629,7 @@ func TestServerBusy503(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestPushNotificationAck(t *testing.T) {
|
||||
th := Setup().InitBasic()
|
||||
th := Setup(t).InitBasic()
|
||||
api := Init(th.Server, th.Server.AppOptions, th.Server.Router)
|
||||
session, _ := th.App.GetSession(th.Client.AuthToken)
|
||||
defer th.TearDown()
|
||||
|
||||
Ссылка в новой задаче
Block a user