Граф коммитов

11776 Коммитов

Автор SHA1 Сообщение Дата
Luke Kingland
df0bb8aaa0 emoji_test: update to use testify (#12932)
* emoji_test: update to use testify

* emoji_test: use testify builtin Len check, and add missing err check
2019-10-31 12:44:27 +04:00
Ali Farooq
e4ed763e2a MM-19310 - Wrong validation message when Bot name ends in a . (#12905)
* MM-19310 - Wrong validation message when Bot name ends in a .

* Reverting back old behaviour
2019-10-30 17:00:43 -04:00
Nikhil Ranjan
a221c52acb Migrate tests from store/storetest/oauth_store.go to use testify (#12875) 2019-10-30 19:37:36 +01:00
Romain FOYARD
4111ffdb4d Include extra metadata when clicking an interactive button (#12697)
* Include user_name, team_domain and channel_name when clicking an interactive button

* Fixed api4's TestPostActionCookies test

* Moved team database request to improve concurrency.
Renamed TeamDomain to TeamName.

* Further optimizations to database requests

* Removed useless goroutine when fetching channel
2019-10-30 10:36:14 -07:00
George Goldberg
1b95ee9834 MM-19553: Generate valid passwords on bulk import. (#12871)
This changes the bulk import so when it needs to generate a password
because no password or auth data was supplied, it now takes into account
the configured minimum length, as well as assuming all other distinct
character types are configured to be required. It should now generate
valid passwords regardless of the password policy configuration in the
Mattermost configuration file.
2019-10-30 16:57:51 +00:00
Luciano Magro Mores
f9a7a16a78 Convert api4/webhook_test.go t.Fatal calls into require/assert calls (#12904) 2019-10-30 21:08:40 +08:00
Ben Schumacher
bc2b8b85fb Fix golangci-lint target for non GOPATH installations (#12934)
* Fix golangci-lint target for non GOPATH installations

* Link to https://github.com/golangci/golangci-lint#install
2019-10-30 12:48:51 +01:00
Paulo Bittencourt
7d0d7c304e MM-17888 Check plugin Helpers minimum server version comments (#12663) 2019-10-30 08:34:29 +01:00
Clément Collin
7cc1f19453 [MM-18898] Stringify plugin.Log* parameters (#12700)
- Add stringutils with method that "stringify" object slices
  - "stringify" means convert each object to its string representation
- Move plugin.Log* implementations to client_rpc, use stringify method before calling server method
- Exclude Log* methods from generated RPC methods
- No signature change for plugin.Log* API
- Add test in plugin_api_test to use plugin.Log* methods with RPC
2019-10-30 04:17:04 +01:00
catalintomai
5dbccd0f07 [MM-18360] Add audit logging for SAML user login (#12831)
* Add audit logging for SAML user login

* add statement for login sucess

* Update web/saml.go

Co-Authored-By: Martin Kraft <martin@upspin.org>
2019-10-29 10:54:43 -07:00
Alexander Morozov
9b9923ea42 Replace time.After with time.NewTimer (#12945)
time.After might leave stray timers if other channels in select triggered early

Signed-off-by: Alexander Morozov <lk4d4math@gmail.com>
2019-10-29 18:41:54 +01:00
Carlos Tadeu Panato Junior
a3257690d6 Update TestHandleCommandResponsePost test (#12879)
* Update TestHandleCommandResponsePost test
2019-10-29 18:39:54 +01:00
Carlos Tadeu Panato Junior
b3c0b5dd57 remove redis (#12918) 2019-10-29 15:05:54 +00:00
Akshay Chhajed
91f944f64d Migrate tests for store/storetest/channel_store.go (#12892)
* Migrate tests for store/storetest/channel_store.go

* Corrected variable declaration

* corrected nilf to nil

* Reordered parameters to Equal and EqualValues
Corrected few tests to use Len, NotNil to improve readability

* Removed third parameter from require.Nil()

* Corrected failing tests
2019-10-29 07:43:23 -07:00
Ben Schumacher
38c0bde7f8 Run ineffassign against codebase (#12925) 2019-10-29 15:04:28 +01:00
Ali Farooq
4cc2973483 MM-18827 - Can not use api/v4/websocket with trailing slash (#12931) 2019-10-29 18:44:32 +08:00
Ben Schumacher
7a665aacdd Run gosimple against codebase (#12928) 2019-10-29 07:45:09 +01:00
Nikhil Ranjan
d7649fbf31 Migrate tests from store/storetest/terms_of_service_store.go to use testify (#12874) 2019-10-28 20:02:28 -04:00
Nikhil Ranjan
7bcb835f37 Convert store/storetest/preference_store.go t.Fatal calls into assert/require calls (#12800)
* Convert store/storetest/preference_store.go t.Fatal calls into assert/require calls

* fix test
2019-10-28 17:23:55 -04:00
Ben Schumacher
fdcda20fe4 Cleanup dead code (#12929)
* Cleanup dead code

* Remove unneeded translation string
2019-10-28 19:12:50 +01:00
Ben Schumacher
71d5f7dc64 Remove unused struct fields (#12924) 2019-10-28 18:04:50 +01:00
Luke Kingland
aaf0bf1cdd command_help_test, cors_test: use testify (#12941)
* command_help_test, cors_test: use testify

* cors_test: remove extraneous lines

* command_help_test: remove extraneous lines

* command_help_test: set checks to nonterminal
2019-10-28 09:52:51 -06:00
413x
ef5a5d574f GH-12630 Migrate tests from model/file_info_test.go to use testify (#12647)
* Rewrite tests on testify for model/file_info_test.go
2019-10-28 16:44:20 +01:00
Ben Schumacher
d6f8ea293b Remove unused variables (#12926) 2019-10-28 11:41:41 -04:00
Eli Yukelzon
0736433d47 fix npm ci step (#12937) 2019-10-28 09:51:18 -04:00
Ben Schumacher
e61340c54e Run gofmt -s against codebase (#12943) 2019-10-28 06:08:08 -07:00
Ben Schumacher
8a72ed2833 Fix unnecessary type conversions (#12927) 2019-10-28 10:57:21 +01:00
Agus Mistiawan
3701a393e5 Migrate tests from "api4/apitestlib.go" to use testify (#12817)
* migrate tests to use testify

* check resp error

* require empty auth

* fix based on comment

* change to require

* change all assert to require

* remove line
2019-10-27 12:54:19 +01:00
Igor Zibarev
4d962aaade Migrate tests from "api4/job_test.go" to use testify (#12897)
Fixes #12887
2019-10-27 11:47:15 +01:00
chahat arora
cf6496bb8f Migrate tests from app/command_test.go to use testify (#12659)
* Migrate tests from app/command_test.go to use testify

* minor fix

* minor fix

* minor fix
2019-10-27 11:42:21 +01:00
Luke Kingland
78c2780bc7 preference_test: use testify (#12933) 2019-10-26 07:38:07 -07:00
Agniva De Sarker
3be92856b5 MM-19172: Add golangci-lint to the CI pipeline (#12909)
To start off with, we are using the new-from-rev=HEAD~ option which just checks the current
commit. This allows us to quickly integrate golangci-lint and not spend time in fixing all the
outstanding issues.

Things pending:
- Slowly fix the existing issues. To test them, just uncomment the "new-from-rev: HEAD~" line
from .golangci.yml and have at it.
- There are a number of unused functions and methods which are only invoked from enterprise code.
We are ignoring them for now because removing them will stop enterprise build from working.

The correct solution here is to use a build tag to separate TE and EE code. As a long term goal,
we would want to use that build tag throughout the EE codebase and remove the TE_PACKAGES and
EE_PACKAGES variables in the Makefile and just use the build tag. That makes things a lot cleaner
and avoids the need to spawn a "go list" every time to get the correct list of packages.
2019-10-26 09:12:07 +02:00
Ben Schumacher
37e0424977 Include request_id in HTTP request logs (#12880) 2019-10-25 20:02:18 +02:00
Guillermo Vayá
f58e2ffd0f [MM-19344] add option to render latex (#12907) 2019-10-25 13:58:48 -04:00
Abu Hanifa
c0186cef1a Conv emoji to testify (#12900)
* convert fatal to requrie

Signed-off-by: hanif <abuhanifa@pathao.com>

* finish convert

Signed-off-by: hanif <abuhanifa@pathao.com>

* change require.Errof to require.Failf

Signed-off-by: hanif <abuhanifa@pathao.com>

* simplify conditions

Signed-off-by: hanif <abuhanifa@pathao.com>
2019-10-25 13:49:33 -04:00
Jesús Espino
187e4ac765 Unbinding the permission INVITE_GUEST from INVITE_USER (#12908) 2019-10-25 18:10:34 +02:00
Adrian
a622ba412e Use locale-agnostic Firefox download link (#12251)
This link redirects to the most suitable language for the user based on their browser's `Accept-Language` header.
2019-10-25 11:19:56 +02:00
Christopher Speller
89317487b8 Fixing inconsistant docker build containers. (#12911) 2019-10-25 11:00:43 +02:00
Carlos Tadeu Panato Junior
64a377c60c use the branch to tag the docker image and also build team edition (#12903) 2019-10-25 10:43:27 +02:00
Rajat Varyani
7cf7e7f238 [MM-18871] Update session in app instance in app layer (#12540) 2019-10-25 14:13:13 +05:30
Veda Depatla
7c230d542a replace fmt.sprintf (#12776)
* replace fmt.sprintf

* update error message

* Update app/ldap.go

Co-Authored-By: Jesse Hallam <jesse.hallam@gmail.com>

* Update app/ldap.go

Co-Authored-By: Jesse Hallam <jesse.hallam@gmail.com>
2019-10-24 23:26:37 -04:00
ptisserand
6ce97648f4 MM-19670: Migrate tests to use testify (#12883) (#12898)
* MM-19670: Migrate tests to use testify (#12883)

* MM-19670: (#12883) Applied changes requested in PR #12898

* MM-19670: (#12883) assert.Equal parameters are 'expected' and then 'actual'.
2019-10-24 22:55:58 -04:00
Hossein Ahmadian-Yazdi
b9329d1984 [MM-13704] Updated CLI "deleter user" to also permanently delete GroupMembers associated to user (#12858)
* [MM-13704] Updated CLI to set DeleteAt in groupmemebrs

* [MM-13704] Updated Mock Test

* [MM-13704] Refactored to use current pattern to write function

* [MM-13704] Small text change

* [MM-13704] updated translation

* [MM-13704] Updated params of error function

* [MM-13704] Fixed confusion between channel and group store

* [MM-13704] Addressed PR comments

* [MM-13704] Added test case

* [MM-13704] Fixed err declaration
2019-10-24 17:31:17 -04:00
Laura Pareja
4f8fd3e59e migrate tests from api4/status_test.go to testify (#12906) 2019-10-24 16:59:18 +02:00
Simon
caeadbec88 MM-19468 Migrate tests from "api4/command_test.go" to use testify (#12809)
* MM-19468 Migrate tests from "api4/command_test.go" to use testify

* swap expected and actual values during token regeneration test
2019-10-24 09:32:31 -04:00
Shobhit Gupta
cedaee99b8 Migrate tests from "api4/websocket_test.go" to use testify (#12896)
* Migrate tests to use testify

* Fix build

* Fix tests
2019-10-24 09:04:06 -04:00
Mrigank Krishan
0652e121ec use testify in "model/session_test.go" (#12644)
Migrate tests from "model/session_test.go" to use testify
2019-10-24 10:04:50 +01:00
Ioannis Mavroukakis
07cd32779d MM-394 convert remaining mailservice tests to require/assert (#12813) 2019-10-24 09:01:53 +02:00
Andre Polykanine
9fa6e80e55 Refactor app/notification_email.go for structure logging (#12740) 2019-10-24 07:44:01 +02:00
Harrison Healey
1234e68575 MM-19574 Don't return metadata for deleted posts (#12878) 2019-10-23 14:31:22 -04:00