2
votes

I have a Visual Studio solution consisting of several projects. I set a build process for it in TeamCity, and I have added a an NUnit runner build step, with these settings:

  • nunit runner 2.6.3
  • run tests from: %teamcity.build.workingDir%\Sources\**\bin\*.Web.UnitTests.dll
  • .net coverage tool: JetBrains dotCover
  • Filters: --empty--

In the Code Coverage tab of the build, under Coverage Breakdown, I can only see:

  • MyProject.Domain
  • MyProject.Web.UnitTests

MyProject.Web, the object of the tests, and a few other assemblies in the solution are not displayed there, and are ignored by the dotCover code coverage calculations. Why? How can I tell it which assemblies to use?

I've unsuccessfully tried various +: / -: combinations in the Filters field. But with Filters empty, I am expecting MyProject.Web to be included, since MyProject.Domain is - why isn't it included?

2

2 Answers

1
votes

Are you building in Release or Debug mode? I had the same problem with Release mode and had to enable PDB output which is what dotCover requires to determine the code coverage. PDB is not enabled by default for Release builds.

To enable it go to Project Settings -> Build -> Advanced (button at the bottom) -> Debug Info -> Choose "pdb-only" or "full".

Additionally, dotCover provides this statement when no code coverage can be determined. It may be helpful to check all of the reasons listed:

No executable code was detected.

The issue could be caused by one of the following:

  • Include / exclude patterns are incorrect
  • Assemblies are compiled without debugging information
  • .pdb files are not available
  • Visual Studio code coverage is enabled for MSTest
  • .testrunconfig is used for MSTest and Visual Studio code coverage is not disabled (CodeCoverage section with enable="true" is present)
0
votes

I'm afraid without log files and your snapshot it will be difficult to provide the right answer. Please submit a request and attach the files: http://dotnettools-support.jetbrains.com/anonymous_requests/new

If logs are not enabled yet, add the corresponding parameter to your build configuration to activate them: https://confluence.jetbrains.com/display/TCD9/Reporting+Issues#ReportingIssues-dotCoverIssues