mattermost/utils/jsonutils
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
..
json.go MM-10232, MM-10259: Improve error handling from invalid json (#8668) 2018-04-26 11:19:25 -04:00
json_test.go add megacheck as makefile target (#9288) 2018-09-03 14:08:40 +02: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