Commit Graph

210 Commits

Author SHA1 Message Date
Jesse Hallam
136d8ca5c4 Various unit test related improvements (#9865)
* api4: improved error handling

* system_store: more logs

* integrate go-junit-report into test-te/test-ee

* add CI_MINIO_HOST and CI_INBUCKET_HOST instead of CI_HOST

* comment re: minio configuration issue

* fix TestStartServerPortUnavailable to pass even when root can bind to :21

* skip TestFindManifest_FolderPermission while running as root
2018-11-28 09:05:39 -05:00
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
Harshil Sharma
af275fe924 #MM-12130 changes for custom service terms (#9450)
* #MM-12130 changes for custom service terms

* Fixed styling

* Added getServiceTerms API

* removed unnecessary panic

* removed custom service terms text from flat config

* reverted user sql store as those changes are no longer needed

* added tests

* Updated a config key to be more standard

* Added copyright info

* Loading service terms only if the feature is enabled

* Loading service terms only if the feature is enabled

* removed unused index

* added createservice termns API

* made a param to bool instead of string

* added createservice termns API

* review fixes

* fixed styling

* Minor refactoring

* removed saveConfig and loadConfig magic

* added empty service terms text check to createServiceTerms API

* refactoed some urls to be terms_of_service instead of service_terms

* removed check for support settings

* changed URLs in tests

* removed unused code

* fixed a bug

* added service termd id in conif

* fixed a test

* review fixes

* minor fixes

* Fixed TestCreateServiceTerms
2018-09-26 16:49:22 -04:00
Jesús Espino
a08df883b4 Move file backend to its own service (#9435)
* Move file backend to its own service

* Moving utils/inbucket to mailservice package
2018-09-20 10:07:03 -07:00
Daniel Schalla
531897b1f0 add megacheck as makefile target (#9288)
Fix code issues in channel_test.go

Fix Channel Test Issues detected by Megacheck

Fix API Emoji Test Issues detected by Megacheck

Fixed API Issues Reported by Megacheck

Fixed App issues reported by megacheck

Remaining fixes

removed test added by mistake from old HEAD

gofmt

Store Fixes

simplified returns

Fix test for multi member channel delete

revert to delete unused function
2018-09-03 14:08:40 +02:00
Jesús Espino
3cf7fcdbfb Add debug-server task to make file to run mattermost using delve (#9290) 2018-08-27 13:56:31 +02:00
Jesús Espino
54846fdad2 Update mockery before generate mocks (#9250) 2018-08-14 12:10:57 -04:00
Christopher Speller
5a2d46c6cb MM-11028 Adding some plugin tests. (#9103)
* Rearranging plugin mocks and moving some common test code out.

* Adding tests.

* Fixing tests after GoDoc cleanup changes.
2018-07-18 16:35:12 -07:00
Carlos Tadeu Panato Junior
940d0bbbc2 add pre-package plugins to the MM package (#9114) 2018-07-16 17:02:13 +02:00
Christopher Speller
4c1ddcff10 MM-10703 Adding blank request context to plugin hooks for future use. (#9043)
* Adding blank request context to plugin hooks for future use.

* Rename RequestContext to Context

* Adding context to ServeHTTP and ExecuteCommand

* Fixing import cycle in test.
2018-07-06 09:07:09 -04:00
Christopher Speller
1e5c432e10 MM-10702 Moving plugins to use hashicorp go-plugin. (#8978)
* Moving plugins to use hashicorp go-plugin.

* Tweaks from feedback.
2018-06-25 12:33:13 -07:00
Carlos Tadeu Panato Junior
7df3498947 use minio release instead of latest (#8917) 2018-06-06 09:08:14 -04:00
Jesse Hallam
e591fcf3d8 fix make run-server (#8819)
* fix `make run-server`

The `PLATFORM_FILES` environment variable no longer gives `go run` the
necessary context to run the mattermost binary.

* clean up cmd/mattermost/cprofile*.out
2018-05-17 19:24:49 -07:00
Christopher Speller
11cbb59747 Renaming platform binary to mattermost. (#8801) 2018-05-17 12:40:40 -07:00
Joram Wilander
1f6c271b3b MM-8708 Remove api package (#8784)
* Remove api package

* Remove api dependency from cmd package

* Remove EnableAPIv3 setting

* Update web tests

* Add more websocket tests

* Move some ws and oauth tests to api4 package

* Move command tests into api4 package

* Test fixes

* Fix msg command test

* Add some app file tests
2018-05-16 13:43:22 -04:00
Christopher Speller
df6a7f8b19 MM-10249 Adding plugin ability to intercept posts before they reach the DB. (#8791)
* Adding plugin ability to intercept posts before they reach the DB.

* s/envoked/invoked/
2018-05-15 13:33:47 -07:00
Christopher Speller
d8dd271e43 MM-4998 Adding LoginIdAttribute to allow LDAP users to change their login ID without losing their account (#8756)
* Adding LoginIdAttribute

* Modifying LDAP to use loginIDAttribute.

* Adding IDAttribute migration and AD objectGUID support.

* Removing unused idea.

* Fix typo.
2018-05-10 09:46:09 -07:00
Jonathan Villemaire-Krajden
6c3d1fc1f8 Fix empty GOPATH behaviour in Makefile (#8724) 2018-05-07 07:04:09 -07:00
Christopher Speller
80925f7cfd Fixing unit tests for Go 1.10 (#8568) 2018-04-03 15:41:02 -04:00
Christopher Speller
26b523e4a1 Revert "add individual platform packaging targets (#8366)" (#8537)
This reverts commit f0f4f68def.
2018-03-28 14:54:58 -07:00
Jesús Espino
a8e0fc6c5d Changing the user-0 data to sysadmin and user-1 username to user-1 (#8494) 2018-03-23 15:32:10 -04:00
Carlos Tadeu Panato Junior
46fea093c8 using inbucket docker image tag release-1.2.0 instead of latest (#8406) 2018-03-12 07:39:06 -04:00
Jesús Espino
b2dd00dd5b Adding enterprise commands support (#8327) 2018-03-07 20:04:18 +00:00
Chris
f0f4f68def add individual platform packaging targets (#8366) 2018-02-26 02:48:56 -05:00
Chris
7e8106b95c use mattermost fork of go-bindata (#8216) 2018-02-08 19:43:27 -05:00
Jesús Espino
963176ab2a Don't remove data dirs from vendor directory (#8173) 2018-01-31 16:33:33 -08:00
Corey Hulen
629bdb314e Adding sample data to the make file (#8171)
* Adding sample data to the make file

* Adding regular acct message
2018-01-31 16:32:18 -08:00
Derrick Anderson
d45d8a16b3 prereq check (#8151) 2018-01-25 08:40:29 -05:00
Martin Kraft
e561f727c8 Updates 'make help'. (#7982)
* Updates 'make help'.

* Updates description of all.
2017-12-20 14:49:45 -05:00
Joram Wilander
150de584c3 PLT-8131 Bundled zoom plugin (#7947)
* Bundled zoom plugin

* Update plugin to latest
2017-12-05 16:35:46 -05:00
Jonathan
154a502f8e Adding more temp files to Stopping docker containers (#7916)
* Adding more temp files to Stopping docker containers
* Removed unnecessary deletes
2017-12-05 11:03:19 -05:00
Martin Kraft
8701479e1a Adds dev db for postgres so that one doesn't need to make it manually. (#7924) 2017-11-30 13:41:03 -08:00
Chris
daebd26a28 PLT-8018: Bundled jira plugin (#7920)
* bundled jira plugin

* fix generated file formatting, add prepackaged key

* whoops, uploaded wrong file

* whitelist generated files for license check

* make it work for people without go/bin in their path
2017-11-30 14:55:44 -06:00
Chris
1c92ad0afb fix ee make targets (#7828) 2017-11-14 13:13:31 -06:00
Chris
865f9f83a7 Improve test coverage reporting / accuracy (#7819)
* improve test coverage reporting / accuracy

* handle absolute coverpaths

* move tests into multiple files

* rename codecov.yml (https://github.com/codecov/support/issues/426)
2017-11-13 11:59:51 -08:00
Christopher Speller
1329aa51b6 Updating server dependancies. (#7816) 2017-11-13 09:09:58 -08:00
Martin Kraft
91544f0c6d Fixes running webapp from custom location using ENV variable. (#7809) 2017-11-10 15:25:05 -05:00
Christopher Speller
59fe809909 Adding ldap Makefile tool to add local LDAP configuration (#7764) 2017-11-03 08:45:19 -07:00
Jonathan
b446d0aa0a Fixed GOPATH in makefile to prevent make mock-store from rewriting mattermost-server imports (#7743) 2017-10-30 16:37:50 -04:00
Chris
827fbfa87d more robust mockery invocation (#7727) 2017-10-26 15:06:18 -05:00
Chris
6f6005c617 Store mocks (#7724)
* store mocks

* add example
2017-10-26 11:36:54 -05:00
Chris
5dd4466ab3 add missing license headers, test to makefile (#7711) 2017-10-25 09:33:19 -07:00
Chris
34285d8cca parallel tests (#7629) 2017-10-16 11:09:43 -04:00
Chris
917e4789c2 Use tmpfs containers for api/api4 tests, move and speed up CLI tests (#7606)
* use tmpfs containers for api/api4, move and speed up cli tests

* minor optimizations

* add missing files, fix pre-existing race condition

* add . to TestMain check

* add requested log message
2017-10-12 12:24:54 -07:00
Chris
785cc06f6e Make test execution not take quadratic compilation time (#7610)
* make test execution not take quadratic compilation time

* add -p flag. we can only test one package at a time (for now)

* cd to mattermost-server for enterprise

* whoops

* let's go ahead and make the coverage profiles ready for concurrent test
2017-10-12 08:35:19 -07:00
Chris
0f66b6e726 store/sqlstore cleanup and postgres tests (#7595)
* sqlstore cleanup / postgres tests

* remove stopped containers

* cmd/platform compile fix

* remove test-postgres target from makefile
2017-10-09 13:16:14 -04:00
Christopher Speller
b84736e9b6 Updating server dependancies. (#7538) 2017-09-29 12:46:30 -07:00
Jonathan
1bf2a2e8d5 PLT-7641: Cleanup the jsonl files from make test (#7466)
* Disabled automatic log rotation to avoid multiple log file creation, added mattermost.log.jsonl files to gitignore

* Added log file delete to make clean
2017-09-25 15:02:41 -04:00
Chris
49fe5fbf3d Move sql store code into store/sqlstore package (#7502)
* move sql store code into store/sqlstore package

* move non-sql constants back up to store

* fix api test

* derp
2017-09-25 10:11:25 -04:00
George Goldberg
adff8d0105 Fix launching minio container. (#7504) 2017-09-25 08:27:11 -04:00