Breaking changes in Ncover 3.0 integration with Cruise Control .Net

 

There were some changes to the nCover xml reports for code coverage which will break your existing integration with cruise control .net. Specifically if you use the Statistics feature of Cruise Control which is one of the best features it provides IMHO, the xml nodes have changed and ncover no longer provides the total percent of coverage of the project as a single xml Node (or attribute).  This means that you need to do a little more work..(not much) in order to have your code coverage collected as part of the ongoing statistics inside cruise control.

 

You can view the statistics through this link on the project page inside the CCNet Web dashboard.

image

 

The coverage is not being collected with the new version of ncover…

image

 

Here is the ugly side of Cruise Control .Net.. The xml configuration.  I know it is ugly and painful to deal with… The line underlined is the new xpath selection for code coverage.

<statistics >
    <statisticList>
        <statistic name="Coverage"         
         xpath=" (//trendcoveragedata/stats/@vsp div ( //trendcoveragedata/stats/@vsp + //trendcoveragedata/stats/@usp ) ) * 100 "
         generateGraph="true"/>
         …
    </statisticList>
</statistics>

 

The old xml node for selecting the coverage was a firstMatch element, that must now be a statistic element.  The old xPath must be replaced with this horrible statement which calculates the percentage of code coverage for the project.  It helps to know that VSP = Visited Sequence Point and USP= Unvisited Sequence Point.  Once you know that the rest falls into place.

 

Once the data is collected it falls into place and shows up in the trend chart…. 

image

Related Articles:

Post Footer automatically generated by Add Post Footer Plugin for wordpress.

About Eric Hexter

I am the CTO for QuarterSpot. I (co)Founded MvcContrib, Should, Solution Factory, and Pstrami open source projects. I have co-authored MVC 2 in Action, MVC3 in Action, and MVC 4 in Action. I co-founded online events like mvcConf, aspConf, and Community for MVC. I am also a Microsoft MVP in ASP.Net.
This entry was posted in .Net, agile, CC.Net, OSS, testing, Tools. Bookmark the permalink. Follow any comments here with the RSS feed for this post.