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

Multiple Package Unexpected coverage #120

Open
someone1 opened this issue Sep 10, 2018 · 1 comment
Open

Multiple Package Unexpected coverage #120

someone1 opened this issue Sep 10, 2018 · 1 comment

Comments

@someone1
Copy link

I'm unsure if I'm misunderstanding how to execute goveralls correctly or if something is wonky with its multiple-package execution.

I have a package where I have unit tests and some integration tests. The unit tests cover the packages they're a part of, and the integration tests cover multiple packages.

Typically, I'd use what's in goverall's README and setup my travis file with: $GOPATH/bin/goveralls -service=travis-ci - but this seems to only calculate coverage for my integration test (see coveralls result here). Alternatively, if I do it the "other" way:

$ go test -covermode=count -coverprofile=profile.cov
$ goveralls -coverprofile=profile.cov -service=travis-ci

I get more coverage, except now my integration test is not being counted (see this result)!

To get both types of coverage, I manually constructed my test line as such:

go test -v -coverprofile=coverage.out -covermode=count -coverpkg=github.com/someone1/hydra-gcp,github.com/someone1/hydra-gcp/client,github.com/someone1/hydra-gcp/config,github.com/someone1/hydra-gcp/consent,github.com/someone1/hydra-gcp/jwk,github.com/someone1/hydra-gcp/oauth2 ./...

The result is as expected.

Is there something I'm doing wrong here or is there a possible edge case that goveralls is missing?

@gdm85
Copy link
Collaborator

gdm85 commented Nov 4, 2020

@someone1 goveralls will use the space-separated list specified in -pkg to run go list and then use that result to run tests on each package.

Can you try using this option to see if issue can still be reproduced?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants