Is it possible to post coverage for multiple packages to Coveralls?

前端 未结 6 644
故里飘歌
故里飘歌 2021-02-04 10:02

I want to track test coverage on a go project using Coveralls, the instructions for the integration reference using https://github.com/mattn/goveralls

cd $GOPA         


        
6条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-02-04 10:32

    I have been using http://github.com/axw/gocov to get my code coverage.

    I trigger this in a bash script, in here I call all my packages.

    I also use http://github.com/matm/gocov-html to format into html.

     coverage)
           echo "Testing Code Coverage"
           cd "${SERVERPATH}/package1/pack"
           GOPATH=${GOPATH} gocov test ./... > coverage.json 
           GOPATH=${GOPATH} gocov-html coverage.json > coverage_report.html
    
           cd "${SERVERPATH}/package2/pack"
           GOPATH=${GOPATH} gocov test ./... > coverage.json 
           GOPATH=${GOPATH} gocov-html coverage.json > coverage_report.html
         ;;
    

    Hope that helps a little bit.

提交回复
热议问题