th.InitBasic initializes users, channels, and teams. But a lot of
tests don't use it at all, causing unncessary delays. A single InitBasic
call takes around 400ms. This PR removes 71 of them, approximately shaving
off 28 seconds. Arguably, this would be more because some tests run in loops.
* MM-22706: pass along set_online flag in websocket response
To let the client know whether a user has created a post without
being online or not, we get the set_online query param and
pass it down to the websocket event being passed down to the client.
With this PR, the "data" field of the `posted` event will contain
a `set_online` boolean field set to true/false depending on the
query_param set_online value set in the createPost call.
* Setting to false for auto responder
Co-authored-by: mattermod <mattermod@users.noreply.github.com>
* add support for exporting and importing props
* merge master
* add export test for post props
* add check if postData exists
* add import tests for post props
* fix ci bot issues
Co-Authored-By: Bot from GolangCI <42910462+golangcibot@users.noreply.github.com>
* fix gofmt errors
* remove test comment and add name instead
* remove uneccessary changes
Co-authored-by: Bot from GolangCI <42910462+golangcibot@users.noreply.github.com>
* Introducing unit (not integration) tests for the app layer
* Initial support for unit tests at the API
* Adding unit tests support to the store layer
* Add unit tests support in commands
* Adding last tests needed for run unit tests properly
* Fixing govet
* Removing some duplication
* Fixing tests
* Fixing tests
* Not compiling test helpers with the main module for api
* Revert "Not compiling test helpers with the main module for api"
This reverts commit 36a199bbe0.
* Fixing tests
* Fixing unit tests
* More consistency between api4/apiteslib.go and app/helper_test.go
* Renaming things to make more obvious the new Setup functions purpose
* Reverting change in go.sum
* Start with empty mock for app layer
* Start with empty mock for api layer
* Start with empty mock for web layer
* Renaming SetupWithStoreMockConfig to SetupConfigWithStoreMock
* Fixing tests on web package
* Removing unnecesary function
* Test added to check support for import of messages sent to your own DM
channel
* Support for single member direct channel messages and posts
Now bulk import is able to export/import the self direct channel and
the posts inside
* Improve how the copy of channel members for DM and DM posts
* Improved the tests for the export self-channels
* Consistent license message for all the go files
* Fixing the last set of unconsistencies with the license headers
* Addressing PR review comments
* Fixing busy.go and busy_test.go license header
* 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
* 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
* 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
* [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
* 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
* 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
* 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
* 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