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 <jmulligan@redhat.com>
This commit is contained in:
John Mulligan 2019-10-30 14:23:23 -04:00 committed by John Mulligan
parent 971027692f
commit fb17c78c11
1 changed files with 4 additions and 1 deletions

View File

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