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 ./... for the -pkg pattern #66507

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

cmd/covdata: percent does not support ./... for the -pkg pattern #66507

mitar opened this issue Mar 24, 2024 · 2 comments
Assignees
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@mitar
Copy link
Contributor

mitar commented Mar 24, 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 ran:

GOCOVERDIR=coverage go test -timeout 10m -cover -covermode atomic -args -test.gocoverdir=coverage ./...

to collect coverage data into coverage dir and then I ran:

go tool covdata percent -i=coverage -pkg=./...

What did you see happen?

No output was made.

What did you expect to see?

To get the coverage matching the ./... package(s). Same as what was reported during a test run.

The use case here is that I have also some additional e2e main programs calling into the library I am testing and I want those to not be reported. But to report everything under the ./... pattern.

Note, help text says:

  -pkg string
    	Restrict output to package(s) matching specified package pattern.

Which makes me think that ./... should already be supported.

@seankhliao seankhliao changed the title cmd/go: tool covdata percent does not upport ./... for the -pkg pattern cmd/covdata: percent does not upport ./... for the -pkg pattern Mar 24, 2024
@seankhliao seankhliao changed the title cmd/covdata: percent does not upport ./... for the -pkg pattern cmd/covdata: percent does not support ./... for the -pkg pattern Mar 24, 2024
@mitar
Copy link
Contributor Author

mitar commented Mar 24, 2024

(attn @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
@dr2chase
Copy link
Contributor

@golang/compiler

@cherrymui cherrymui added the compiler/runtime Issues related to the Go compiler and/or runtime. label Mar 25, 2024
@mknyszek mknyszek added this to the Backlog milestone Mar 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
Development

No branches or pull requests

5 participants