This Question is Assumed Answered

1 "correct" answer available (4 pts) 2 "helpful" answers available (2 pts)
7 Replies Last post: Feb 4, 2010 8:18 PM by Hussein Said  
Hussein Said Newbie 5 posts since
Jan 29, 2010
Currently Being Moderated

Jan 29, 2010 9:07 PM

Issue Running NCover 3 with TeamCity 5

Hi,

I am using NAnt runner to build an application and run some unit tests. All works fine, except NCover is not running. I enabled NCover for the NAnt runner, but I do not see the NCover running when I check my build logs.

Also, I noticed that the Code Coverage Settings information tab tells me the Code Coverage is disabled(see below), although I have selected NCover 3 from the drop downs in the runner. Our NAnt scripts are not using any teamCity special tasks, as they are running on CC.NET and TeamCity at the same time(migration to TeamCity underway) and we prefer not to modify them at this time. Do I have to use the TeamCity NUnit launcher for the coverage to work? is there another setting that I need to enable somewhere else(looked but couldn't find any). Help appreciated. Thanks...

Using NCover 3.3.2

Using TeamCity Professional Version 5.0.1 (build 10715)

 

Type of runner: NAnt (Runner for NAnt build files)
Build file: xxxxxxxx.build
Working directory: same as checkout directory
Targets: none specified
NAnt home: C:\Program Files\nant-0.85\bin
Target framework: net-2.0
Command line parameters to NAnt.exe: Rebuild executeNUniTest
Reduce test failure feedback time: OFF

 

Code coverage: disabled

 

 

.NET Code Coverage: NCover 3
Path to NCover 3: C:\Program Files\NCover\ncover.console.exe
Run NCover under: x86
NCover Arguments: view
NCover Reporting Arguments: view

XML report processing: enabled
Report type: nunit
Eugene Petrenko JetBrains 2,213 posts since
Oct 4, 2004
Currently Being Moderated
Feb 4, 2010 6:15 PM in response to: Hussein Said
Re: Issue Running NCover 3 with TeamCity 5

What was paremeter values hidden by 'view' links for keys:

NCover Arguments and NCover Reporting Arguments.
If those fields are empty, please fill those fields according to NCover documentation.
Thanks!

Eugene Petrenko JetBrains 2,213 posts since
Oct 4, 2004
Currently Being Moderated
Feb 4, 2010 7:54 PM in response to: Hussein Said
Re: Issue Running NCover 3 with TeamCity 5

Code coverage: disabled string was from Java coverage. In the next line it was shown that .NET Coverage was enabled.

 

I've checked parameters you've sent to me:

Please fix it in the following way:

 

report path: //or FullCoverageReport:Html:{teamcity.report.path}

 

NCover args: //ias .*

 

Please note, you do not need to specify any parameters related to output files or to

program to run from NCover. All you need is to specify are coverage gathering parameters.

 

Thanks!

Eugene Petrenko JetBrains 2,213 posts since
Oct 4, 2004
Currently Being Moderated
Feb 4, 2010 8:08 PM in response to: Hussein Said
Re: Issue Running NCover 3 with TeamCity 5

There are two way to start NUnit tests with NCover under TeamCity:

 

The first way: In your build script start NCover.Console with appropriate commandline and than

report generated NCover report .xml file to TeamCity.

##teamcity[importData type='dotNetCoverage' tool='<tool name>' path='<path to the results file>']

Please see the documentation page at:

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

 

Another way is to let TeamCity start NCover for you. It will be done automatically. All you need is to specify NCover parameters.

TeamCity will automatically add necessary arguments to start NUnit tests. I was describing this way for you in the previous post.

Note, this way requires NUnit tests to be started from <nunit2> NAnt task.

 

Thanks!

 

 

 

 

More Like This

  • Retrieving data ...