mattermost/utils
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
..
fileutils [MM-13828] Initialize tests in each package with a new temp folder with all test resources (#10261) 2019-02-19 09:20:11 -05:00
jsonutils [MM-13828] Initialize tests in each package with a new temp folder with all test resources (#10261) 2019-02-19 09:20:11 -05:00
markdown [MM-13828] Initialize tests in each package with a new temp folder with all test resources (#10261) 2019-02-19 09:20:11 -05:00
testutils Cleanup related to context refactor (#9988) 2018-12-17 08:51:46 -08:00
api.go If no origin header is set for WebSocket, do not fail upgrade (#9287) 2018-08-24 11:09:48 +01:00
api_test.go MM-10370: serve subpath (#8968) 2018-06-21 11:31:51 -07:00
authorization.go MM-12815: Clearly deprecated disused config settings. (#9751) 2018-10-31 08:38:38 +00:00
authorization_test.go MM-12815: Clearly deprecated disused config settings. (#9751) 2018-10-31 08:38:38 +00:00
emoji.go simplify things (#7735) 2017-10-30 11:57:24 -05:00
extract.go simplify things (#7735) 2017-10-30 11:57:24 -05:00
file.go PLT-8314: Test Message Export Against S3 Bucket (#7957) 2017-12-07 15:56:14 -05:00
file_test.go Reorganize file util functionality (#7848) 2017-11-16 16:04:27 -05:00
hash.go Creating common token store and moving email invites and verification to it (#6213) 2017-04-27 10:55:03 -04:00
html.go Cleanup related to context refactor (#9988) 2018-12-17 08:51:46 -08:00
html_test.go Break HTML blocks to individual strings (#8903) 2018-07-20 12:52:20 -04:00
i18n.go Cleanup related to context refactor (#9988) 2018-12-17 08:51:46 -08:00
license.go Ldap groups phase1 (#9752) 2019-01-10 15:17:31 -05:00
license_test.go Cleanup related to context refactor (#9988) 2018-12-17 08:51:46 -08:00
logger.go MM-13893: refactor config (#10230) 2019-02-12 08:37:54 -05:00
lru.go Fix shadowed variables in various places: Part 2 of 2 (#10176) 2019-01-28 21:57:45 +01:00
lru_test.go MM-10856: deduplicate posts with the same pending post id (#10006) 2018-12-17 15:16:57 -08:00
main_test.go [MM-13828] Initialize tests in each package with a new temp folder with all test resources (#10261) 2019-02-19 09:20:11 -05:00
password.go Refactor password validation and config defaults (#7859) 2017-11-20 11:04:04 -06:00
password_test.go Refactor password validation and config defaults (#7859) 2017-11-20 11:04:04 -06:00
path.go Implement experimental REST API endpoints for plugins (#7279) 2017-09-01 09:00:27 -04:00
path_test.go Implement experimental REST API endpoints for plugins (#7279) 2017-09-01 09:00:27 -04:00
policies-roles-mapping.json MM-9618: Don't change default role permissions for policy. (#8303) 2018-02-19 10:16:45 +00:00
random.go PLT-5860 Updated copyright date (#6058) 2017-04-12 08:27:57 -04:00
subpath.go MM-14052: fix subpath yet again (#10278) 2019-02-13 11:30:02 -04:00
subpath_test.go MM-14052: fix subpath yet again (#10278) 2019-02-13 11:30:02 -04:00
textgeneration.go Renaming repo 2017-09-06 23:11:59 -07:00
time.go add missing license headers, test to makefile (#7711) 2017-10-25 09:33:19 -07:00
time_test.go PLT-5860 Updated copyright date (#6058) 2017-04-12 08:27:57 -04:00
urlencode.go PLT-5860 Updated copyright date (#6058) 2017-04-12 08:27:57 -04:00
urlencode_test.go PLT-5860 Updated copyright date (#6058) 2017-04-12 08:27:57 -04:00
utils.go Cleanup related to context refactor (#9988) 2018-12-17 08:51:46 -08:00
utils_test.go PLT-7519: Better rate-limiting. (#7365) 2017-09-05 15:34:17 -04:00