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)
Any help to this question is much appreciated from the community and Jetbrains. I have tried several other settings but so success yet.
What was paremeter values hidden by 'view' links for keys:
Thanks for the reply.
The settings I have:
NCover Arguments: //l C:\Coverage\Coverage.log //x C:\Coverage\Coverage.xml"C:\Program Files\NUnit 2.4.8\bin\nunit-console.exe" "\**\*.dll" /xml MyTestResult.xml
NCover Reporting Argument: FullCoverageReport:Html:{teamcity.report.path}.
With those setting, NCover is still not running.
In my original post, I indicated the following:
It seems that Code Coverage is diabled(see undelined senetnce below), but I am not sure this is for NCover since the settings are correct.
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!
Thanks. I tried replacing the args and I am still getting nothing. NUnits are not running. I am not sure if my NANT runner is interferring with NCover and I don't see why it would. I read somewher on the forum that for NCover to work, my NUnit tests needs to be launched by the TeamCity NUnitTestRunner(or something close to that name). I appreciate your help. Any ideas? D you need more information?
many thanks
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!
Thanks for the prompt response again. The NUnit taks is not using <nunit2> and I guess that is the issue. I will modify it and then try it.