summaryrefslogtreecommitdiffstats
path: root/api4/channel_test.go
diff options
context:
space:
mode:
authorJonathan <jonfritz@gmail.com>2017-08-31 15:59:03 -0400
committerGitHub <noreply@github.com>2017-08-31 15:59:03 -0400
commit74b5e52c4eb54000dcb5a7b46c0977d732bce80f (patch)
treeb8b985cadb630879763ddb48777e4ed2714ac0c0 /api4/channel_test.go
parent000d7aad3d31c5e590db5812f7f8500856e11985 (diff)
downloadchat-74b5e52c4eb54000dcb5a7b46c0977d732bce80f.tar.gz
chat-74b5e52c4eb54000dcb5a7b46c0977d732bce80f.tar.bz2
chat-74b5e52c4eb54000dcb5a7b46c0977d732bce80f.zip
PLT-3893: Structured Logging Continues (#7252)
* PLT-3893: Imported logger work from https://github.com/MusikPolice/platform * PLT-3893: Integrated logger with system config * PLT-3893: Integrated Mattermost config with logging solution, modified log message serialization so entire message is serialized as a JSON object * PLT-3893: Added support for format strings in Debug methods. Added an overload that does not require a Context object for cases when one isn't available * PLT-3893: Added context and format string support to debug and error methods * PLT-3893: A few updates from pull request feedback * PLT-3893: Changed tests to use testify * Fixed TestAddRemoveConfigListener to no longer assume that there are zero config listeners when the test begins, since other tests could add config listeners * Updated TestGetDeletedChannelsForTeam so that it doesn't assume state when it begins * PLT-3893: Changed File property of log message so that it's relative to /mattermost directory, rather than to wherever the user is running the application from on their machine * Flipped expected/actual assert arguments, added an explicit test for getCallerFilename(...), since it's failing on Jenkins * Added printlns to debug failing tests on Jenkins * Relaxed test cases to avoid failure on Jenkins caused by code coverage calculations. Removed printlns. * Changed the way that caller filename is determined to make it more robust, updated tests to make them more lax, while not choking on the strange paths that Jenkins uses. * Fixed gofmt issues * Added debug output to tests to diagnose Jenkins build failures * Still trying to get some useful debug logging on Jenkins * Changed getCallerFilename to handle the strange paths that runtime.Caller(...) returns on Jenkins * Fixing checkstyle issues
Diffstat (limited to 'api4/channel_test.go')
-rw-r--r--api4/channel_test.go8
1 files changed, 3 insertions, 5 deletions
diff --git a/api4/channel_test.go b/api4/channel_test.go
index 1747d79b9..e4da4f4d2 100644
--- a/api4/channel_test.go
+++ b/api4/channel_test.go
@@ -502,9 +502,7 @@ func TestGetDeletedChannelsForTeam(t *testing.T) {
channels, resp = Client.GetDeletedChannelsForTeam(team.Id, 0, 100, "")
CheckNoError(t, resp)
- if len(channels) != 0 {
- t.Fatal("should be no deleted channels")
- }
+ numInitialChannelsForTeam := len(channels)
// create and delete public channel
publicChannel1 := th.CreatePublicChannel()
@@ -512,7 +510,7 @@ func TestGetDeletedChannelsForTeam(t *testing.T) {
channels, resp = Client.GetDeletedChannelsForTeam(team.Id, 0, 100, "")
CheckNoError(t, resp)
- if len(channels) != 1 {
+ if len(channels) != numInitialChannelsForTeam+1 {
t.Fatal("should be 1 deleted channel")
}
@@ -521,7 +519,7 @@ func TestGetDeletedChannelsForTeam(t *testing.T) {
channels, resp = Client.GetDeletedChannelsForTeam(team.Id, 0, 100, "")
CheckNoError(t, resp)
- if len(channels) != 2 {
+ if len(channels) != numInitialChannelsForTeam+2 {
t.Fatal("should be 2 deleted channels")
}