Adding generation of coverage files to build (#3066)
Этот коммит содержится в:
3
.gitignore
поставляемый
3
.gitignore
поставляемый
@@ -71,6 +71,9 @@ api/data/*
|
|||||||
|
|
||||||
enterprise
|
enterprise
|
||||||
|
|
||||||
|
cover.out
|
||||||
|
ecover.out
|
||||||
|
|
||||||
.agignore
|
.agignore
|
||||||
.ctags
|
.ctags
|
||||||
tags
|
tags
|
||||||
|
|||||||
43
Makefile
43
Makefile
@@ -153,15 +153,34 @@ check-style: check-client-style check-server-style
|
|||||||
test-server: start-docker prepare-enterprise
|
test-server: start-docker prepare-enterprise
|
||||||
@echo Running server tests
|
@echo Running server tests
|
||||||
|
|
||||||
$(GO) test $(GOFLAGS) -run=$(TESTS) -test.v -test.timeout=340s ./api || exit 1
|
rm -f cover.out
|
||||||
$(GO) test $(GOFLAGS) -run=$(TESTS) -test.v -test.timeout=12s ./model || exit 1
|
echo "mode: count" > cover.out
|
||||||
$(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=340s -covermode=count -coverprofile=capi.out ./api || exit 1
|
||||||
$(GO) test $(GOFLAGS) -run=$(TESTS) -test.v -test.timeout=120s ./web || exit 1
|
$(GO) test $(GOFLAGS) -run=$(TESTS) -test.v -test.timeout=12s -covermode=count -coverprofile=cmodel.out ./model || exit 1
|
||||||
|
$(GO) test $(GOFLAGS) -run=$(TESTS) -test.v -test.timeout=180s -covermode=count -coverprofile=cstore.out ./store || exit 1
|
||||||
|
$(GO) test $(GOFLAGS) -run=$(TESTS) -test.v -test.timeout=120s -covermode=count -coverprofile=cutils.out ./utils || exit 1
|
||||||
|
$(GO) test $(GOFLAGS) -run=$(TESTS) -test.v -test.timeout=120s -covermode=count -coverprofile=cweb.out ./web || exit 1
|
||||||
|
|
||||||
|
tail -n +2 capi.out >> cover.out
|
||||||
|
tail -n +2 cmodel.out >> cover.out
|
||||||
|
tail -n +2 cstore.out >> cover.out
|
||||||
|
tail -n +2 cutils.out >> cover.out
|
||||||
|
tail -n +2 cweb.out >> cover.out
|
||||||
|
rm -f capi.out cmodel.out cstore.out cutils.out cweb.out
|
||||||
|
|
||||||
ifeq ($(BUILD_ENTERPRISE_READY),true)
|
ifeq ($(BUILD_ENTERPRISE_READY),true)
|
||||||
@echo Running Enterprise tests
|
@echo Running Enterprise tests
|
||||||
$(GO) test $(GOFLAGS) -run=$(TESTS) -c ./enterprise/ldap && ./ldap.test -test.v -test.timeout=120s || exit 1
|
|
||||||
$(GO) test $(GOFLAGS) -run=$(TESTS) -c ./enterprise/compliance && ./compliance.test -test.v -test.timeout=120s || exit 1
|
rm -f ecover.out
|
||||||
|
echo "mode: count" > ecover.out
|
||||||
|
|
||||||
|
$(GO) test $(GOFLAGS) -run=$(TESTS) -covermode=count -c ./enterprise/ldap && ./ldap.test -test.v -test.timeout=120s -test.coverprofile=cldap.out || exit 1
|
||||||
|
$(GO) test $(GOFLAGS) -run=$(TESTS) -covermode=count -c ./enterprise/compliance && ./compliance.test -test.v -test.timeout=120s -test.coverprofile=ccompliance.out || exit 1
|
||||||
|
|
||||||
|
tail -n +2 cldap.out >> ecover.out
|
||||||
|
tail -n +2 ccompliance.out >> ecover.out
|
||||||
|
rm -f cldap.out ccompliance.out
|
||||||
rm -r ldap.test
|
rm -r ldap.test
|
||||||
rm -r compliance.test
|
rm -r compliance.test
|
||||||
endif
|
endif
|
||||||
@@ -176,6 +195,12 @@ test-client: start-docker prepare-enterprise
|
|||||||
|
|
||||||
test: test-server test-client
|
test: test-server test-client
|
||||||
|
|
||||||
|
cover:
|
||||||
|
@echo Opening coverage info in browser. If this failed run make test first
|
||||||
|
|
||||||
|
$(GO) tool cover -html=cover.out
|
||||||
|
$(GO) tool cover -html=ecover.out
|
||||||
|
|
||||||
.prebuild:
|
.prebuild:
|
||||||
@echo Preparation for running go code
|
@echo Preparation for running go code
|
||||||
go get $(GOFLAGS) github.com/Masterminds/glide
|
go get $(GOFLAGS) github.com/Masterminds/glide
|
||||||
@@ -330,6 +355,10 @@ clean: stop-docker
|
|||||||
rm -f api/mattermost.log
|
rm -f api/mattermost.log
|
||||||
rm -f .prepare-go
|
rm -f .prepare-go
|
||||||
rm -f enterprise
|
rm -f enterprise
|
||||||
|
rm -f cover.out
|
||||||
|
rm -f ecover.out
|
||||||
|
rm -f *.out
|
||||||
|
rm -f *.test
|
||||||
|
|
||||||
nuke: clean clean-docker
|
nuke: clean clean-docker
|
||||||
@echo BOOM
|
@echo BOOM
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user