"MergeWith" option doesn't seem to be working for me
See original GitHub issueI’m testing coverlet and it seems the “MergeWith” option does not work for me. Here’s my setup:
I created a sample solution which contains 4 .Net Core projects: Module1, Module2, Test1, Test2. Test1 tests some method in module1 and test2 tests some method in module2. Then I run command:
dotnet test Test1.csproj /p:CollectCoverage=true
it builds the test, run it, and generate a coverage.json file which contains the coverage summary for Module1. Everything is good. The same for Test2. However when running test2 like this:
dotnet test Test2.csproj /p:CollectCoverage=true /p:MergeWith='C:\TestCoverlet\Test1\Test1\coverage.json'
The json file generated is identical with the one generated without the “MergeWith” option (only has the code coverage summary for Module2, but no Module1). It seems the option is not taking effect. Did I miss anything? It seems others didn’t encounter this issue. I have double checked the file path and made sure the file exists. I also tried using a non-exist file path, it didn’t throw any error. This isn’t normal, is it?
Packages I used in test1 and test2:
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
<PackageReference Include="MSTest.TestAdapter" Version="1.4.0" />
<PackageReference Include="MSTest.TestFramework" Version="1.4.0" />
<PackageReference Include="coverlet.msbuild" Version="2.5.1" />
dotnet core version is 2.1.403
Issue Analytics
- State:
- Created 5 years ago
- Comments:9 (4 by maintainers)
Top GitHub Comments
@xiaofma I use the output param. Like this
@xiaofma No problem 😃