[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
This commit is contained in:
Shreyansh Chouhan
2019-02-14 23:22:11 +05:30
committed by Jesse Hallam
parent a6d0b73c0d
commit 39ceaa3e86
56 changed files with 316 additions and 264 deletions

View File

@@ -48,7 +48,7 @@ func setupPluginApiTest(t *testing.T, pluginCode string, pluginManifest string,
}
func TestPluginAPIGetUsers(t *testing.T) {
th := Setup()
th := Setup(t)
defer th.TearDown()
api := th.SetupPluginAPI()
@@ -135,7 +135,7 @@ func TestPluginAPIGetUsers(t *testing.T) {
}
func TestPluginAPIGetUsersInTeam(t *testing.T) {
th := Setup().InitBasic()
th := Setup(t).InitBasic()
defer th.TearDown()
api := th.SetupPluginAPI()
@@ -244,7 +244,7 @@ func TestPluginAPIGetUsersInTeam(t *testing.T) {
}
func TestPluginAPIUpdateUserStatus(t *testing.T) {
th := Setup().InitBasic()
th := Setup(t).InitBasic()
defer th.TearDown()
api := th.SetupPluginAPI()
@@ -263,7 +263,7 @@ func TestPluginAPIUpdateUserStatus(t *testing.T) {
}
func TestPluginAPIGetFile(t *testing.T) {
th := Setup().InitBasic()
th := Setup(t).InitBasic()
defer th.TearDown()
api := th.SetupPluginAPI()
@@ -288,7 +288,7 @@ func TestPluginAPIGetFile(t *testing.T) {
require.Nil(t, data)
}
func TestPluginAPISavePluginConfig(t *testing.T) {
th := Setup().InitBasic()
th := Setup(t).InitBasic()
defer th.TearDown()
manifest := &model.Manifest{
@@ -335,7 +335,7 @@ func TestPluginAPISavePluginConfig(t *testing.T) {
}
func TestPluginAPIGetPluginConfig(t *testing.T) {
th := Setup().InitBasic()
th := Setup(t).InitBasic()
defer th.TearDown()
manifest := &model.Manifest{
@@ -366,7 +366,7 @@ func TestPluginAPIGetPluginConfig(t *testing.T) {
}
func TestPluginAPILoadPluginConfiguration(t *testing.T) {
th := Setup().InitBasic()
th := Setup(t).InitBasic()
defer th.TearDown()
var pluginJson map[string]interface{}
@@ -437,7 +437,7 @@ func TestPluginAPILoadPluginConfiguration(t *testing.T) {
}
func TestPluginAPILoadPluginConfigurationDefaults(t *testing.T) {
th := Setup().InitBasic()
th := Setup(t).InitBasic()
defer th.TearDown()
var pluginJson map[string]interface{}
@@ -511,7 +511,7 @@ func TestPluginAPILoadPluginConfigurationDefaults(t *testing.T) {
}
func TestPluginAPIGetProfileImage(t *testing.T) {
th := Setup().InitBasic()
th := Setup(t).InitBasic()
defer th.TearDown()
api := th.SetupPluginAPI()
@@ -527,7 +527,7 @@ func TestPluginAPIGetProfileImage(t *testing.T) {
}
func TestPluginAPISetProfileImage(t *testing.T) {
th := Setup().InitBasic()
th := Setup(t).InitBasic()
defer th.TearDown()
api := th.SetupPluginAPI()
@@ -557,7 +557,7 @@ func TestPluginAPISetProfileImage(t *testing.T) {
}
func TestPluginAPIGetPlugins(t *testing.T) {
th := Setup().InitBasic()
th := Setup(t).InitBasic()
defer th.TearDown()
api := th.SetupPluginAPI()
@@ -615,7 +615,7 @@ func TestPluginAPIGetPlugins(t *testing.T) {
}
func TestPluginAPIGetTeamIcon(t *testing.T) {
th := Setup().InitBasic()
th := Setup(t).InitBasic()
defer th.TearDown()
api := th.SetupPluginAPI()
@@ -646,7 +646,7 @@ func TestPluginAPIGetTeamIcon(t *testing.T) {
}
func TestPluginAPISetTeamIcon(t *testing.T) {
th := Setup().InitBasic()
th := Setup(t).InitBasic()
defer th.TearDown()
api := th.SetupPluginAPI()
@@ -676,7 +676,7 @@ func TestPluginAPISetTeamIcon(t *testing.T) {
}
func TestPluginAPISearchChannels(t *testing.T) {
th := Setup().InitBasic()
th := Setup(t).InitBasic()
defer th.TearDown()
api := th.SetupPluginAPI()
@@ -694,7 +694,7 @@ func TestPluginAPISearchChannels(t *testing.T) {
}
func TestPluginAPISearchPostsInTeam(t *testing.T) {
th := Setup().InitBasic()
th := Setup(t).InitBasic()
defer th.TearDown()
api := th.SetupPluginAPI()
@@ -740,7 +740,7 @@ func TestPluginAPISearchPostsInTeam(t *testing.T) {
}
func TestPluginAPIGetChannelsForTeamForUser(t *testing.T) {
th := Setup().InitBasic()
th := Setup(t).InitBasic()
defer th.TearDown()
api := th.SetupPluginAPI()
@@ -758,7 +758,7 @@ func TestPluginAPIGetChannelsForTeamForUser(t *testing.T) {
}
func TestPluginAPIRemoveTeamIcon(t *testing.T) {
th := Setup().InitBasic()
th := Setup(t).InitBasic()
defer th.TearDown()
api := th.SetupPluginAPI()
@@ -781,7 +781,7 @@ func TestPluginAPIRemoveTeamIcon(t *testing.T) {
}
func TestPluginAPIUpdateUserActive(t *testing.T) {
th := Setup().InitBasic()
th := Setup(t).InitBasic()
defer th.TearDown()
api := th.SetupPluginAPI()
@@ -808,7 +808,7 @@ func TestPluginAPIUpdateUserActive(t *testing.T) {
}
func TestPluginAPIGetDirectChannel(t *testing.T) {
th := Setup().InitBasic()
th := Setup(t).InitBasic()
defer th.TearDown()
api := th.SetupPluginAPI()
@@ -826,7 +826,7 @@ func TestPluginAPIGetDirectChannel(t *testing.T) {
}
func TestPluginAPISendMail(t *testing.T) {
th := Setup().InitBasic()
th := Setup(t).InitBasic()
defer th.TearDown()
api := th.SetupPluginAPI()
@@ -856,7 +856,7 @@ func TestPluginAPISendMail(t *testing.T) {
}
func TestPluginAPI_SearchTeams(t *testing.T) {
th := Setup().InitBasic()
th := Setup(t).InitBasic()
defer th.TearDown()
api := th.SetupPluginAPI()