-
-
Notifications
You must be signed in to change notification settings - Fork 140
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
Unable to run on multiple packages #20
Comments
Confirmed. |
"go test -coverprofile" does not support generating a single coverage profile for multiple packages. (see: https://groups.google.com/forum/#!msg/golang-nuts/p4WbbnJqTvk/8EBnIWXOgMAJ). Is it possible to generate many coverage profiles and then merge them into one? |
also having this issue, any resolutions? |
It's not a problem of goveralls maybe. |
The output coverage reports can be concatenated and sent to goveralls. The service It would be great to have this built into the library. |
@usmanismail thanks for that script, it works great. |
fyi, i worked from what @usmanismail and made a similar version: https://github.com/sdboyer/gogl/blob/master/test-coverage.sh |
I had the same problem. I agree with @mattn, this doesn't seem like a goveralls problem--more like a problem with I made a Go executable to combine the go get code.google.com/p/go.tools/cmd/cover
go get github.com/modocache/gover
go get github.com/mattn/goveralls
go test ./...
gover
goveralls -coverprofile=gover.coverprofile -service drone.io -repotoken $COVERALLS_TOKEN |
Please note that issue 6909 is exactly this problem and has been accepted. It is quite possible that "go test" will support this in the future release. See https://code.google.com/p/go/issues/detail?id=6909 |
@modocache thanks for |
Thanks for writing gover, @modocache. Here's a travis config that works for one of my projects with 'sub-packages'. before_install:
- go get golang.org/x/tools/cmd/cover
- go get github.com/axw/gocov/gocov
- go get github.com/modocache/gover
- go get github.com/mattn/goveralls
script:
- go test -coverprofile=api.coverprofile ./api
- go test -coverprofile=utils.coverprofile ./utils
- go test -coverprofile=models.coverprofile ./models
- go test -coverprofile=main.coverprofile
- $HOME/gopath/bin/gover
- $HOME/gopath/bin/goveralls -coverprofile=gover.coverprofile -service travis-ci |
See mattn/goveralls#20 for more details.
See mattn/goveralls#20 for more details.
See mattn/goveralls#20 for more details.
See mattn/goveralls#20 for more details.
See mattn/goveralls#20 for more details.
See mattn/goveralls#20 for more details.
any updates? |
Workaround on this issue: |
|
go test, and subsequently goveralls, does not support using the test profile flag with multiple packages. See: mattn/goveralls#20 golang/go#6909
go test, and subsequently goveralls, does not support using the test profile flag with multiple packages. See: mattn/goveralls#20 golang/go#6909
go test, and subsequently goveralls, does not support using the test profile flag with multiple packages. See: mattn/goveralls#20 golang/go#6909
go test, and subsequently goveralls, does not support using the test profile flag with multiple packages. See: mattn/goveralls#20 golang/go#6909
https://github.com/go-playground/overalls (Multi-Package go project coverprofile for tools like goveralls ) can be used to test multiple packages in a project and more discussion about this problem can be found in golang/go#6909 |
I made already branch for multiple-package. https://github.com/mattn/goveralls/tree/multiple-packages But not tested. |
check https://github.com/h12w/gosweep for a simple bash script that can get you complete coverage. you can then use the output on |
Closed by #74 |
For reference, here is how I combine two coverage profiles in the GitHub actions: go test -timeout=60s -race -covermode=atomic -coverprofile=$GITHUB_WORKSPACE/profile.cov_tmp
cat $GITHUB_WORKSPACE/profile.cov_tmp | grep -v "_mock.go" > $GITHUB_WORKSPACE/profile.cov
cd v2
go test -timeout=60s -race -covermode=atomic -coverprofile=$GITHUB_WORKSPACE/profile.cov_tmp
# combine the coverage files
cat $GITHUB_WORKSPACE/profile.cov_tmp | grep -v "_mock.go" | grep -v "mode:" >> $GITHUB_WORKSPACE/profile.cov |
I am unable to use this tool with multiple packages
goveralls -package ./... XXXXXXXXXXXX
cannot use test profile flag with multiple packages
error: %v exit status 1
17:58:08 gocov.go:132: Error loading gocov results: exit status 1
The text was updated successfully, but these errors were encountered: