Skip to content

Coverage

Running unit tests with coverage enabled can be done with the following commands. This will generate an integrationcover.log:

go test -covermode=atomic -coverpkg=./... -coverprofile=integrationcover.log $(go list ./... | grep -v '/cmd/')
go tool cover -func=integrationcover.log

To view coverage as an HTML report:

go tool cover -html=integrationcover.log -o coverage.html