mirror of
https://github.com/open-policy-agent/opa.git
synced 2026-08-12 19:32:48 -06:00
Add Makefile target to run coverage
For now the target fails because there are no tests for the "cmd" package. Since this is being used manually for now, this is acceptable.
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
.vscode
|
||||
opa
|
||||
opalog/parser.go
|
||||
coverage
|
||||
|
||||
@@ -18,7 +18,7 @@ GO := go
|
||||
GO15VENDOREXPERIMENT := 1
|
||||
export GO15VENDOREXPERIMENT
|
||||
|
||||
.PHONY: all deps generate build test check check-fmt check-vet check-lint fmt clean
|
||||
.PHONY: all deps generate build test cover check check-fmt check-vet check-lint fmt clean
|
||||
|
||||
all: build test check
|
||||
|
||||
@@ -36,6 +36,14 @@ build: generate
|
||||
test: generate
|
||||
$(GO) test -v $(PACKAGES)
|
||||
|
||||
COVER_PACKAGES=$(PACKAGES)
|
||||
$(COVER_PACKAGES):
|
||||
@mkdir -p coverage/$(shell dirname $@)
|
||||
go test -covermode=count -coverprofile=coverage/$(shell dirname $@)/coverage.out $@
|
||||
go tool cover -html=coverage/$(shell dirname $@)/coverage.out
|
||||
|
||||
cover: $(COVER_PACKAGES)
|
||||
|
||||
check: check-fmt check-vet check-lint
|
||||
|
||||
check-fmt:
|
||||
|
||||
Reference in New Issue
Block a user