You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a class library project named "MainProcessing" which contains my main code. This project is part of solution named "Processor". This class library project is written in .Net core 3.1.
I have another solution named "MainProcessing.Test" which contains a .Net core 3.1 class library project named "MainProcessingTest.Helper". I have added reference of MainProcessing.dll in this project.
This solution also contains unit test (MSTest) project named "Medical.Test" which contains reference of "MainProcessingTest.Helper" and "MainProcessing.dll". This project also written in .Net core 3.1 only.
I am using below mentioned command to run test cases and get code coverage results. But this command always gives me results of "MainProcessingTest.Helper" project instead of "MainProcessing.dll".
All code of "MainProcessing.dll" executed whenever I run unit test cases of project "Medical.Test" but it is not showing coverage results of my main project "MainProcessing.dll".
I want coverlet to show me results of only "MainProcessing.dll".
Command I use: dotnet test 'Medical.Test.csproj' /p:CollectCoverage=true /p:CoverletOutputFormat=\"cobertura,lcov\" /p:CoverletOutput='Coverage/ProviderTestsCoverage' /p:Include=[*]MainProcessing.* /p:Exclude=[*]MainProcessing.Test* --logger:"trx;LogFileName=Logs/trxFile/ProviderTest.trx"
How does the projects in MainProcessing.Test.sln access the MainProcessing project? I.e., is it a direct reference to the csproj in the source code of Processor.sln, or is the project built and published on e.g. an internal nuget with a package reference. In the latter case the coverlet instrumentor will likely not find some or all the sources on disk for MainProcessing, which it interprets as a third-party DLL that should be excluded from analysis.
I have a class library project named "MainProcessing" which contains my main code. This project is part of solution named "Processor". This class library project is written in .Net core 3.1.
I have another solution named "MainProcessing.Test" which contains a .Net core 3.1 class library project named "MainProcessingTest.Helper". I have added reference of MainProcessing.dll in this project.
This solution also contains unit test (MSTest) project named "Medical.Test" which contains reference of "MainProcessingTest.Helper" and "MainProcessing.dll". This project also written in .Net core 3.1 only.
I am using below mentioned command to run test cases and get code coverage results. But this command always gives me results of "MainProcessingTest.Helper" project instead of "MainProcessing.dll".
All code of "MainProcessing.dll" executed whenever I run unit test cases of project "Medical.Test" but it is not showing coverage results of my main project "MainProcessing.dll".
I want coverlet to show me results of only "MainProcessing.dll".
Command I use:
dotnet test 'Medical.Test.csproj' /p:CollectCoverage=true /p:CoverletOutputFormat=\"cobertura,lcov\" /p:CoverletOutput='Coverage/ProviderTestsCoverage' /p:Include=[*]MainProcessing.* /p:Exclude=[*]MainProcessing.Test* --logger:"trx;LogFileName=Logs/trxFile/ProviderTest.trx"
Current Output:
+-------------------+------+--------+--------+
| Module | Line | Branch | Method |
+-------------------+------+--------+--------+
| MainProcessingTest.Helper | 40% | 37.5% | 63.63% |
+-------------------+------+--------+--------+
+---------+------+--------+--------+
| | Line | Branch | Method |
+---------+------+--------+--------+
| Total | 40% | 37.5% | 63.63% |
+---------+------+--------+--------+
| Average | 40% | 37.5% | 63.63% |
+---------+------+--------+--------+
The text was updated successfully, but these errors were encountered: