Merge "Improve Namespaces UTs"
[multicloud/k8s.git] / src / k8splugin / Makefile
index 34b5198..0bc0cd5 100644 (file)
@@ -24,7 +24,7 @@ all: clean dep
 # no need to create a static binary with additional flags. However, for generating binary, additional build flags are necessary. This if used with
 # mock plugin errors out for unit tests. So the seperation avoids the error.
 
-build: clean dep plugins test
+build: clean dep plugins test cover
 deploy: build
 
 .PHONY: test
@@ -39,20 +39,21 @@ integration: clean
        @go build -buildmode=plugin -o ./mock_files/mock_plugins/mockplugin.so ./mock_files/mock_plugins/mockplugin.go
        @go test -v -tags 'integration' ./...
 
-.PHONY: format
 format:
        @go fmt ./...
 
-.PHONY: plugins
 plugins:
        @find plugins -type d -not -path plugins -exec sh -c "ls {}/plugin.go | xargs go build -buildmode=plugin -o $(basename {}).so" \;
 
-.PHONY: dep
 dep:
        @go get -u $(DEPENDENCIES)
        $(GOPATH)/bin/dep ensure
 
-.PHONY: clean
 clean:
        find . -name "*so" -delete
        @rm -f k8plugin
+
+.PHONY: cover
+cover:
+       @go test -tags 'unit' ./... -coverprofile=coverage.out
+       @go tool cover -html=coverage.out -o coverage.html