Commit Graph

10552 Commits

Author SHA1 Message Date
Harrison Healey
749a3e7538 MM-10417 Improve HTTPService for use in image proxy (#9966)
* Replaced httpservice with proper http.Client

* Added HTTPService.MakeTransport

* Expose timeouts used by HTTPServiceImpl

* Add additional documentation to HTTPService

* Remove MockedHTTPService

* Fix missing license
2018-12-12 11:39:14 -05:00
Chetanya Kandhari
f42c00ee53 MM-13349: Fix TOS not displaying using sso login in RN apps (#9989) 2018-12-12 10:46:24 -05:00
akhilanandbv003
11059b0251 Gh 9610 add plugin api for update user active method (#9854)
* wip

* wip

* After running make plugin-mocks

* Add
TestUpdateUserActive and run make pluginapi

* Adding plugin_api_test.go

* Better formatting of code using gofmt

* Fix tests and run make pluginapi

* Specify the minimum server version on the comments

* Include more tests as per the CR

* Fix tests

* Checking err.Id intsead of err & Removed comments and trailing spaces

* wip

* Fix tests as per CR and spaces

* Make changes to tests as per CR
2018-12-12 10:18:40 -05:00
Jesús Espino
febc5115fd MM-13220: Fixes for bulk export problems (#9980)
* MM-13220: Fixes for bulk export problems

* fixing tests
2018-12-12 14:20:22 +01:00
Jesús Espino
a7b6c71421 MM-12976: Moving MFA to Team edition (#9971)
* MM-12976: Moving MFA to Team edition

* Changing the mfa disabled i18n key and string
2018-12-12 11:50:19 +01:00
Michael Kochell
f94567c97b [MM-9937] Add support for sending a message to a different channel than where the slash command was issued from (#9878)
* add support for channel_id in a slash command response

* add test for HandleCommandResponsePost
2018-12-12 07:43:31 +01:00
Jesse Hallam
8d7cb44f30 Build tweaks (#9985)
* fix TEST_DATABASE_MYSQL_ROOT_PASSWD line wrap

* archiveArtifacts report*.xml
2018-12-11 20:41:11 +01:00
Carlos Tadeu Panato Junior
142ddfe79f add inbucket smtp port env vars (#9987) 2018-12-11 18:38:44 +01:00
Jesús Espino
5a37a606fc MM-12941: Fixed problem with not-in-channel mentions users (#9974) 2018-12-11 14:01:38 +01:00
Harrison Healey
32c35e254e Update default MySQL password for unit tests (#9982)
* Update default MySQL password for unit tests

* stub out AlterColumnDefaultIfExists for SQLite
2018-12-10 21:51:13 -05:00
Joram Wilander
a84eb6505f Fix error checking when setting profile image (#9977) 2018-12-10 19:44:47 +01:00
Jesse Hallam
8374b6221e unittest using externally managed database (#9400)
* MM-12083: unittest using externally managed database

* cherry-pick Makefile changes from @cpanato

* Jenkins changes (#9915)

* add docker compose

* udpate

* when using minio dont need to set the region

* update

* add wait for it script

* using old minio

* add new jenkins file

* update makefile

* add dockerfile

* rename the docker-compose proj to avoid colision (#9917)

* rename the docker-compose proj to avoid colision

* enable debug

* enable debug to double checkt the branchs and fix docker-compose name (#9919)

* add ee hash to check (#9920)

* fix name (#9921)

* update jenkins file to push from branch and prs

* if a new push comes in stop the running build

* split mysql and postgres variables

* add script to run jenkins-like env in local dev env

* update docker-compose project name to use uuid to make it more randon

* fix DCNAME definition

* update elasticsearch docker image

* revert test

* tidy up stages, and wait for mysql differently

* update docker image and add check for postgres

* checking if is ready

* update docker compose to have a wait for deps

* add readme and rename dockerfile

* fix -unittest setup

* using mm docker image

* restore parallel unit tests at the package level

Spin up a dedicated database for each package under test to avoid races in accessing the same tables.
Simplify the interface for configuring the test database to just a DSN instead of multiple exports for each field.

* try to work around root mysql access in CI

* update local-test-env.sh too

* MYSQL_ROOT_HOST: %

* fix missing quotes

* setting some memory limits for mysql

* revert memory docker compose does not support

* fix env name for postgres

* expose errors in app/export_test.go

* fix test label, better error checking on teardown

* increase query timeout for tests

* fix export_test

* update local dev script

* add configurable mysql root passwd
2018-12-10 17:58:09 +01:00
Jesse Hallam
204dde9f48 synchronize migrations with actual schema (#9965) 2018-12-10 08:34:56 -08:00
Jason Blais
ef04692b18 Change "user terms of service" to "terms of service" for consistency (#9978) 2018-12-10 09:51:17 -05:00
Jesse Hallam
d39d9a5caf Dockerized build updated tests (#9943)
* testlib: introduce and leverage

This doesn't yet factor out the individual test helpers: many packages
still rely on `api4` directly to do this, but now wire up the test store
setup through this package. `app` and `store`, in particular, don't use
`testlib` because of circular dependencies at the moment.

* cmd: command_test.go: use api4 testlib

* cmd: plugin_test.go: remove dependence on test-config.json

* cmd: config_test.go use configured database settings

* ensure test-(te|ee) exit with status code

* test-server: run all tests, deprecating test-te/test-ee

* cmd/mattermost/commands: fix unit tests

Instead of relying on (and modifying) a config.json found in the current path, explicitly create a temporary one from defaults for each test. This was likely the source of various bugs over time, but specifically allows us to override the SqlSettings to point at the configured test database for all tests simultaneously.

* wrap run/check into a test helper

It was insufficient to set a config for each invocation of CheckCommand or RunCommand: some tests relied on the config having changed in a subsequent assertion. Instead, create a new test helper embedding api4.TestHelper. This has the nice advantage of cleaning up all the teardown.

* additional TestConfigGet granularity

* customized config path to avoid default location

* be explicit if the storetest initialization fails

* generate safe coverprofile names in the presence of subtests

* additional TestConfigShow granularity

* fix permission_test.go typo

* fix webhook tests

* actually flag.Parse() to skip database setup on os.Execed tests

* fix recent regression in #9962, not caught by unit tests
2018-12-06 13:19:32 -05:00
Saturnino Abril
2708ed6d1f add client config of ExperimentalEnablePostMetadata (#9970) 2018-12-06 12:10:12 -05:00
Christopher Speller
1bac79b9b4 Fix panic with customurlschemes (#9968) 2018-12-06 10:56:06 -05:00
Hanzei
2eaa9e9b35 Migrate to idiomatic error handling in api4/user.go (#9962) 2018-12-06 10:55:06 -05:00
George Goldberg
36e54bcc59 MM-13184: Add some documentation to API handlers. (#9939) 2018-12-05 17:37:30 -05:00
Christopher Speller
8abec4a785 Switching to maintained gomail fork. 2018-12-05 13:51:47 -08:00
Christopher Speller
260b107590 Updating dependencies. 2018-12-05 13:51:47 -08:00
Jesús Espino
acdc20d486 Reading months to translation (included in the extraction tool too) (#9953) 2018-12-05 20:00:33 +01:00
Jesse Hallam
a317093467 leverage CheckCommand when a cmd should pass (#9944)
Using RunCommand obscures the error if, indeed, the assertion fails because the cmd fails to run.
2018-12-05 10:51:31 -08:00
Christopher Speller
aba194188f MM-12855 Plugin Context (#9922)
* Basic plugin context.

* Adding more useful fields to plugin context.

* Fix spelling

Co-Authored-By: crspeller <crspeller@gmail.com>

* Fixing location of context creation.
2018-12-05 10:46:08 -08:00
Hanzei
de5440d979 Depreciate fullmap target (#9963) 2018-12-05 10:13:00 -08:00
Mukul Rawat
56937b0e8b * migrate to idiomatic handling the Reader method of LocalFileBackend (#9959)
* migrate to idiomatic handling the ReadFile method of LocalFileBackend

* migrate to idiomatic handling the ListDirectory method of LocalFileBackend

* gofmt done

* migrate to idiomatic handling the FileExists method of LocalFileBackend
2018-12-05 11:10:54 +01:00
Mukul Rawat
d3c55b8a02 make the error handling idiomatic (#9942)
remove an excess if-else

* run gofmt
2018-12-04 21:55:13 +01:00
Dan Maas
b1438209a6 NOTICE.txt updates for December 2018 (#9926)
- Added new dependencies `semver` and `logrus`
2018-12-04 20:50:55 +01:00
Jesús Espino
6a2f81601d Commenting out delete command test becase race condition (#9952) 2018-12-04 20:36:53 +01:00
Jesús Espino
105fc4b38d Fixing weird fail on delete command tests (#9937) 2018-12-04 12:36:58 +01:00
Joram Wilander
2d8cb45ff3 Temporary fix for slack attachment fields being clobbered by plugins (#9935) 2018-12-04 11:08:10 +01:00
Jesús Espino
2611606e13 Improved how CLI "command delete" command works (#9929) 2018-12-04 06:13:37 +01:00
Joram Wilander
2b99627026 Revert temporary webhook debugging (#9934)
* Revert "More temporary debugging (#9932)"

This reverts commit eab2336bb1.

* Revert "Add temporary webhook debug logs (#9931)"

This reverts commit 043a455ce3.
2018-12-03 15:05:52 -05:00
Christopher Speller
2770d4db64 Updating content security policy. (#9906) 2018-12-03 18:59:30 +01:00
Jesús Espino
bf19debdfd Migrate to idiomatic error handling the api4/channel.go file (#9933) 2018-12-03 18:27:58 +01:00
Joram Wilander
eab2336bb1 More temporary debugging (#9932) 2018-12-03 17:27:26 +01:00
Joram Wilander
043a455ce3 Add temporary webhook debug logs (#9931) 2018-12-03 14:50:37 +01:00
Jesús Espino
adedb44925 Validating config on set command (#9914)
* Validating config on set command

* Adding more tests to confg set command
2018-12-03 14:18:05 +01:00
Christopher Speller
21aaddef92 Fixing initalization order. (#9916) 2018-11-30 17:07:08 +01:00
Kautilya Tripathi
8cd0f284d5 [GH-9639] Add plugin API for SearchUsers method (#9793)
* fixes 9639

* Adding conversion.
2018-11-30 07:47:17 -08:00
Christopher Speller
acd2deaca3 Fixing enterprise init order. (#9912) 2018-11-29 10:12:05 -08:00
Jesse Hallam
6d9b4bc277 fix two page, perPage -> offset, limit mistranslations (#9904)
* fix two page, perPage -> offset, limit mistranslations

* add TestPluginAPIGetUsersInTeam
2018-11-29 13:02:06 -05:00
Jesús Espino
8bbd99aea9 Adding make i18n-extract command to the makefile (#9909) 2018-11-29 08:19:26 -08:00
Jesús Espino
ba0a9b4d50 MM-12368: Fixing webhook create incomming (#9905) 2018-11-29 11:49:45 +01:00
Christopher Speller
da265fbaf7 Moving app from singular to being created for every request (#9889)
* Moving app from singular to being created for every request.

* Automatic refactor

* Adding license header

* Feedback fixes
2018-11-28 10:56:21 -08:00
Carlos Tadeu Panato Junior
1bcf08aa4b Refactor Get/Create Direct Channel into one function (#9867)
* refactor GetDirectChannel and CreateDirectChannel in one function

* remove CreateDirectChannel plugin api and update GetDirectChannel and GetGroupChannel plugin api

* update tests
2018-11-28 18:01:49 +01:00
George Goldberg
09eae76c00 Use constants for NotifyProps keys. (#9901)
We have constants for (most) of the notify props keys. We should use
them consistently, instead of sometimes and other times having strings
scattered around the place.
2018-11-28 11:11:41 -05:00
Harrison Healey
1607d18e55 MM-12009 Resolve relative links in posts as the web app does (#9896) 2018-11-28 11:01:35 -05:00
George Goldberg
9730b46bca MM-13190: Fix NotifyProps in Bulk Import. (#9900)
If some, but not all, notify props are specified for a user in the bulk
import data, and that is a newly created user, we must explicitly
initialise all the other notify props to their default values to avoid
breaking client assumptions.
2018-11-28 15:28:51 +00:00
Jesús Espino
415036ee8d Improving create-outgoing webhook command (#9899) 2018-11-28 15:55:16 +01:00