From fb17c78c11962324b29b8b58a85572941671216f Mon Sep 17 00:00:00 2001 From: John Mulligan Date: Wed, 30 Oct 2019 14:23:23 -0400 Subject: [PATCH] tests: generate html coverage report When tests are run generate a coverage report. To access this coverage report mount any directory to /results in the container. Coverage output files will be written to /results/coverage w/in the container. Later we can do other interesting things with the coverage detected such as a test pass/fail criteria or submitted to a service such as coveralls, etc. Signed-off-by: John Mulligan --- entrypoint.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index 6b53561..1c2676d 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -13,4 +13,7 @@ go get -t -v ./... diff -u <(echo -n) <(gofmt -d -s .) #go vet ./... #go list ./... -GOCACHE=off go test -v ./... +P=github.com/ceph/go-ceph +GOCACHE=off go test -v -covermode=count -coverprofile=cover.out -coverpkg=$P/cephfs,$P/rados,$P/rbd ./... +mkdir -p /results/coverage +go tool cover -html=cover.out -o /results/coverage/go-ceph.html