Commit graph

12 commits

Author SHA1 Message Date
Miguel de la Cruz
bfde6d1f3e
Removing unnecesary main_test.go files (#13979) 2020-03-05 14:46:52 +01:00
Jesús Espino
a63684fcb5
Consistent license message for all the go files (#13235)
* Consistent license message for all the go files

* Fixing the last set of unconsistencies with the license headers

* Addressing PR review comments

* Fixing busy.go and busy_test.go license header
2019-11-29 12:59:40 +01:00
Miguel de la Cruz
2259b7f2a8
[MM-19948] Set version on module file and internal paths (#13186)
* [MM-19948] Set version on module file and internal paths

* Fixes after merge

* Fix i18n checker error
2019-11-28 14:39:38 +01:00
Phillip Ahereza
60572a00c8 Migrate tests from services/httpservice/client_test.go to testify (#12743) 2019-10-22 14:40:50 +02:00
Claudio Costa
dac7014b48 MM-11931 Add support for AllowedUntrustedInternalConnections to be comma-separated (#11614)
* Add support for AllowedUntrustedInternalConnections to be comma-separated

* Add comprehensive test cases for fields splitting function
2019-07-17 10:04:09 -04:00
Puneeth Reddy
ec95793b90 MM-15276: Migrate Team.Update to sync by default (#10693)
* MM-15276: Migrate Team.Update to sync by default

* MM-15276: Addressing review comments and change Update func signature similar to other interface Update method

* update store mocks for update fn

* addressing review comments
2019-04-25 15:29:02 +02:00
Daniel Schalla
7ac5715a02
[MM-14333] Stricten external HTTP Calls to require that own IPs need to be explicitly whitelisted (#10375)
* Stricten external HTTP Calls to require that own IPs need to be explicitly whitelisted

* gofmt

* Documentation; Style fixes for IsOwnIP function
2019-03-01 16:22:24 +01:00
Sandeep Sukhani
29060acb45 [MM-13828] Initialize tests in each package with a new temp folder with all test resources (#10261)
* [MM-13828] Running tests from a new temp folder with all test resources

Possible fix for #10132

All packages which have a TestMain and use testlib.MainHelper will have a new current working directory which will have all the test
resources copied.

Note: default.json is copied as config.json as well to make sure tests don't have any impact due to changes in config by devs

* [MM-13828] Added TestMain to remaining packages to use testlib.MainHelper

This makes sure tests from all packages run with same test resources, setup in a new temp folder for each package

* Updated Jenkins file to not not config/default.json

This makes sure CI has same config files as a dev's machine

* [MM-13828] Changes requested from code review

Added accessor methods to testlib.MainHelper for accessing members
Fixed some broken tests due to change in cwd while tests run
Some other code refactoring and improvements

* [MM-13828] Added new factory method with options for creating test main helper and some code refactoring

testlib.NewMainHelperWithOptions supports options to turn on/off test dependencies and environment setup
Some other code refactoring

* Exporting members of testlib.MainHelper to make enterprise tests work

* Fixed gofmt error

* [MM-13828] removed unwanted dependency on plugins directory while setting up test resources

* [MM-13828] Fixed some tests failing due to them being running from temp folder

* [MM-13828] Some code changes suggested in PR review

* Fixed gofmt error
2019-02-19 09:20:11 -05:00
Harrison Healey
1a3ccaf305
MM-13606 Remove consumeAndClose and clean up integration response handling (#10066)
* MM-13606 Remove consumeAndClose

* Allow overriding HTTPService's request timeout

* MM-13606 Clean up integration response handling

* Properly close httptest servers

* Address feedback

* Only call buf.Bytes when necessary

* Properly check for errors in doOutgoingWebhookRequest

* Add comment explaining ignored ioutil.ReadAll errors
2019-01-09 17:07:08 -05:00
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
Andreas Linz
cf9b9802a8 Set a proper HTTP user-agent header (#9482)
Previously, mattermost-server would always request with the default
user-agent of Go's net/http package that is `Go-http-client/1.1` or
something similar.
This has several disadvantages, one is that the default user-agent
made it pretty hard to distinguish mattermost requests from other
service requests in a network log for example.

Now a user-agent of the form `mattermost-<current-version>` is set in
the client.

- [x] Added or updated unit tests (required for all new features)
2018-10-03 10:28:44 -07:00
Harrison Healey
4e59a27293
Move HTTPService and ConfigService into services package (#9422)
* Move HTTPService and ConfigService into utils package

* Re-add StaticConfigService

* Move config and http services into their own packages
2018-09-26 12:42:51 -04:00