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

How can I union coverage results in one file? #36

Closed
abakumov-v opened this issue Apr 10, 2018 · 16 comments
Closed

How can I union coverage results in one file? #36

abakumov-v opened this issue Apr 10, 2018 · 16 comments
Labels
enhancement General enhancement request

Comments

@abakumov-v
Copy link

Hello!

I have multiple tests projects - one with unit tests and one with integration tests. How can I calculate code coverage for both projects with coverlet?

@tonerdo tonerdo added the enhancement General enhancement request label Apr 12, 2018
@dmccaffery
Copy link

This is especially important if attempting to upload test results to VSTS, which is expecting a single summary file (and grabs the last match if using a glob pattern).

@dmccaffery
Copy link

grumble, grumble

@OneCyrus
Copy link
Contributor

OneCyrus commented May 1, 2018

is there an API to hook in to once all tests are complete? i guess currently a single instance of coverlet doesn't know if it's the last time a test is called and would need to consolidate the results for every test project.

@Hugh-walsh
Copy link

We run several tests in parallel using gitlab CI so would like to take the output files and combine them to give an overall result. Would be nice if this were possible.

@tonerdo
Copy link
Collaborator

tonerdo commented May 3, 2018

I'm exploring various possible ways to achieve this. Any ideas are welcome

@aptester
Copy link

aptester commented May 3, 2018

While I would also appreciate having this feature, currently as a workaround we are using ReportGenerator (4.0.0-alpha3) to merge all the coverage.xml files to generate a consolidated report.

From an implementation point of view, I like how opencover merges/appends output on existing report files if a -mergeoutput parameter is set.

@skoruba
Copy link

skoruba commented May 15, 2018

+1 Any idea - how union coverage results? :)

@coderpatros
Copy link
Contributor

@aptester's suggestion works well for generating a report. But not a combined xml for VSTS unfortunately :(

@skoruba
Copy link

skoruba commented May 22, 2018

@tonerdo What do you think about it? Do you have any suggestions for it? Thx.

@sjk07
Copy link

sjk07 commented Jun 11, 2018

i want this so bad! 😉

@tonerdo
Copy link
Collaborator

tonerdo commented Jun 12, 2018

I'm gonna explore how existing tools achieve this and see how best to implement since it's a popular ask. Will go a lot faster if I can get some help 😄

@basilfx
Copy link

basilfx commented Jun 14, 2018

I've started something over here, which I'm currently testing and will PR if ready. This basically allows one to merge the coverage result of one run, with an intermediate result of a previous run.

It's somewhat similar to what OpenCover offers.

Note that this will still generate the 'final' report after each intermediate run, so there is overhead. To use it, you should just add /p:CoverletIntermediateResult=output.json to the arguments.

@tonerdo
Copy link
Collaborator

tonerdo commented Jun 15, 2018

Awesome @basilfx, thanks a lot for the help

@basilfx
Copy link

basilfx commented Jun 18, 2018

The PR is here: #123.

@tonerdo
Copy link
Collaborator

tonerdo commented Jun 19, 2018

@basilfx can you please point me to the where OpenCover documents its implementation of this feature? Thanks

@basilfx
Copy link

basilfx commented Jun 19, 2018

You can find it here: https://github.com/opencover/opencover/wiki/Usage

Look for -mergeoutput and -mergebyhash.

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

No branches or pull requests

10 participants