Do I miss anything in .NET code coverage settings?
I'm trying to generate code coverage by TC5 and NCover 3.x. TC produces artifacts which include coverage.zip and .teamcity/.NETCoverage/CoverageReport.xml (as in the screenshot). The 'Code Coverage' tab only shows "This is an autogenerated index file (there was no index.html found in the generated report)."
In .NET Coverage section of Build Runner page, I select NCover 3 and set 'Path to NCover 3' to 'C:\Program Files\NCover'. Do I miss anything to get the Code Coverage tab works?
I'm using latest TC5 EAP build and NCover 3, the build runner is sln2008.
Attachment(s):
coverage.png
Please sign in to leave a comment.
Please add necessary commandline attributes to NCover report generatior to get report generated. Use '//or FullCoverageReport:Html:{teamcity.report.path}' for example
Hi Eugene,
If I added 'FullCoverageReport:Html:{teamcity.report.path}' to NCover Reporting Arguments field, the result is same. The 'Code Coverage' tab still only shows "This is an autogenerated index file (there was no index.html found in the generated report)."
If I added '//', there is no 'Code Coverage' tab anymore.
I'm using latest version of TC (v5 build 10669)
Please make it generate more that one report file. There was a bug. Let me know if you need a patch.
Please send me the patch to t800t8 at hotmail dot com. Thanks.
Please try TeamCity 5.0.1
Still no luck with 5.0.1. The problem still remains.
Please specify the following values:
NCover Arguments: //ias .*
NCover Reporting Arguments: //or FullCoverageReport:Html:{teamcity.report.path}
Please check you run NUnit tests under same x86/x64 as the NCover.
Does this works?
If I add '//ias.*' to NCover Arguments field, I have a fail build with error:
[19:42:03]: Project "TC5NetCodeCoverage.sln.teamcity.patch.tcprojx" (Build_TeamCity_generated_608b9f586008440b807c346dea97c965;NUnit_TeamCity_generated_608b9f586008440b807c346dea97c965 target(s)): (7s)
[19:42:10]: [Project "TC5NetCodeCoverage.sln.teamcity.patch.tcprojx" (Build_TeamCity_generated_608b9f586008440b807c346dea97c965;NUnit_TeamCity_generated_608b9f586008440b807c346dea97c965 target(s)):] D:\Works\TeamCityBuildAgent\BuildAgent\work\9935fa871ae7e5bd\TC5NetCodeCoverage.sln.teamcity.patch.tcprojx(10, 5): D:\Works\TeamCityBuildAgent\BuildAgent\plugins\dotnetPlugin\bin\JetBrains.BuildServer.NUnitLauncher.exe "@@" D:\Works\TeamCityBuildAgent\BuildAgent\temp\buildTmp\tmp1021.tmp exited with code 20000.
Both NUnit and NCover were set to x86.
Here is full log:
[19:50:07]: Checking for changes
[19:50:07]: Clearing temporary directory: D:\Works\TeamCityBuildAgent\BuildAgent\temp\buildTmp
[19:50:07]: Checkout directory: D:\Works\TeamCityBuildAgent\BuildAgent\work\9935fa871ae7e5bd
[19:50:07]: Updating sources: server side checkout...
[19:50:07]: [Updating sources: server side checkout...] Building incremental patch for VCS root: TC5NetCodeCoverage - Trunk
[19:50:07]: [Updating sources: server side checkout...] Repository sources transferred
[19:50:07]: Starting build process in D:\Works\TeamCityBuildAgent\BuildAgent\work\9935fa871ae7e5bd
[19:50:08]: Project "TC5NetCodeCoverage.sln.teamcity.patch.tcprojx" (Build_TeamCity_generated_094f3a56fc2a46d08d9f8c766e34872b;NUnit_TeamCity_generated_094f3a56fc2a46d08d9f8c766e34872b target(s)): (6s)
[19:50:08]: [Project "TC5NetCodeCoverage.sln.teamcity.patch.tcprojx" (Build_TeamCity_generated_094f3a56fc2a46d08d9f8c766e34872b;NUnit_TeamCity_generated_094f3a56fc2a46d08d9f8c766e34872b target(s)):] Project "TC5NetCodeCoverage.sln" (Rebuild target(s)): (1s)
[19:50:08]: [Project "TC5NetCodeCoverage.sln" (Rebuild target(s)):] Building solution configuration "Debug|Any CPU".
[19:50:08]: [Project "TC5NetCodeCoverage.sln" (Rebuild target(s)):] Project "MyLib.csproj" (Rebuild target(s)):
[19:50:08]: [Project "MyLib.csproj" (Rebuild target(s)):] Deleting file "D:\Works\TeamCityBuildAgent\BuildAgent\work\9935fa871ae7e5bd\MyLib\bin\Debug\MyLib.dll".
[19:50:08]: [Project "MyLib.csproj" (Rebuild target(s)):] Deleting file "D:\Works\TeamCityBuildAgent\BuildAgent\work\9935fa871ae7e5bd\MyLib\bin\Debug\MyLib.pdb".
[19:50:08]: [Project "MyLib.csproj" (Rebuild target(s)):] Deleting file "D:\Works\TeamCityBuildAgent\BuildAgent\work\9935fa871ae7e5bd\MyLib\obj\Debug\MyLib.dll".
[19:50:08]: [Project "MyLib.csproj" (Rebuild target(s)):] Deleting file "D:\Works\TeamCityBuildAgent\BuildAgent\work\9935fa871ae7e5bd\MyLib\obj\Debug\MyLib.pdb".
[19:50:08]: [Project "MyLib.csproj" (Rebuild target(s)):] Successfully cleaned the output for 0 EDMX files.
[19:50:08]: [Project "MyLib.csproj" (Rebuild target(s)):] Processing 0 EDMX files.
[19:50:08]: [Project "MyLib.csproj" (Rebuild target(s)):] Finished processing 0 EDMX files.
[19:50:08]: [Project "MyLib.csproj" (Rebuild target(s)):] C:\WINDOWS\Microsoft.NET\Framework\v3.5\Csc.exe /noconfig /nowarn:1701,1702 /errorreport:prompt /warn:4 /define:DEBUG;TRACE /reference:"c:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5\System.Core.dll" /reference:"c:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5\System.Data.DataSetExtensions.dll" /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Data.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Xml.dll /reference:"c:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5\System.Xml.Linq.dll" /debug+ /debug:full /filealign:512 /optimize- /out:obj\Debug\MyLib.dll /target:library Calculator.cs Properties\AssemblyInfo.cs
[19:50:09]: [Project "MyLib.csproj" (Rebuild target(s)):] Copying file from "obj\Debug\MyLib.dll" to "bin\Debug\MyLib.dll".
[19:50:09]: [Project "MyLib.csproj" (Rebuild target(s)):] MyLib -> D:\Works\TeamCityBuildAgent\BuildAgent\work\9935fa871ae7e5bd\MyLib\bin\Debug\MyLib.dll
[19:50:09]: [Project "MyLib.csproj" (Rebuild target(s)):] Copying file from "obj\Debug\MyLib.pdb" to "bin\Debug\MyLib.pdb".
[19:50:09]: [Project "TC5NetCodeCoverage.sln" (Rebuild target(s)):] Project "MyLib.Tests.csproj" (Rebuild target(s)):
[19:50:09]: [Project "MyLib.Tests.csproj" (Rebuild target(s)):] Deleting file "D:\Works\TeamCityBuildAgent\BuildAgent\work\9935fa871ae7e5bd\MyLib.Tests\bin\Debug\MyLib.Tests.dll".
[19:50:09]: [Project "MyLib.Tests.csproj" (Rebuild target(s)):] Deleting file "D:\Works\TeamCityBuildAgent\BuildAgent\work\9935fa871ae7e5bd\MyLib.Tests\bin\Debug\MyLib.Tests.pdb".
[19:50:09]: [Project "MyLib.Tests.csproj" (Rebuild target(s)):] Deleting file "D:\Works\TeamCityBuildAgent\BuildAgent\work\9935fa871ae7e5bd\MyLib.Tests\bin\Debug\MyLib.dll".
[19:50:09]: [Project "MyLib.Tests.csproj" (Rebuild target(s)):] Deleting file "D:\Works\TeamCityBuildAgent\BuildAgent\work\9935fa871ae7e5bd\MyLib.Tests\bin\Debug\nunit.framework.dll".
[19:50:09]: [Project "MyLib.Tests.csproj" (Rebuild target(s)):] Deleting file "D:\Works\TeamCityBuildAgent\BuildAgent\work\9935fa871ae7e5bd\MyLib.Tests\bin\Debug\MyLib.pdb".
[19:50:09]: [Project "MyLib.Tests.csproj" (Rebuild target(s)):] Deleting file "D:\Works\TeamCityBuildAgent\BuildAgent\work\9935fa871ae7e5bd\MyLib.Tests\obj\Debug\ResolveAssemblyReference.cache".
[19:50:09]: [Project "MyLib.Tests.csproj" (Rebuild target(s)):] Deleting file "D:\Works\TeamCityBuildAgent\BuildAgent\work\9935fa871ae7e5bd\MyLib.Tests\obj\Debug\MyLib.Tests.dll".
[19:50:09]: [Project "MyLib.Tests.csproj" (Rebuild target(s)):] Deleting file "D:\Works\TeamCityBuildAgent\BuildAgent\work\9935fa871ae7e5bd\MyLib.Tests\obj\Debug\MyLib.Tests.pdb".
[19:50:09]: [Project "MyLib.Tests.csproj" (Rebuild target(s)):] Successfully cleaned the output for 0 EDMX files.
[19:50:09]: [Project "MyLib.Tests.csproj" (Rebuild target(s)):] Processing 0 EDMX files.
[19:50:09]: [Project "MyLib.Tests.csproj" (Rebuild target(s)):] Finished processing 0 EDMX files.
[19:50:09]: [Project "MyLib.Tests.csproj" (Rebuild target(s)):] Project "MyLib.csproj" (GetTargetPath target(s)):
[19:50:09]: [Project "MyLib.Tests.csproj" (Rebuild target(s)):] Project "MyLib.csproj" (GetNativeManifest target(s)):
[19:50:09]: [Project "MyLib.Tests.csproj" (Rebuild target(s)):] C:\WINDOWS\Microsoft.NET\Framework\v3.5\Csc.exe /noconfig /nowarn:1701,1702 /errorreport:prompt /warn:4 /define:DEBUG;TRACE /reference:D:\Works\TeamCityBuildAgent\BuildAgent\work\9935fa871ae7e5bd\MyLib\bin\Debug\MyLib.dll /reference:..\lib\nunit.framework.dll /reference:"c:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5\System.Core.dll" /reference:"c:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5\System.Data.DataSetExtensions.dll" /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Data.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Xml.dll /reference:"c:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5\System.Xml.Linq.dll" /debug+ /debug:full /filealign:512 /optimize- /out:obj\Debug\MyLib.Tests.dll /target:library CalculatorTest.cs Properties\AssemblyInfo.cs
[19:50:09]: [Project "MyLib.Tests.csproj" (Rebuild target(s)):] Copying file from "D:\Works\TeamCityBuildAgent\BuildAgent\work\9935fa871ae7e5bd\MyLib\bin\Debug\MyLib.dll" to "bin\Debug\MyLib.dll".
[19:50:09]: [Project "MyLib.Tests.csproj" (Rebuild target(s)):] Copying file from "..\lib\nunit.framework.dll" to "bin\Debug\nunit.framework.dll".
[19:50:09]: [Project "MyLib.Tests.csproj" (Rebuild target(s)):] Copying file from "D:\Works\TeamCityBuildAgent\BuildAgent\work\9935fa871ae7e5bd\MyLib\bin\Debug\MyLib.pdb" to "bin\Debug\MyLib.pdb".
[19:50:09]: [Project "MyLib.Tests.csproj" (Rebuild target(s)):] Project "MyLib.csproj" (GetCopyToOutputDirectoryItems target(s)):
[19:50:09]: [Project "MyLib.Tests.csproj" (Rebuild target(s)):] Copying file from "obj\Debug\MyLib.Tests.dll" to "bin\Debug\MyLib.Tests.dll".
[19:50:09]: [Project "MyLib.Tests.csproj" (Rebuild target(s)):] MyLib.Tests -> D:\Works\TeamCityBuildAgent\BuildAgent\work\9935fa871ae7e5bd\MyLib.Tests\bin\Debug\MyLib.Tests.dll
[19:50:09]: [Project "MyLib.Tests.csproj" (Rebuild target(s)):] Copying file from "obj\Debug\MyLib.Tests.pdb" to "bin\Debug\MyLib.Tests.pdb".
[19:50:10]: [Project "TC5NetCodeCoverage.sln.teamcity.patch.tcprojx" (Build_TeamCity_generated_094f3a56fc2a46d08d9f8c766e34872b;NUnit_TeamCity_generated_094f3a56fc2a46d08d9f8c766e34872b target(s)):] D:\Works\TeamCityBuildAgent\BuildAgent\plugins\dotnetPlugin\bin\JetBrains.BuildServer.NUnitLauncher.exe "@@" D:\Works\TeamCityBuildAgent\BuildAgent\temp\buildTmp\tmp1059.tmp
[19:50:14]: ##teamcity[importData type='dotNetCoverage' tool='ncover3' file='D:\Works\TeamCityBuildAgent\BuildAgent\temp\buildTmp\tmp105F.tmp']
[19:50:15]: Importing data from 'D:\Works\TeamCityBuildAgent\BuildAgent\temp\buildTmp\tmp105F.tmp' with 'dotNetCoverage' processor
[19:50:15]: [Project "TC5NetCodeCoverage.sln.teamcity.patch.tcprojx" (Build_TeamCity_generated_094f3a56fc2a46d08d9f8c766e34872b;NUnit_TeamCity_generated_094f3a56fc2a46d08d9f8c766e34872b target(s)):] D:\Works\TeamCityBuildAgent\BuildAgent\work\9935fa871ae7e5bd\TC5NetCodeCoverage.sln.teamcity.patch.tcprojx(10, 5): D:\Works\TeamCityBuildAgent\BuildAgent\plugins\dotnetPlugin\bin\JetBrains.BuildServer.NUnitLauncher.exe "@@" D:\Works\TeamCityBuildAgent\BuildAgent\temp\buildTmp\tmp1059.tmp exited with code 20000.
[19:50:15]: sln2008 output:
***************** Exception *****************
NCover.Console is returning exit code #20000
-------------------------------------------------------------------------------
---- Top level exception: System.ApplicationException
Unable to parse command line.
at NCover.Framework.RunSettingsFactory.ParseRunSettingsFromCommandArgs(String[] args, List`1& deprecated)
at NCover.ConsoleMain.ConsoleMain.RunCoverage(String[] args, IOutputWriter output)
---- Inner exception: System.ArgumentException
Unrecognized command line option: '//ias.*'
at NCover.Framework.RunSettingsFactory.ProcessArgument(String[] arg, Int32& i, ICoverageModelRunSettings& ps, List`1& deprecated)
at NCover.Framework.RunSettingsFactory.ParseRunSettingsFromCommandArgs(String[] args, List`1& deprecated)
-------------------------------------------------------------------------------
D:\Works\TeamCityBuildAgent\BuildAgent\work\9935fa871ae7e5bd\TC5NetCodeCoverage.sln.teamcity.patch.tcprojx(10,5): error : D:\Works\TeamCityBuildAgent\BuildAgent\plugins\dotnetPlugin\bin\JetBrains.BuildServer.NUnitLauncher.exe "@@" D:\Works\TeamCityBuildAgent\BuildAgent\temp\buildTmp\tmp1059.tmp exited with code 20000.
Done Building Project "D:\Works\TeamCityBuildAgent\BuildAgent\work\9935fa871ae7e5bd\TC5NetCodeCoverage.sln.teamcity.patch.tcprojx" (Build_TeamCity_generated_094f3a56fc2a46d08d9f8c766e34872b;NUnit_TeamCity_generated_094f3a56fc2a46d08d9f8c766e34872b target(s)) -- FAILED.
Build FAILED.
"D:\Works\TeamCityBuildAgent\BuildAgent\work\9935fa871ae7e5bd\TC5NetCodeCoverage.sln.teamcity.patch.tcprojx" (Build_TeamCity_generated_094f3a56fc2a46d08d9f8c766e34872b;NUnit_TeamCity_generated_094f3a56fc2a46d08d9f8c766e34872b target) (1) ->
(NUnit_TeamCity_generated_094f3a56fc2a46d08d9f8c766e34872b target) ->
D:\Works\TeamCityBuildAgent\BuildAgent\work\9935fa871ae7e5bd\TC5NetCodeCoverage.sln.teamcity.patch.tcprojx(10,5): error : D:\Works\TeamCityBuildAgent\BuildAgent\plugins\dotnetPlugin\bin\JetBrains.BuildServer.NUnitLauncher.exe "@@" D:\Works\TeamCityBuildAgent\BuildAgent\temp\buildTmp\tmp1059.tmp exited with code 20000.
0 Warning(s)
1 Error(s)
Time Elapsed 00:00:06.95
[19:50:15]: Process exit code: 1
[19:50:15]: Waiting for 1 service processes to complete
[19:50:15]: Build finished
Please try
//ias .*
Ah, there is a space between "//ias" and ".*".
But even with a space, Code Coverage tab only contains "This is an autogenerated index file (there was no index.html found in the generated report)."
Sorry for the delay in replying: we have national holidays here in Russia till January, 11 (our development is based in Saint-Petersburg, Russia).
Could you please attach your current NCover 3 and NUnit runner settings screenshot.
Do you run on x64 windows?
Please try the following settings:
NCover arguments: //ias .*
NCover reporting arguments: //or FullCoverageReport:Html:{teamcity.report.path}
No, I'm using Windows XP x86.
And here are screen shots (I tried as you suggested but it didn't help)
Attachment(s):
NCover.png
NUnit.png
please add "//or " (//or and space) before FullCoverageReport in NUcover reporting arguments.
Work likes a charm. Thanks you very much :-)