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

Ignoring example packages doesn't seem to affect total coverage #125

Open
vektah opened this issue Nov 12, 2018 · 3 comments
Open

Ignoring example packages doesn't seem to affect total coverage #125

vektah opened this issue Nov 12, 2018 · 3 comments

Comments

@vektah
Copy link

vektah commented Nov 12, 2018

I'm building a graphql server that generates lots of code, and the test coverage of the generated code in examples isn't particularly interesting so I want to exclude it from the reports.

What I'm currently trying:

go test -coverprofile=/tmp/coverage.out -coverpkg=./... ./...
goveralls -coverprofile=/tmp/coverage.out -service=circle-ci -repotoken=snip

Without any -ingore specified it looks like this:
image

Notice 16490 relevant lines?

Adding ignore like this:

goveralls -coverprofile=/tmp/coverage.out -service=circle-ci -repotoken=snip -ignore='example/*/*,example/*/*/*,integration/*,integration/*/*,codegen/testserver/*'

Generates coverage like this:
image

Relevant lines stays the same, so the total coverage is unaffected, even though those packages have been removed.

I also tried running coveralls without a coverprofile, but it didn't seem to cover anything

goveralls -show -service=circle-ci -repotoken=snip -ignore='example/*/*.go,example/*/*/*.go,integration/*,integration/*/*,codegen/testserver/*'  

image

No files in the list, but same coverage.

What am I doing wrong?

@mattn
Copy link
Owner

mattn commented Nov 12, 2018

I'm not sure yet, It seems that -ignore option does not work expectedly.

@vektah
Copy link
Author

vektah commented Mar 18, 2019

Any update? This is blocking coverage for https://github.com/99designs/gqlgen

@nbaztec
Copy link
Collaborator

nbaztec commented Nov 2, 2020

@vektah The ignore seems to be working correctly on goveralls's side.

From your example and checking the build history seems you tried to push the coverage on the same build number, so it's entirely possible that coveralls does not update the coverage accordingly. Subsequent builds seem to have fixed it going forward

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

4 participants