[jboss-jira] [JBoss JIRA] (SWSQE-700) Investigate options for golang code coverage
Filip Brychta (Jira)
issues at jboss.org
Fri Apr 5 02:53:03 EDT 2019
[ https://issues.jboss.org/browse/SWSQE-700?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Filip Brychta resolved SWSQE-700.
---------------------------------
Resolution: Done
For unit tests it's working out of the box just by running e.g. _go test -covermode=count -coverprofile=count.out_
For system tests it's more complicated:
# add main go test file which will basically just call main() function to start kiali
# compile kiali in "code coverage ready" way: go test -c -covermode=count -coverpkg ./...
# use this binary to create kiali docker image
# start this docker image with following params: -systemTest
-test.coverprofile /opt/kiali/console/coverage.cov
# run tests
# kill kiali in a graceful way (after this step the coverage report should be generated)
# get report from docker container
> Investigate options for golang code coverage
> --------------------------------------------
>
> Key: SWSQE-700
> URL: https://issues.jboss.org/browse/SWSQE-700
> Project: Kiali QE
> Issue Type: Sub-task
> Reporter: Filip Brychta
> Assignee: Filip Brychta
> Priority: Major
> Labels: infrastructure
>
> How can we get code coverage report in golang?
> Useful doc:
> * https://docs.engineering.redhat.com/display/CentralCI/Golang+Code+Coverage
> * https://blog.golang.org/cover
> * https://www.elastic.co/blog/code-coverage-for-your-golang-system-tests
> * https://forum.golangbridge.org/t/how-to-do-go-test-coverage-for-system-testing/6479
> * https://husobee.github.io/golang/test/coverage/2015/11/17/external-test-coverage.html
--
This message was sent by Atlassian Jira
(v7.12.1#712002)
More information about the jboss-jira
mailing list