Commit Graph

9 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
George Goldberg
516a097e1a MM-10757: Default roles from scheme should be keyed by name not ID. (#8894)
* MM-10757: Default roles from scheme should be keyed by name not ID.

* Update permissions import/export.
2018-06-01 12:49:02 +01:00
Martin Kraft
eb78d273f3 Refactors migrations check. (#8814) 2018-05-21 12:10:26 +02:00
Martin Kraft
e0390632b3 MM-10264: Adds CLI command to import and export permissions. (#8787)
* MM-10264: Adds CLI command to import and export permissions.

* MM-10264: Changes Scheme Name to DisplayName and adds Name slug field.

* MM-10264: Changes display name max size.

* MM-10264: Another merge fix.

* MM-10264: Changes for more Schemes methods checking for migration.

* MM-10264: More updates for Schemes migration checking.
2018-05-17 11:37:00 -04:00
George Goldberg
463065c8ba MM-10606: License feature flag for custom schemes. (#8804)
* MM-10606: Add new field to license for custom schemes.

* Add feature flag to license check for Schemes.
2018-05-17 16:29:31 +01:00
George Goldberg
319d61123a MM-10615: Reset teams/channels to default scheme on delete scheme. (#8811) 2018-05-17 12:48:31 +01:00
George Goldberg
c2ab85e0a3 MM-10591: Well known error for all scheme endpoints pre-migration. (#8812) 2018-05-17 12:48:18 +01:00
George Goldberg
51bd710ecd MM-9728: Online migration for advanced permissions phase 2 (#8744)
* MM-9728: Online migration for advanced permissions phase 2

* Add unit tests for new store functions.

* Move migration specific code to own file.

* Add migration state function test.

* Style fixes.

* Add i18n strings.

* Fix mocks.

* Add TestMain to migrations package tests.

* Fix typo.

* Fix review comments.

* Fix up the "Check if migration is done" check to actually work.
2018-05-14 15:59:04 +01:00
George Goldberg
60cf74352f MM-10140: API Implementation for Schemes related Endpoints (#8615)
* Implement basic scheme CRUD endpoints.

* Get All Schemes (Paged) Endpoint and store plumbing.

* Add get teams/channels for schemes.

* Fix unit tests.

* Review fixes.

* More review fixes.
2018-05-03 09:00:26 -04:00