# 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
@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