summaryrefslogtreecommitdiffstats
path: root/src/k8splugin/Makefile
diff options
context:
space:
mode:
authorVictor Morales <victor.morales@intel.com>2018-09-25 15:46:19 -0700
committerVictor Morales <victor.morales@intel.com>2018-09-25 15:49:52 -0700
commit145648701486244f632cc6aaaa0f70a252db829a (patch)
treefbc35b9773e2ec045489d7dff58a5e43141a73cf /src/k8splugin/Makefile
parentb7e7f8f659439ac1db7b42ad47828def65eb094c (diff)
Create code coverage report
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
Diffstat (limited to 'src/k8splugin/Makefile')
-rw-r--r--src/k8splugin/Makefile7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/k8splugin/Makefile b/src/k8splugin/Makefile
index 510ac163..0bc0cd55 100644
--- a/src/k8splugin/Makefile
+++ b/src/k8splugin/Makefile
@@ -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
@@ -52,3 +52,8 @@ dep:
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