NCover through CCnet (having troubles)

NCover through CCnet (having troubles)

Hi,

I'm very new to CCNet and NCover. I have CruiseControl setup to build my projects, run mstest results, and display the results on the web dashboard. I've recently tried to intergrate NCover into this build by adding a call to the NCover console in my CCNet.config file like so:

C:\Program Files\NCover\NCover.Console.exe Source\ProjectX "C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\mstest.exe" /testmetadata:ProjectX.vsmdi /testlist:All /runconfig:LocalTestRun.testrunconfig /resultsfile:TestResults.trx //xml c:\dev\ProjectX-artifacts\coverage.xml 1800

and merging like so:

c:\dev\ProjectX-artifacts\coverage.xml c:\dev\ProjectX\Source\ProjectX\TestResults.trx

In my dashboard config I am using the standard NCover xsl

xsl\NCoverSummary.xsl

and

< xslReportBuildPlugin description="NCover Report" actionName="NCoverBuildReport" xslFileName="xsl\NCover.xsl" />

Now, it seems to execute all of the test's fine and generate a coverage.xml file that is about 5meg. However, when I click on the "NCover Report" on the ccnet dashboard a blank page shows up with this written at the top:

NCover - Test Coverage: NaN%
Untested Code:

When I open the generated coverage.xml file in the NCoverExplorer it lists all of the test cases in my projects but they are all red with 0% next to them in the left hand column (as if nothing was covered). I'm not sure what I am doing wrong, would anyone please have any pointers?

P.S I am not using NUnit etc

Thanks.


RE: NCover through CCnet (having troubles)

Is this NCover 3 or 2?

The xsl for NCover 3 is called NCoverReporting30.xsl. NCoverSummary is from 2.0.

Also the trx file is what type of file?

Also for mstest you need the //pm switch if I recall correctly.

Hope that helps till morning here.

Joe


RE: NCover through CCnet (having troubles)

Thanks for the reply : ) I'm running NCover 3.

The trx file is a "Visual Studio Test Results File". Pretty much the generated results of running the *.vsmdi file (that is a list of tests from the "Test List Editor" with in visual studio).

I wasn't sure about using the NCoverReporting30.xsl as the readme in the NCover directory states:

"Add a NAnt or MSBuild task running NCover.Reporting.exe which will process the coverage.xml file(s) to produce an xml report output."

Would I be able to add this MSBuild task to my ccnet.config file somehow? (I don't use NAnt). As I have about 35 different projects listed in the visual studio solution, would I need to alter the MSBuild file of each one to include this type of task?

Ill try to add the //pm switch

Thanks again for your reply.


RE: NCover through CCnet (having troubles)

I am not at work but I know people use the msbuild tasks in cc.net.

Email support and tell them to look at post 935.

We can send you a sample on how to get it up and running.

I am not sure where the old scripts came from but only ncoverreporting30.xsl is valid.

The trx file wont be a file we can read, but if you are using team edition, we can read the old coverage files from tfs.

I am not an MSBuild expert, I will have support get back to you on that.

Joe


RE: NCover through CCnet (having troubles)

Got the explorer to load up the correctly generated results by adding a pm call as the last parametre like you said: '//pm vstesthost.exe'. Which is the process that handles mstest's execution, thanks for that joe!

C:\Program Files\NCover\NCover.Console.exe Source\ProjectX "C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\mstest.exe" /testmetadata:ProjectX.vsmdi /testlist:All /runconfig:LocalTestRun.testrunconfig /resultsfile:TestResults.trx //xml c:\dev\ProjectX-artifacts\coverage.xml //pm vstesthost.exe 1800

And got the report to generate properly with the following:

C:\Program Files\NCover\NCover.Reporting.exe C:\dev\ProjectX-artifacts\coverage.xml //op C:\dev\ProjectX-artifacts\CoverageReport.xml //r SymbolModule //rf Xml

With merging like so:

c:\dev\ProjectX-artifacts\CoverageReport.xml c:\dev\ProjectX\Source\ProjectX\TestResults.trx

In case anyone else has this same problem. : )


RE: NCover through CCnet (having troubles)

I am having the smae issue with nant and CC.net

I have configured my nant script using the script helper



  
  
  
  
  
  
  
  


  
    
  

I have made all the changes to cc.net webdashboard. I can see the pentip.ncover.xml file and it has content but when I click on the CC.net NCover report I just get.

NCover - Test Coverage: NaN% Untested Code:


RE: NCover through CCnet (having troubles)

I'm not sure if you're doing so or not, but with CruiseControl.NET you need to include a report generation step with your build script. In it you will want to generate a report in XML format. It will probably look something like:

<!-- additional property -->

<!-- at the end of the coverage target -->

Then, change your CruiseControl.NET settings to merge pentip.coveragereport.xml instead of pentip.ncover.xml.