nCover not generating the Report html

So I've been evaluating partCover and nCover for inclusion in our TeamCity builds. I've got most of the way there with nCover but have run into an issue.

I'm using msBuild, native nUnit 2.5.2 (not the one included with TeamCity) and nCover 3.

My build script includes:


<Target Name="Coverage" DependsOnTargets="Init">
        <NCover ToolPath="C:\Program Files\NCover\" TestRunnerExe="$(NUnitConsoleExe)" TestRunnerArgs="$(SolutionRootDirectory)\Build\bin\Debug\Microcosm.UnitTest.dll" CoverageFile="$(SolutionRootDirectory)\Build\artifacts\Coverage.xml"/>

        <Message Text="##teamcity[dotNetCoverage ncover3_home='C:\Program Files\nCover\ncover.console.exe']" />

        <Message Text="##teamcity[importData type='dotNetCoverage' tool='ncover3' path='$(SolutionRootDirectory)\Build\artifacts\Coverage.xml']" />
 
        <Message Text="##teamcity[dotNetCoverage ncover3_reporter_args='//or FullCoverageReport:Html:{teamcity.report.path}']" />

    </Target>



The Coverage.xml file is generated just fine. However, no report html is ever generated so no Coverage tab ever appears on the build results.

In addition to the service messages above, my TeamCity configuration looks like so:

ncover.jpg

My logs include the following:

Symbol Coverage: 66.67%

[12:53:54]: [Project "build.proj.teamcity.patch.tcprojx" (Test target(s)):] Branch Coverage: 4.30%
[12:53:54]: [Project "build.proj.teamcity.patch.tcprojx" (Test target(s)):] Coverage File: D:\BuildAgent\work\4727c970e26fffd6\Build\artifacts\Coverage.xml
[12:53:54]: [Project "build.proj.teamcity.patch.tcprojx" (Test target(s)):] ##teamcity[dotNetCoverage ncover3_home='C:\Program Files\nCover\ncover.console.exe']
[12:53:54]: [Project "build.proj.teamcity.patch.tcprojx" (Test target(s)):] ##teamcity[importData type='dotNetCoverage' tool='ncover3' path='D:\BuildAgent\work\4727c970e26fffd6\Build\artifacts\Coverage.xml']
[12:53:54]: [Project "build.proj.teamcity.patch.tcprojx" (Test target(s)):] ##teamcity[dotNetCoverage ncover3_reporter_args='//or FullCoverageReport:Html:{teamcity.report.path}']
[12:53:54]: Key 'ncover3_home' value 'C:\Program Files\NCover\ncover.console.exe' was overridden with 'C:\Program Files\nCover\ncover.console.exe'
[12:53:54]: Key 'ncover3_reporter_args' value '//ias .*' was overridden with '//or FullCoverageReport:Html:{teamcity.report.path}'
[12:53:54]: Importing data from 'D:\BuildAgent\work\4727c970e26fffd6\Build\artifacts\Coverage.xml' with 'dotNetCoverage' processor
[12:53:55]: Waiting for 1 service processes to complete
[12:53:55]: Processing 1 coverage report(s)
[12:53:55]: There is no .NET Coverage report generator for type 'ncover3'. Skipped files: [D:\BuildAgent\work\4727c970e26fffd6\Build\artifacts\Coverage.xml]

A few weird things highlighted in bold above.

What am I missing?

Thanks!
Kevin

8 comments

Please issue all ##teamcity[dotNetCoverage messages before a first attempt of reporting coverage data into TeamCity.

0

I've attempted the following with the same results - still getting that error.

<UsingTask TaskName="NCover.MSBuildTasks.NCover" AssemblyFile="C:\Program Files\NCover\Build Task Plugins\NCover.MSBuildTasks.dll" />
 <Using Task TaskName="NCover.MSBuildTasks.NCoverReporting" AssemblyFile="C:\Program Files\NCover\Build Task Plugins\NCover.MSBuildTasks.dll" />   

<Target Name="Coverage" DependsOnTargets="Init">
 
        <Message Text="##teamcity[dotNetCoverage ncover3_home='C:\Program Files\nCover\ncover.console.exe']" />           
        <Message Text="##teamcity[importData type='dotNetCoverage' tool='ncover3' path='$(SolutionRootDirectory)\Build\artifacts\Coverage.xml']" /> 
        <Message Text="##teamcity[dotNetCoverage ncover3_reporter_args='//or FullCoverageReport:Html:{teamcity.report.path}']" />
         <NCover ToolPath="C:\Program Files\NCover\" TestRunnerExe="$(NUnitConsoleExe)" TestRunnerArgs="$(SolutionRootDirectory)\Build\bin\Debug\Microcosm.UnitTest.dll" CoverageFile="$(SolutionRootDirectory)\Build\artifacts\Coverage.xml"/>  
</Target>

0

Try this:

<UsingTask TaskName="NCover.MSBuildTasks.NCover" AssemblyFile="C:\Program Files\NCover\Build Task Plugins\NCover.MSBuildTasks.dll" />
<Using Task TaskName="NCover.MSBuildTasks.NCoverReporting" AssemblyFile="C:\Program Files\NCover\Build Task Plugins\NCover.MSBuildTasks.dll" />  

<Target Name="Coverage" DependsOnTargets="Init">

        <Message Text="##teamcity[dotNetCoverage ncover3_home='C:\Program Files\nCover\ncover.console.exe']" />          
        <Message Text="##teamcity[dotNetCoverage ncover3_reporter_args='//or FullCoverageReport:Html:{teamcity.report.path}']" />



        <!-- Import data SHOULD go after all  dotNetCoverage -->
        <Message Text="##teamcity[importData type='dotNetCoverage' tool='ncover3' path='$(SolutionRootDirectory)\Build\artifacts\Coverage.xml']" />

        <NCover ToolPath="C:\Program Files\NCover\" TestRunnerExe="$(NUnitConsoleExe)" TestRunnerArgs="$(SolutionRootDirectory)\Build\bin\Debug\Microcosm.UnitTest.dll" CoverageFile="$(SolutionRootDirectory)\Build\artifacts\Coverage.xml"/>
</Target>

0

Unfortunately, it still fails with the same error.

0

Please attach build log and debug logs from the build agent as described at
http://confluence.jetbrains.net/display/TCD5/Reporting+Issues

0

Hopefully this includes all necessary files!



Attachment(s):
TCLogs.zip.zip
0

nCover support got to the bottom of this:

I had been using the full path to the nCover exe. What is required is the path to the location:

<Message Text="##teamcity[dotNetCoverage ncover3_home='C:\Program Files\nCover\']" />

0

Thank you! I fixed up the documentation on it

0

Please sign in to leave a comment.