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.

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

 

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

Windows 7 Virtual PC FTW (For The Win) for virtual workstation development