Skip to content

Question about reporting on json output #216

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

Closed
joeharrison714 opened this issue Oct 16, 2018 · 4 comments
Closed

Question about reporting on json output #216

joeharrison714 opened this issue Oct 16, 2018 · 4 comments

Comments

@joeharrison714
Copy link

joeharrison714 commented Oct 16, 2018

Hello,
Just trying to switch to coverlet fron dotcover so we can do our build fully in linux (We have a windows agent now just for code coverage). As part of the build script I am looping through each test project and outputting a coverlet json report to the artifacts folder. I then have a process that runs after the build that pulls the json files and deserializes them and I am attempting to calculate the percentage of code coverage for a certain module. However, because the module name appears in multiple files with no coverage the average is including a bunch of zeros and coming out very low. I also trued merging all the reports into 1 with the same result. So I had 2 questions:

  1. Am I doing this right? I feel like I might be missing something.
  2. I've had to copy a bunch of code from the coverlet source to be able to deserialize the report and calculate the percentage. Should I need to do this?
@tonerdo
Copy link
Collaborator

tonerdo commented Oct 17, 2018

@joeharrison714 there are two alternatives I see here:

  1. grep the per module coverage summary that coverlet outputs to the terminal
  2. Use a different output format like opencover that already contains per module summaries. You'll need to us an XML reader for this but it should be fairly straightforward

@ghost
Copy link

ghost commented Oct 18, 2018

Maybe #203 is the fix the issue you are experiencing with merging?

@joeharrison714
Copy link
Author

Yes I believe it was

@MarcoRossignoli
Copy link
Collaborator

Close because solved by merge with...new sample section if you're in throuble https://github.com/tonerdo/coverlet/blob/master/Documentation/Examples.md

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

3 participants