summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorChristopher Speller <crspeller@gmail.com>2016-05-13 16:17:07 -0400
committerChristopher Speller <crspeller@gmail.com>2016-05-13 16:17:07 -0400
commit587ddde5876c14e2617cc341d8e5a13195cc0105 (patch)
tree4f1822636a131f62f18766a856024ebc40963c85 /Makefile
parent39b520e38e0b4812819397a6163b0de308cc6260 (diff)
downloadchat-587ddde5876c14e2617cc341d8e5a13195cc0105.tar.gz
chat-587ddde5876c14e2617cc341d8e5a13195cc0105.tar.bz2
chat-587ddde5876c14e2617cc341d8e5a13195cc0105.zip
Cleaning up make test-client. Adding to build. (#2984)
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile41
1 files changed, 23 insertions, 18 deletions
diff --git a/Makefile b/Makefile
index d1baac814..584b84cd2 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-.PHONY: build package run stop run-client run-server stop-client stop-server restart-server restart-client start-docker clean-dist clean nuke check-style check-unit-tests test dist setup-mac prepare-enteprise run-client-tests setup-run-client-tests cleanup-run-client-tests test-client build-linux build-osx build-windows
+.PHONY: build package run stop run-client run-server stop-client stop-server restart-server restart-client start-docker clean-dist clean nuke check-style check-client-style check-server-style check-unit-tests test dist setup-mac prepare-enteprise run-client-tests setup-run-client-tests cleanup-run-client-tests test-client build-linux build-osx build-windows internal-test-client
# For golang 1.5.x compatibility (remove when we don't want to support it anymore)
export GO15VENDOREXPERIMENT=1
@@ -132,7 +132,12 @@ clean-docker:
docker rm -v mattermost-openldap > /dev/null; \
fi
-check-style:
+check-client-style:
+ @echo Checking client style
+
+ cd $(BUILD_WEBAPP_DIR) && $(MAKE) check-style
+
+check-server-style:
@echo Running GOFMT
$(eval GOFMT_OUTPUT := $(shell gofmt -d -s api/ model/ store/ utils/ manualtesting/ einterfaces/ mattermost.go 2>&1))
@echo "$(GOFMT_OUTPUT)"
@@ -143,14 +148,16 @@ check-style:
exit 1; \
fi
-test: prepare-enteprise start-docker
- @echo Running tests
+check-style: check-client-style check-server-style
+
+test-server: start-docker prepare-enterprise
+ @echo Running server tests
- #$(GO) test $(GOFLAGS) -run=$(TESTS) -test.v -test.timeout=340s ./api || exit 1
- #$(GO) test $(GOFLAGS) -run=$(TESTS) -test.v -test.timeout=12s ./model || exit 1
- #$(GO) test $(GOFLAGS) -run=$(TESTS) -test.v -test.timeout=180s ./store || exit 1
- #$(GO) test $(GOFLAGS) -run=$(TESTS) -test.v -test.timeout=120s ./utils || exit 1
- #$(GO) test $(GOFLAGS) -run=$(TESTS) -test.v -test.timeout=120s ./web || exit 1
+ $(GO) test $(GOFLAGS) -run=$(TESTS) -test.v -test.timeout=340s ./api || exit 1
+ $(GO) test $(GOFLAGS) -run=$(TESTS) -test.v -test.timeout=12s ./model || exit 1
+ $(GO) test $(GOFLAGS) -run=$(TESTS) -test.v -test.timeout=180s ./store || exit 1
+ $(GO) test $(GOFLAGS) -run=$(TESTS) -test.v -test.timeout=120s ./utils || exit 1
+ $(GO) test $(GOFLAGS) -run=$(TESTS) -test.v -test.timeout=120s ./web || exit 1
ifeq ($(BUILD_ENTERPRISE_READY),true)
@echo Running Enterprise tests
$(GO) test $(GOFLAGS) -run=$(TESTS) -c ./enterprise/ldap && ./ldap.test -test.v -test.timeout=120s || exit 1
@@ -159,19 +166,15 @@ ifeq ($(BUILD_ENTERPRISE_READY),true)
rm -r compliance.test
endif
-setup-run-client-tests:
- sed -i'.bak' 's|"EnableOpenServer": false,|"EnableOpenServer": true,|g' config/config.json
+internal-test-client: start-docker prepare-enterprise
+ $(GO) run $(GOFLAGS) *.go -run_client_tests
-cleanup-run-client-tests:
- sed -i'.bak' 's|"EnableOpenServer": true,|"EnableOpenServer": false,|g' config/config.json
+test-client: start-docker prepare-enterprise
+ @echo Running client tests
-run-client-tests:
cd $(BUILD_WEBAPP_DIR) && $(MAKE) test
- sleep 10
- @echo Running client side unit tests
- cd $(BUILD_WEBAPP_DIR) && npm test
-test-client: setup-run-client-tests run-server run-client-tests stop-server cleanup-run-client-tests
+test: test-server test-client
.prebuild:
@echo Preparation for running go code
@@ -323,6 +326,8 @@ clean: stop-docker
rm -rf logs
rm -f mattermost.log
+ rm -f npm-debug.log
+ rm -f api/mattermost.log
rm -f .prepare-go
rm -f enterprise