Commit Graph

46 Commits

Author SHA1 Message Date
Jesse Hallam
a78913178c Ensure unittest isolation (#9819)
* api4: fix TestGetUsersNotInTeam assertions

This test was relying on data from a previous test run. With the data cleared before each test, the assertions much match reality.

* *testlib: always InitSystemAdmin

Some tests implicitly relied on the basic user having system
administrator privileges because it was the first user created as such.
Eliminate `InitSystemAdmin` and explicitly create the system admin user
instead to avoid this ambiguity going forward.

* *testlib: drop all tables before each test

* api4: split up TestChannelDelete to avoid duplicate InitBasic

* api4: teardown in TestResetPassword, for when this test comes back

* invalidate cache on DropAllTables

This is necessary since the test store persists across tests.

* disable parallel tests

While tests within a package must be explicitly parallelized using `t.Parallel()`, tests across packages are run in parallel by default.  This causes problems given that the tests all currently share the same database instance.

Unfortunately, this also means that running the tests is much slower, but we can return to this later.
2018-11-20 20:16:25 -05:00
Harrison Healey
159c2a44dc MM-10987 Turn on ExperimentalLimitClientConfig by default and remove setting (#9696) 2018-10-24 11:52:53 +01:00
Jesse Haka
3e462713de if EnableLinkPreviews not enabled, do not call url (#9461) 2018-10-02 08:00:50 +02:00
Martin Kraft
ed0fb617ef MM-11786: Adds API endpoint to retrieve redirect locations. (#9284) 2018-08-24 08:49:31 -04:00
Jesse Hallam
d8c8a19d35 avoid t.Fatal() in tests (#9189)
I've been burned a few times by tests that simply fatal, requiring me to
run another build to learn more about what the mismatch was. Avoid this.

This is part of a long running goal of mine to make testing "better".
2018-08-09 11:26:38 +02:00
Jesús Espino
344836dfb2 Add missed translations (#8959) 2018-06-19 19:40:26 +02:00
Harrison Healey
6d8140337e MM-8701 Limit the number of client config fields sent before user logs in (#8954)
* MM-8701 Limit the number of client config fields sent before user logs in

* Fixed missing client config field

* Reduced duplication between limited and regular client config
2018-06-18 12:39:22 -04:00
Carlos Tadeu Panato Junior
db6b8f6238 fix test and add new (#8759) 2018-05-10 17:56:11 +08:00
Christopher Speller
454c113b4e Removing bad test. 2018-05-09 18:03:28 -07:00
Joram Wilander
d6537deb3d Add inactive user count to analytics and fix client analytics function (#8695) 2018-05-02 07:50:56 -07:00
Christopher Speller
686c2fbab7 Structured logging (#8673)
* Implementing structured logging

* Changes to en.json to allow refactor to run.

* Fixing global logger

* Structured logger initalization.

* Add caller.

* Do some log redirection.

* Auto refactor

* Cleaning up l4g reference and removing dependancy.

* Removing junk.

* Copyright headers.

* Fixing tests

* Revert "Changes to en.json to allow refactor to run."

This reverts commit fd8249e99b.

* Fixing some auto refactor strangeness and typo.

* Making keys more human readable.
2018-04-27 12:49:45 -07:00
Corey Hulen
2acbc77d78 MM-10375 Fixing connected socket count (#8682)
* Fixing connected socket count

* Adding unit test
2018-04-27 10:38:40 -07:00
Harrison Healey
0a6b96cb40 MM-9849 Added tracking of which settings are set through environment variables (#8586)
* MM-9849 Added tracking of which settings are set through environment variables

* Removed old version of viper

* Added forked version of viper

* Fixed unit tests

* Fixed more unit tests

* Removed copy from App.GetEnvironmentConfig
2018-04-09 18:16:11 +02:00
Chris Duarte
74e703f58d Timezone feature (#8185)
* Add supported timezones into config

Remove Timezone list creation in favor of timezone from configs

Add Timezone field to Users table

Clean up format of SupportedTimezones in config

* Remove unwanted change

* Add test for updating user timezone

* Add empty map[string]string if Timezone is null

* Add EnableTimezoneSelection config

* Revert back to map[string]string for ClientConfig

* Refactor SupportedTimezones into timezones.json

* Include timezones.json in TestConfigFlag

* Add timezone api endpoint

* Bump varchar size to 256 and setMaxSize in user_store

* Refactor LoadConfig to LoadConfig and LoadTimezoneConfig

* Remove unnecessary argument in LoadConfig, mail_test

* Add test for timezone endpoint

* Add license header

* Refactor timezones endpoint to system.go

* Add system base route to timezone endpoint

* db timezone upgrade in db v4.9

* Avoid saving SupportedTimezones to config.json

* Add timezonePath support in config

* Remove EnableTimezoneSelection from config

* Use return statement without return parameter

* Refactor test for SupportedTimezones

* Check for supportedTimezone != nil instead of using len

* Decouple SupportedTimezones out of Config

* Fix failing test

* Add LastTeamIconUpdate back in upgrade.go

* Write timezone config in config_flag_test

* Add code fallback for default timezone support
2018-03-22 09:53:43 -04:00
Carlos Tadeu Panato Junior
db4402c40d remove s3 region to be mandatory and fix when user call test s3 when the config is saved (#8454) 2018-03-14 00:26:56 +08:00
Carlos Tadeu Panato Junior
1b29b50330 update email test in the driver to be able to send the config in the body (#8453)
Signed-off-by: cpanato <ctadeu@gmail.com>
2018-03-13 10:42:56 -05:00
Carlos Tadeu Panato Junior
6e024c45b5 [PLT-8186] add support for ec2 instance profile authentication (#8243) 2018-02-28 23:12:11 +00:00
Joram Wilander
5c560db810 ABC-176 Prevent changing PluginSettings.EnableUploads through the API (#8249)
* Prevent changing PluginSettings.EnableUploads through the API

* Contain api4 test case in it's own test
2018-02-13 11:08:49 -05:00
Yusuke Nemoto
ddd99f7476 PLT-6896 per-paging for logs (#7903)
* PLT-6896 Read logs from last

* Getting rid of file.Stats

* remove deprecated value

* Make non-reassigned value constant
2017-12-13 13:04:55 -06:00
Chris
c5e8cb25ca simplify things (#7735) 2017-10-30 11:57:24 -05:00
Joram Wilander
9d9c737414 Update v4 POST log endpoint to match v3 permissions (#7653) 2017-10-20 17:26:12 -07:00
Chris
8e19ba029f Reduce utils.Cfg references (#7650)
* app.UpdateConfig method

* test fix

* another test fix

* the config override option as-was is just error prone, remove it for now

* derp
2017-10-18 15:36:43 -07:00
Chris
07777f5ff9 Fix races / finally remove global app for good (#7570)
* finally remove global app for good

* test compilation fixes

* fix races

* fix deadlock

* wake up write pump so it doesn't take forever to clean up
2017-10-04 13:09:41 -07:00
Chris
9bc7af0c57 Don't use global app for api / api4 tests (#7528)
* don't use global app for api / api4 tests

* put sleep back. we're gonna have to do some goroutine wrangling

* fix oauth test config assumptions

* jobs package, i'm comin' for you next

* app test fix

* try increasing sleep a little
2017-10-02 09:50:56 +01:00
Chris
ac74066f0e remove einterface gets (#7455) 2017-09-19 18:31:35 -05:00
Christopher Speller
29fca51821 Renaming repo 2017-09-06 23:11:59 -07:00
George Goldberg
e85b5fb988 App: NewLocAppError -> NewAppError (#7327)
* App: NewLocAppError -> NewAppError

* Remove statuscode that got missed.
2017-09-01 11:42:02 -04:00
Saturnino Abril
651dd33b29 set to default value with config is missing (#7320) 2017-08-30 13:54:16 -04:00
Corey Hulen
b5d2c12d22 Setting per-paging for logs to load 10K initially like the old apis (#6697)
* Setting per-paging for logs to load 10K initially like the old apis

* Fixing unit test
2017-06-20 13:13:02 -07:00
Joram Wilander
5627f3fd1d Add GET /analytics/old endpoint for v4 (#6666) 2017-06-19 16:35:53 -04:00
Joram Wilander
1d66e64e54 Add POST and DELETE /license endpoints for v4 (#6665)
* Add POST and DELETE /license endpoints for v4

* Fix comment text
2017-06-19 10:46:51 -07:00
Carlos Tadeu Panato Junior
ddc996f33f [PLT-5465/APIV4] GET /system/health - Improve ping health check to have limits (#6331)
* implement PLT-5465 - Improve ping health check to have limits

* update /ping and delete /health

* remove permission check
2017-05-30 21:47:27 -07:00
Christopher Speller
010ec23af3 Removing password reset salt (#6334) 2017-05-04 16:36:51 -04:00
George Goldberg
597641545d PLT-6355: Use separate Read Replicas for Search. (#6216) 2017-05-01 00:19:58 -04:00
Joram Wilander
5a60ea0d75 PLT-6268 Clear blue bar correctly when removing expiring license (#6247)
* Don't sanitize license for system admin

* Clear blue bar error whe removing expiring license

* Fix unit test
2017-04-27 07:57:58 -07:00
Carlos Tadeu Panato Junior
b57b5abce8 implement POST /logs for apiV4 (#6143) 2017-04-21 10:16:35 +01:00
Joram Wilander
a0d5c01dfd Implement client config/license endpoints for APIv4 (#5867) 2017-03-27 09:19:53 -04:00
Joram Wilander
fd6e2f3f73 Implement GET /audits endpoint for APIv4 (#5779)
* Implement GET /audits endpoint for APIv4

* Fix log unit test
2017-03-21 09:06:08 -04:00
Carlos Tadeu Panato Junior
ac8282cda1 Add updateConfig endpoint for apiV4 (#5706) 2017-03-20 12:37:34 +00:00
Joram Wilander
0bc3e46082 Implement GET /logs endpoint for APIv4 (#5778) 2017-03-16 11:59:44 -07:00
Carlos Tadeu Panato Junior
fa47132b8f [APIV4] POST /caches/invalidate - endpoint for apiV4 (#5756) 2017-03-14 16:06:07 +00:00
Carlos Tadeu Panato Junior
d03367c560 Add implementation for POST /config/reload apiV4 - Reload Configuration (#5713) 2017-03-14 08:52:27 -04:00
Carlos Tadeu Panato Junior
27d2c1f6fe Add implementation for POST /database/recycle apiV4 - Recycle database connection (#5717) 2017-03-13 15:47:33 +00:00
Carlos Tadeu Panato Junior
38958d9ac4 Add implementation for POST /email/test apiV4 - Send Test Email (#5716) 2017-03-13 15:09:00 +00:00
Carlos Tadeu Panato Junior
c372ceebf8 [APIV4] GET /config - getConfig endpoint for apiV4 (#5701) 2017-03-13 12:27:27 +00:00
Robin Naundorf
48b785aded Add APIv4 /system/ping endpoint (#5443) 2017-02-17 10:57:19 +00:00