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

I don't think -coverpkg=./... is handled well. #2

Closed
arvenil opened this issue Apr 23, 2020 · 3 comments
Closed

I don't think -coverpkg=./... is handled well. #2

arvenil opened this issue Apr 23, 2020 · 3 comments

Comments

@arvenil
Copy link

arvenil commented Apr 23, 2020

codecov: 82%
coveralls: 48%
https://github.com/arvenil/kata

go test -coverpkg=./... -coverprofile=coverage.txt -covermode=atomic ./...

Note -coverpkg=./....
This results in below file (I cut it only to show line 14 of templates.go file):

$ cat coverage.txt | grep templates.go:14
github.com/arvenil/kata/format/templates/templates.go:14.37,19.17 5 0
github.com/arvenil/kata/format/templates/templates.go:14.37,19.17 5 0
github.com/arvenil/kata/format/templates/templates.go:14.37,19.17 5 1
github.com/arvenil/kata/format/templates/templates.go:14.37,19.17 5 0
github.com/arvenil/kata/format/templates/templates.go:14.37,19.17 5 0
github.com/arvenil/kata/format/templates/templates.go:14.37,19.17 5 0

As you may see, for example, line 14 is visible there several times with different count.
This tool converts it to:

DA:14,0
DA:14,0
DA:14,1
DA:14,0
DA:14,0
DA:14,0

And then coveralls doesn't seem to handle it and shows ZERO coverage when there was exactly one pass. Maybe this tool should sum such entries, and as so coveralls would show correct value, or maybe it's a bug worth reporting to coveralls?

@jandelgado
Copy link
Owner

Thanks for the report. Could you please open the issue in the "https://github.com/jandelgado/gcov2lcov" project, since this does the actual conversion?

@jandelgado
Copy link
Owner

I have a fix ready to test. Please test with:

  - name: Convert coverage to lcov
      uses: jandelgado/gcov2lcov-action@8def3626a8d83b1304867dc031b6729eb733e993

If it works, I'll release it

@jandelgado
Copy link
Owner

I think I've found & fixed the problem, please retry with this version

- name: Convert coverage to lcov
      uses: jandelgado/gcov2lcov-action@c760baabceadcd9ab34f1a5244f0db8472abd6db

fixed by jandelgado/gcov2lcov#4

Thanks -jan

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

No branches or pull requests

2 participants