Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/covdata: percent does not support -coverpkg #66464

Open
mitar opened this issue Mar 22, 2024 · 2 comments
Open

cmd/covdata: percent does not support -coverpkg #66464

mitar opened this issue Mar 22, 2024 · 2 comments
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.

Comments

@mitar
Copy link
Contributor

mitar commented Mar 22, 2024

Go version

go version go1.22.1 linux/amd64

Output of go env in your module/workspace:

GO111MODULE=''
GOARCH='amd64'
GOBIN=''
GOCACHE='/root/.cache/go-build'
GOENV='/root/.config/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='amd64'
GOHOSTOS='linux'
GOINSECURE=''
GOMODCACHE='/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='linux'
GOPATH='/go'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/usr/local/go'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='local'
GOTOOLDIR='/usr/local/go/pkg/tool/linux_amd64'
GOVCS=''
GOVERSION='go1.22.1'
GCCGO='gccgo'
GOAMD64='v1'
AR='ar'
CC='gcc'
CXX='g++'
CGO_ENABLED='0'
GOMOD='/code/go.mod'
GOWORK=''
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
PKG_CONFIG='pkg-config'
GOGCCFLAGS='-fPIC -m64 -fno-caret-diagnostics -Qunused-arguments -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build1985924870=/tmp/go-build -gno-record-gcc-switches'

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 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).

@mitar
Copy link
Contributor Author

mitar commented Mar 22, 2024

(attn @thanm)

@seankhliao seankhliao changed the title cmd/go: tool covdata percent does not support -coverpkg cmd/covdata: percent does not support -coverpkg Mar 24, 2024
@dr2chase
Copy link
Contributor

@thanm

@dr2chase dr2chase added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Mar 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

2 participants