diff options
-rw-r--r-- | Makefile | 4 | ||||
-rw-r--r-- | api4/command_test.go | 11 | ||||
-rw-r--r-- | api4/file_test.go | 3 |
3 files changed, 16 insertions, 2 deletions
@@ -336,6 +336,7 @@ ifeq ($(BUILD_ENTERPRISE_READY),true) endif test-server-race: test-te-race test-ee-race ## Checks for race conditions. + find . -type d -name data -not -path './vendor/*' | xargs rm -rf do-cover-file: ## Creates the test coverage report file. @echo "mode: count" > cover.out @@ -360,6 +361,7 @@ ifeq ($(BUILD_ENTERPRISE_READY),true) endif test-server: test-te test-ee ## Runs tests. + find . -type d -name data -not -path './vendor/*' | xargs rm -rf internal-test-web-client: ## Runs web client tests. $(GO) run $(GOFLAGS) $(PLATFORM_FILES) test web_client_tests @@ -477,7 +479,7 @@ clean: stop-docker ## Clean up everything except persistant server data. cd $(BUILD_WEBAPP_DIR) && $(MAKE) clean - find . -type d -name data -not -path './vendor/*' | xargs rm -r + find . -type d -name data -not -path './vendor/*' | xargs rm -rf rm -rf logs rm -f mattermost.log diff --git a/api4/command_test.go b/api4/command_test.go index 3be1af061..8c4ce5d50 100644 --- a/api4/command_test.go +++ b/api4/command_test.go @@ -214,6 +214,17 @@ func TestListCommands(t *testing.T) { defer th.TearDown() Client := th.Client + enableCommands := *th.App.Config().ServiceSettings.EnableCommands + enableOnlyAdminIntegrations := *th.App.Config().ServiceSettings.EnableOnlyAdminIntegrations + defer func() { + th.App.UpdateConfig(func(cfg *model.Config) { cfg.ServiceSettings.EnableCommands = &enableCommands }) + th.App.UpdateConfig(func(cfg *model.Config) { + cfg.ServiceSettings.EnableOnlyAdminIntegrations = &enableOnlyAdminIntegrations + }) + }() + th.App.UpdateConfig(func(cfg *model.Config) { *cfg.ServiceSettings.EnableCommands = true }) + th.App.UpdateConfig(func(cfg *model.Config) { *cfg.ServiceSettings.EnableOnlyAdminIntegrations = true }) + newCmd := &model.Command{ CreatorId: th.BasicUser.Id, TeamId: th.BasicTeam.Id, diff --git a/api4/file_test.go b/api4/file_test.go index a28420c76..9143f4839 100644 --- a/api4/file_test.go +++ b/api4/file_test.go @@ -359,7 +359,8 @@ func TestGetFileHeaders(t *testing.T) { t.Run("js", testHeaders(data, "test.js", "text/plain", false)) t.Run("go", testHeaders(data, "test.go", "application/octet-stream", false)) t.Run("zip", testHeaders(data, "test.zip", "application/zip", false)) - t.Run("exe", testHeaders(data, "test.exe", "application/x-ms", false)) + // Not every platform can recognize these + //t.Run("exe", testHeaders(data, "test.exe", "application/x-ms", false)) t.Run("no extension", testHeaders(data, "test", "application/octet-stream", false)) t.Run("no extension 2", testHeaders([]byte("<html></html>"), "test", "application/octet-stream", false)) } |