MicrosoftPremier / VstsExtensions

Documentation and issue tracking for Microsoft Premier Services Visual Studio Team Services Extensions
MIT License
56 stars 14 forks source link

Coverage analyzes irrelevant dll's #50

Closed aidamus closed 4 years ago

aidamus commented 4 years ago

I noticed when I opened .coverage file generated by ADO build, that it's trying to analyze coverage of a variety of dll's referenced in the main project thus reducing the % of coverage as a result of it. (coverage for this project should be 72.30% as shown in the second row) Is there a way to tell the task to cover only certain dll's?

Name Not Covered(Blocks) Not Covered (% blocks) Covered (blocks) Covered (% blocks)
20191016.3.Release.any cpu.11155.coverage 32277 77.15% 9560 22.85%
agentapi.core.dll 336 27.70% 877 72.30%
agentapi.core.unittests.dll 29 1.97% 1441 98.03%
microsoft.identitymodel.jsonwebtokens.dll 1536 99.68% 5 0.32%
microsoft.identitymodel.logging.dll 370 96.10% 15 3.90%
microsoft.identitymodel.tokens.dll 3587 93.48% 250 6.52%
moq.dll 5694 90.41% 604 9.59%
nunit.framework.dll 14375 77.02% 4289 22.98%
nunit3.testadapter.dll 1379 59.70% 931 40.30%
serilog.dll 3308 79.85% 835 20.15%
system.identitymodel.tokens.jwt.dll 1663 84.16% 313 15.84%
ReneSchumacher commented 4 years ago

Hi @aidamus,

our task does not calculate the coverage itself. Thus, you cannot configure it for specific assemblies. You have to to this while collecting the coverage data using (e.g.) a runsettings file. See https://docs.microsoft.com/en-us/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file?view=vs-2019 and https://docs.microsoft.com/en-us/visualstudio/test/customizing-code-coverage-analysis?view=vs-2019 for more information.

I'll leave this issue open for a couple more days just in case you need more assistance.

Happy building, René

aidamus commented 4 years ago

it makes sense! I managed to get it working using the runsettings file. Thanks a lot!