NCover 3.0 merge coverage issue

I am trying to get NCover working using the Teamcity 5.0 MSBuild runner UI but I am running into issues when it tries to merge the results from my various tests (which are passing and the results are present in the website UI).  Any help would be great since I am very new to build scripts/build servers.

MSBuild Run Platform: x64
.NET Coverage tool: NCover (3.x)
Run NCover under: x64
NCover Arguments: //ias .*
NCover Reporting Arguments: //or FullCoverageReport:Html:{teamcity.report.path}
In my MSBuild file I am using:
<UsingTask TaskName="NUnit" AssemblyFile="$(teamcity_dotnet_nunitlauncher_msbuild_task)" />
<NUnit Assemblies="%(TestAssemblies.FullPath)" Platform="x64" HaltIfTestFailed="False" NUnitVersion="NUnit-2.5.3" />

Below is the error from the build log (which happens at the end of the build)
************* Excerpt from build log ******************
Merging and Reporting for NCover
Copyright (c) 2007 - 2009 Gnoso Inc.
License Key: **********************
http://www.ncover.com

Processing report settings from the command line.
Execution Time: 20,893 ms
[14:18:13]: [Merge coverage results] Error: -------------------------------------------------------------------------------
---- Top level exception: System.Exception
An error occurred while loading your coverage file: Duplicate class was added.
   at NCover.Framework.Reports.ReportingProcessor.CreateCoverageView(List`1 filenames, ICoverageReportSettings sett)
   at NCover.Framework.Reports.ReportingProcessor.Process()
   at NCover.Reporting.ReportMain.RunReport(String[] args, IOutputWriter output)

---- Inner exception: System.ApplicationException
Duplicate class was added.
   at NCover.Framework.Models.NCover2.NCover2CoverageNamespace.CreateClass(String name, String signature, Boolean doNotAppend)
   at NCover.Framework.Models.NCover2.NCover2CoverageNamespace.CreateClass(String name, String signature)
   at NCover.Framework.Models.Merge.MergeCoverageModel.ProcessClasses(ICoverageModelModule destModule, ICoverageModelNamespace destNs, ICoverageModelNamespace sourceNs, Dictionary`2 documentMap, Dictionary`2 documentList, Boolean isMerge)
   at NCover.Framework.Models.Merge.MergeCoverageModel.ProcessNamespaces(ICoverageModelModule destModule, ICoverageModelModule sourceModule, Dictionary`2 documentMap, Dictionary`2 documentList, Boolean isMerge)
   at NCover.Framework.Models.Merge.MergeCoverageModel.ProcessModules(ICoverageModel model, Dictionary`2 documentMap, Dictionary`2 documentList, Boolean isMerge)
   at NCover.Framework.Models.Merge.MergeCoverageModel..ctor(ICoverageModel model, MergeFilterMode mode)
   at NCover.Framework.Utilities.CoverageLoader.Merge(ICoverageView originalView, List`1 paths, MergeFilterMode mode)
   at NCover.Framework.Utilities.CoverageLoader.Merge(List`1 paths, MergeFilterMode mode)
   at NCover.Framework.Reports.ReportingProcessor.CreateCoverageView(List`1 filenames, ICoverageReportSettings sett)
-------------------------------------------------------------------------------



Thank you for your time
1 comment

TeamCity starts several processes under NCover to run the tests. The outcome is the set of NCover report files. TeamCity merges those report files to produce full report. Is seems NCover failed to merge reports with same classes inside. Do you know is that possible to merge such reports with use of come NCover3 commandline argumetns?

The workaround is to replace % with @ in <NUnit> task Assemblies attribute.

0

Please sign in to leave a comment.