The cover action target allows the creation of code coverage report
during the Jenkins Job execution, giving an idea of the impact of
the change submitted.
Change-Id: Ia2b8d57a0f9235ace021baaa6f74370b6656e58f
Signed-off-by: Victor Morales <victor.morales@intel.com>
Issue-ID: MULTICLOUD-301
.tox/
.*.swp
*.log
+coverage.html
# Directories
pkg
# 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
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