goverage icon indicating copy to clipboard operation
goverage copied to clipboard

Support for build tags

Open JelteF opened this issue 7 years ago • 3 comments

Just wanted to say great tool. It merges the reports much better than the bash stuff we had before. Is it possible to add a -tags option to the command though? I use a test tag to exclude some files that don't need to be tested or covered from the tests.

JelteF avatar Apr 20 '17 13:04 JelteF

A very useful feature for me too.

vmarkovtsev avatar May 14 '18 18:05 vmarkovtsev

With go1.10 this tool is not needed anymore.

JelteF avatar May 14 '18 22:05 JelteF

With how we've structured our tests, we still have need for this tool, and would love to see the -tags option merged from https://github.com/haya14busa/goverage/pull/18.

Our test setup:

  • packageA is tested from packageA_test
  • We have multiple packages and want coverage from packageB_test to count even if it inadvertently uses packageA.

In go1.10, if coverage is achieved from a different package, it's not counted, unless you use -coverpkg=./.... But you then have duplicate samples in your coverage.out that leads to erroneous coverage percentages from tools:

item-0_and_displaysextra_and_appleclockextra_and_item-0_and_item-0

We've tried more elaborate things like using go list -f ... alongside -coverpkg but prefer goverage. If anyone has feedback on this, it would be much appreciated.

dimroc avatar Jul 25 '18 13:07 dimroc