I am trying to use -test.gocoverdir= to combine multiple runs of tests. But I use -coverpkg ./... flag because I want to have coverage calculated across sub-packages. This works well when running without coverage dir.
What did you see happen?
I see that reported numbers by go tool covdata percent -i=coverage is the same as those I get when running go test without -coverpkg ./....
What did you expect to see?
I expected that I can pass -coverpkg ./... to go tool covdata percent -i=coverage to get the same numbers as reported by the go test tool when it runs (when testing on one run).
Go version
go version go1.22.1 linux/amd64
Output of
go env
in your module/workspace:What did you do?
I am trying to use
-test.gocoverdir=
to combine multiple runs of tests. But I use-coverpkg ./...
flag because I want to have coverage calculated across sub-packages. This works well when running without coverage dir.What did you see happen?
I see that reported numbers by
go tool covdata percent -i=coverage
is the same as those I get when runninggo test
without-coverpkg ./...
.What did you expect to see?
I expected that I can pass
-coverpkg ./...
togo tool covdata percent -i=coverage
to get the same numbers as reported by thego test
tool when it runs (when testing on one run).