Add make coverage (#29)
This PR adds a 'make coverage` command, which creates a coverage report for the server code.
This commit is contained in:
parent
c33bf64be0
commit
ff7758dc6a
1 changed files with 9 additions and 1 deletions
10
Makefile
10
Makefile
|
@ -142,12 +142,20 @@ endif
|
||||||
.PHONY: test
|
.PHONY: test
|
||||||
test: server/.depensure webapp/.npminstall
|
test: server/.depensure webapp/.npminstall
|
||||||
ifneq ($(HAS_SERVER),)
|
ifneq ($(HAS_SERVER),)
|
||||||
cd server && $(GO) test -race -v -coverprofile=coverage.txt ./...
|
cd server && $(GO) test -race -v ./...
|
||||||
endif
|
endif
|
||||||
ifneq ($(HAS_WEBAPP),)
|
ifneq ($(HAS_WEBAPP),)
|
||||||
cd webapp && $(NPM) run fix;
|
cd webapp && $(NPM) run fix;
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
## Creates a coverage report for the server code.
|
||||||
|
.PHONY: coverage
|
||||||
|
coverage: server/.depensure webapp/.npminstall
|
||||||
|
ifneq ($(HAS_SERVER),)
|
||||||
|
cd server && $(GO) test -race -coverprofile=coverage.txt ./...
|
||||||
|
@cd server && $(GO) tool cover -html=coverage.txt
|
||||||
|
endif
|
||||||
|
|
||||||
## Clean removes all build artifacts.
|
## Clean removes all build artifacts.
|
||||||
.PHONY: clean
|
.PHONY: clean
|
||||||
clean:
|
clean:
|
||||||
|
|
Reference in a new issue