What is the full scope of the code when I call dotCover from the MSTest build phase in TeamCity?

What is considered 100% when I call dotCover from the MSTest build phase in TeamCity? 100% of all compiled code? Is this all the code for all the assemblies that touched the tests? Are these all the classes touched by tests?

When I call dotCover from the TeamCity MSTest build phase that launches My.Tests.dll, which lines of code are being tracked?

+1
source share
2 answers

dotCover provides only instruction-level coverage reporting, where functions and branches are also included as other tools, such as NCover.

Using the TeamCity MSTest build phase, you can specify which builds you want to receive, which is reported in the Filters field. This allows you to simply specify an exception for the .Tests template or simply include a single assembly. See TeamCity documentation for more information: http://confluence.jetbrains.net/display/TCD7/JetBrains+dotCover

I believe that if you do not specify any filters, all the code in all assemblies that were loaded into the CLR is included (you must call the assembly from the code that you call, so some assemblies may not turn on, it's just lazy loading the CLR ) This is because tools like dotCover use the CLR profiling APIs and do not process your code in advance. Note that dotCover excludes assemblies from the GAC.

+2
source

I'm not sure that I fully understood your question, but still take a picture. As I understand it, 100% coverage means that each line of code in the project is executed by your test cases. This basically means that you have ensured that control is passed along every line of code in your project.

In general, I have never seen 100% coverage since it is very difficult to check every code path. Consider, for example, the different types of exceptions that are handled by your code, how do you use the catch block for each exception in a test case? You will need to somehow mimic an exception, which is not always easy.

0
source

Source: https://habr.com/ru/post/1205174/


All Articles