How do I enable PartCover code coverage with MSBuild task in TeamCity 5.0?

I am confused as to the steps I need to take to enable PartCover code coverage reporting for MSBuild build configuration in TeamCity 5.0.1.

I read this: http://www.jetbrains.net/confluence/display/TCD5/.NET+Code+Coverage

Which led me to update my MSBuild file to this:

  <Target Name="UnitTest">
    <CreateItem Include="$(BinaryDirectory)/*.Test.dll">
      <Output ItemName="UnitTestAssemblies" TaskParameter="Include" />
    </CreateItem>
    <Exec Command="$(teamcity_dotnet_nunitlauncher) v2.0 x86 NUnit-2.4.1 /partcover:&quot;C:\Program Files\Gubka Bob\PartCover .NET 2.3\PartCover.exe&quot; /partcover-arg:--output /partcover-arg:c:\Temp\result.xml @(UnitTestAssemblies)"
          IgnoreExitCode="False"/>
  </Target>



This works (with the exception that the script keeps going when tests fail).  But there are no code coverage results.  Then I found the configuration settings in the MSBuild section:

2009-12-31_1340.png
I could not find any help on this, and attempts to guess on how I should configure this failed.

Could you provide clear instructions on how I would enable PartCover code coverage for TeamCity 5.0?

Specifically,

  • What I need installed on the Build Agents
  • What changes I need to make to the MSBuild file, whether tests run in there need special handling to run PartCover
  • What changes I need to make to the build configuration
1 comment
Comment actions Permalink

goto http://www.jetbrains.net/devnet/message/5254329#5254329

t800t8 wrote:

The 'Code Coverage' field is for Java, if you change build runner to Ipr or Ant, you will see it.

0

Please sign in to leave a comment.