gotesplit icon indicating copy to clipboard operation
gotesplit copied to clipboard

Using `-coverprofile` leads to incomplete coverage data

Open CubicrootXYZ opened this issue 1 year ago • 0 comments

Specifying the -coverprofile flag leads to a coverage output that only contains coverage of the last tested package.

I'd expect to see coverage for all packages included in the tests. It seems like gotesplit runs multiple go test runs under the hood overwriting the coverprofile file.

Command I used:

gotesplit -total=3 -index=1 ./... -- -v -race -covermode=atomic -cover -coverprofile=coverage.tmp > report.tmp

I can clearly see that report.tmp contains tests covering files not part of coverage.tmp.

CubicrootXYZ avatar Sep 13 '24 11:09 CubicrootXYZ