-
Notifications
You must be signed in to change notification settings - Fork 388
/p:MergeWith does not merge but adds #203
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
Comments
So my final expectation is to run this:
Which is equivalent to run dotnet test on each proj:
|
Update: @tonerdo Looking into the Merging code 45bc5bc I see you merge by So the
So module Any chance it can look into same dll names for merging instead of the whole key? (via Path.GetFileName perhaps?) |
Pr created for this #204 |
When this will be pushed to coverlet.msbuild nuget package? |
I will reopen until it's there on the pkg |
:) nice |
Great, thanks for the feature, hopefully it gets a release soon. However, I'm wondering, wouldn't it be an even better solution to extend this feature into some kind of /p:AggregateResultsAt that would create the first file if it doesn't exist, append all other results to it, and then finally convert it to other formats if required. In my use case (VSTS build with multiple test projects), I could have a single step that would look like this: dotnet test **/*[Tt]ests/*.csproj Thank you guys for your work! |
@vlef without doubts. That was my next step, because if the file doesn't exist it fails. And it's annoying because when running a dotnet test on a solution you want it to also generate the file for the first test run. I haven't got the time to look into that TBH. But maybe @tonerdo can take a look when he is free. Or if you find it you can also make a pr for it :) Cheers |
That would be a great addition to the pr i made and you already merged in @tonerdo :) |
Released |
Where was this released? I'm not seeing a new version on the NuGet feed. Last version is |
I'm waiting on #220 to be released |
@obtuse-whoosh and then you probably have the issue at #225 xD |
@obtuse-whoosh had you check that your merge is not decreasing your branch coverage as stated in the issue i opened and referenced in #225? |
@obtuse-whoosh no idea. Hopefully my pr will get merged first. |
@obtuse-whoosh Seems like he won't release it :/ See #223 Still no reason why though |
Any update here? I think it is quite a common use case to have more than one test project within the solution. |
@Dragon160 actually as I've seen it went worse because it's now adding coverage for dlls that are not even part of your project, but some other libraries (at least last time i checked). |
Hi, I am using coverlet 1.6.0 version and in my solution there are multiple test project but mergewith is not working I am using below: Coverlet "D:\Project\proj1.Test\bin\Debug\netcoreapp2.2\proj1.Test.dll" --target "dotnet" --targetargs "test "D:\Project\proj1.Test" --no-build" |
I have a unit-test-per-project structure and also having this issue. Coverlet replaces the correct coverage for an assembly with the coverage of the assembly in the current test assembly, instead of a merging coverage. I am able to work around it by running coverlet per project and then letting report-generator do the merging, which it seems it does correctly. here is a gist for a powershell script that may help you https://gist.github.com/ckarcz/180a9ddfd9bfe33b1e68e1634c0e599e#gistcomment-3132943 cheers 🍻 |
Other that @ckarcz you can try with https://github.com/tonerdo/coverlet/blob/master/Documentation/Examples/MSBuild/MergeWith/HowTo.md |
@MarcoRossignoli i did that but still had the coverage results of a library replaced with a subsequent collection/merge, resulting in zero coverage for that library. same as @priyanka1112 describes. the merge should merge the result data, not just the result xml nodes in the files. |
Can you provide a simple repro?I'm not sure to understand where is the problem. |
I'm testing using coverlet over a solution that has 3 test projects which i want to combine into a single .opencover.xml file
Since there's currently no direct solution for this. What I tried to do is generate the coverage for one of the test projects, output its result into an "converage.json" file and then apply a MergeWith param in the following dotnet test commands to merge into that same json file and set the output format to opencover
Problem is, that since the first project(ProjectName.Api) includes other two as references (ProjectName.Application, ProjectName.Data), the report is generated as following:
So it includes two other coverages for the referenced projects with 0% coverage.
This wouldn't be a problem if /p:MergeWith param actually did a proper merge.
But when I run the next dotnet test (over the ProjectName.Application project) with the MergeWith param pointing to this recently generated coverage.json file, I get this:
So it just adds the recent coverage to the existing ones in coverage.json. Causing a duplicated coverage in ProjectName.Application and ProjectName.Data (because again, ProjectName.Application references ProjectName.Data, so it adds a coverage 0% report)
Any solutions to this? Or am I missusing something?
Or even a way for coverlet for avoid including referenced project coverage?
The text was updated successfully, but these errors were encountered: