Commit Graph

19 Commits

Author SHA1 Message Date
Nikhil Ranjan
995a545411 Convert app/export_test.go t.Fatal calls into assert/require calls (#12184) 2019-09-13 11:51:46 +02:00
Eli Yukelzon
89a79e2e9f MM-17224 - Bulk export fails due to missing user (#11738)
* don't fail on deleted users

* test

* logging

* more fine grained error checking
2019-08-01 09:19:37 -03:00
Rodrigo Villablanca Vásquez
1e05d37290 Migrates Channel.GetAllDirectChannelsForExportAfter to sync by default (#11272) 2019-06-20 11:01:49 -04:00
Rodrigo Villablanca Vásquez
9fa1622fc3 Fix #10963: GetDirectPostParentsForExportAfter is sync now (#11009) 2019-05-30 23:19:14 +02:00
Ishank Gulati
3b25e09b99 [GH-10866] Preferrence.Save - Remove preference length return arg (#10962) 2019-05-29 09:54:56 -04:00
Ishank Gulati
fb6c1debf0 [MM-15296] Migrate "Preference.Save" to Sync by default (#10866)
* response format changes

* Generated mocks
Fixed all references of Preferences.Save

* Remove old code from store.go (incorrect merge)

* Review change - Add validations on count and error

* Review change - return from root level

* Review change - return 0 as nil value for int

* fix initialisation of err in preference_store
2019-05-26 15:06:33 +02:00
Fernando Correa Neto
02bd35247b [MM-14779] Investigate flaky TestExportGMandDMChannels (#10534)
* fix flaky test by sorting by Type and also change helper to increase
precision in CreateAt

* better strategy is to get a smaller number

* user nanonseconds as milisenconds proved to be a bit problematic for
unit tests

* revert changes in helper function and create posts in a more controled way

* use the original value

* make post instantiation more clear
2019-04-09 09:47:41 -04:00
Fernando Correa Neto
9abd4dd7dc [MM 12464] Include DM/GM Channels and Their Posts in the Bulk Export (#10421)
* transplant the existing PR into the working tree

* start addressing review comments

* move existing direct channel export code into this branch

* modify channel exporter to use squirell and populate members in two steps

* use squirrel to build sql queries for channel and dm/gm export methods

* remove debug helpers and use Username instead of UserId

* unit test for DM Channel exporter

* add more unit tests for channel export

* add test for DM/GM post export

* checkpoint with failing test for postgres

* use getQueryBuilder to make sure squirrel uses the correct formatting
for each database

* add a test for post export

* fix shadowed vars that broke the build

* address review comments and add tests to support it

* address review comments and add a mlog call

* s/Info/Debug/

* address review comments in post_store

* address review comments in channel_store

* address review comments in export

* address review comment in post_store: drop GroupBy

* address review comment on supplier: move getQueryBuilder to sqlstore

* address review comments: explicit TearDown

* address review comments: improve test coverage

* address review comments: make sure public and private channels are excluded

* address review comments: improve test coverage

* address review comments: make sure Channels table gets truncated after
each test

* more cleanups and better assertions

* wrap PostStore in a StoreTestWithSqlSupplier

* last minute changes: improve post export test coverage and check members

* address review comments: make sure all posts have their channel
members set

* address review comments: make sure all posts have their ChannelMembers
exported correctly

* gofmt fix

* sort channels so it's possible to assert on index
2019-03-15 16:28:43 +01:00
Sandeep Sukhani
7f9e1273d7 [MM-12667] Allow including deactivated users in bulk import and export (#10353)
* [MM-12667] Allow including deactivated users in bulk import and export

1. Added `deleteAt` for user type import line
2. Adding deactivated users data in bulk export
3. Importing deactivated users data in bulk import

Added/Updated relevant test cases

* Fixed export of replies to posts by deleted users.
Updated tests for same
2019-03-01 15:50:24 +00:00
Shreyansh Chouhan
39ceaa3e86 [MM-13833] Configured unit tests to log through t.Log (#10272)
* Rerouted the unit test logs through t.Log

* resolving merge confilvts

* Update testing.go

* Update helper_test.go

* Added godocs for NewTestingLogger

* Added go docs for NewTestingLogger

* Resolving conflicts
2019-02-14 13:52:11 -04:00
Simone Salsi
0f35c4b24d [MM 12458] Include user preferences in bulk export (#9784)
* First version of the preference exporter

* First working version of the preference export

* Removed useless debug line

* Added special case of empty string to harverst the omitempty feature

* Removed dangling line from rebase

* Moved exportablepreference in scope

* Fix go vet issue

* Fix formating

* Add simple test

* Add full test for BulkExportUsers

* Improve variable naming
2019-02-01 11:43:41 +00:00
Jesse Hallam
66d174d80b Fix various unit tests (#10079)
* fix spurious TestMuteCommandSpecificChannel test failure

See
https://community-daily.mattermost.com/core/pl/px9p8s3dzbg1pf3ddrm5cr36uw

* fix race in TestExportUserChannels

* TestExportUserChannels: remove SaveMember call, as it is redundant and used to be silently failing anyway
2019-01-09 14:01:24 -05:00
Jesús Espino
febc5115fd MM-13220: Fixes for bulk export problems (#9980)
* MM-13220: Fixes for bulk export problems

* fixing tests
2018-12-12 14:20:22 +01:00
Jesse Hallam
8374b6221e unittest using externally managed database (#9400)
* MM-12083: unittest using externally managed database

* cherry-pick Makefile changes from @cpanato

* Jenkins changes (#9915)

* add docker compose

* udpate

* when using minio dont need to set the region

* update

* add wait for it script

* using old minio

* add new jenkins file

* update makefile

* add dockerfile

* rename the docker-compose proj to avoid colision (#9917)

* rename the docker-compose proj to avoid colision

* enable debug

* enable debug to double checkt the branchs and fix docker-compose name (#9919)

* add ee hash to check (#9920)

* fix name (#9921)

* update jenkins file to push from branch and prs

* if a new push comes in stop the running build

* split mysql and postgres variables

* add script to run jenkins-like env in local dev env

* update docker-compose project name to use uuid to make it more randon

* fix DCNAME definition

* update elasticsearch docker image

* revert test

* tidy up stages, and wait for mysql differently

* update docker image and add check for postgres

* checking if is ready

* update docker compose to have a wait for deps

* add readme and rename dockerfile

* fix -unittest setup

* using mm docker image

* restore parallel unit tests at the package level

Spin up a dedicated database for each package under test to avoid races in accessing the same tables.
Simplify the interface for configuring the test database to just a DSN instead of multiple exports for each field.

* try to work around root mysql access in CI

* update local-test-env.sh too

* MYSQL_ROOT_HOST: %

* fix missing quotes

* setting some memory limits for mysql

* revert memory docker compose does not support

* fix env name for postgres

* expose errors in app/export_test.go

* fix test label, better error checking on teardown

* increase query timeout for tests

* fix export_test

* update local dev script

* add configurable mysql root passwd
2018-12-10 17:58:09 +01:00
Wasim Thabraze
246ff89391 MM-12463 : Added capability to bulk export custom emojis (#9790) 2018-11-19 14:43:31 +00:00
Shobhit Gupta
bce7a7c73d [MM-12462] Include favorite channels in bulk export (#9692)
* Include favorite channels in bulk export

* Remove duplicate method
2018-11-05 13:18:00 +00:00
Shobhit Gupta
2e945e287d [MM-12461] Include the per-channel NotifyProps for Users in Bulk Export (#9773)
* Add per channel notify props to bulk export

* Check if key exists before assigning
2018-10-31 11:43:47 -07:00
Vadim
54b7a29581 MM-12459 Include User Notify Props in the Bulk Export (#9724) 2018-10-24 07:34:43 -07:00
Wasim Thabraze
7562f940bb [MM-12465] Added capability to export reactions of posts during bulk export (#9600)
* Added capability to export reactions of posts

* Added capability to export reactions of replies of a post

* Added test case to test the reactions of a post
2018-10-17 14:23:10 +01:00