TeamCity + dotCover, filter on class/function?

Using Team City 6.0 with integrated dotcover runner.

In the Visual Studio dotCover plugin I have the ability to express filters not only for assemblies (modules), but also classes and functions.

For instance, in VIsual Studio I have filters to exclude NUnit Tests (by classname) from coverage reporting, some tests have code that never will be code but must be there to compile but this shouldn't count to lower the coverage percent.


The help for Team City dotCover settings says:

"Specify assemblies filters for code coverage. On every line use +:myassembly or -:myassembly to include or exclude assembly from code coverage. Use asterisk (*) as wildcard if needed."

Is there some reason why the Team CIty can't use the same module-class-function filter semantics (or is there a separate undocumented syntax for these)?

Regards,
Kim
10 comments

try:
+:assembly=*;type=*;method=***

0

Thanks, seems to work as expected!

0

I must be thick, but I can't get it to work:

I can remove assemblies easily like this:
-:my.assembly
-:*.test

but when I try to remove specific types it doesn't work, I tried:

-:assembly=*;type=my.namespace.*service;method=***
and
-:assembly=my.assembly;type=my.namespace.classname;method=***

I also tried omitting ';method=***' but no result

0

Try method=*

If that does not work, please attach build agent logs

0

tried method=*, but it still doesn't work, see agent log below:


Found runner MSBuild for 31727 
[2010-12-13 10:46:10,343]   INFO - erStages.start.CallRunnerStage - 

Found runner MSBuild for 31727 
[2010-12-13 10:46:10,343]   INFO - erStages.start.CallRunnerStage - Start actual runner for build 31727 MSBuild 
[2010-12-13 10:46:10,343]   INFO - erStages.start.CallRunnerStage - ----------------------------------------- [ PROactive Printed Reports::Build [dev] #7.0.3.3 (buildId = 31727) ] ----------------------------------------- 
[2010-12-13 10:46:10,374]   INFO - nner2.OsProcessHandlerListener - C:\TeamCity\BuildAgent\plugins\dotnetPlugin\bin\JetBrains.BuildServer.MsBuildBootstrap.exe /workdir:C:\TeamCity\BuildAgent\work\5af2a951370605de /msbuildPath:C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe 
[2010-12-13 10:47:19,681]   INFO - nner2.OsProcessHandlerListener -  
[2010-12-13 10:47:19,759]   INFO - mpl$TeamCitySpringSubConatiner - Closing jetbrains.buildServer.spring.SpringSubContainerFactroyImpl$TeamCitySpringSubConatiner@1374a58: display name [SubContext: running build runner context id=31,727 runner 1 of 2]; startup date [Mon Dec 13 10:46:10 GMT 2010]; parent: jetbrains.buildServer.spring.SpringSubContainerFactroyImpl$TeamCitySpringSubConatiner@4cf08e 
[2010-12-13 10:47:19,759]   INFO - mpl$TeamCitySpringSubConatiner - Refreshing jetbrains.buildServer.spring.SpringSubContainerFactroyImpl$TeamCitySpringSubConatiner@1caa0b6: display name [SubContext: running build runner context id=31,727 runner 2 of 2]; startup date [Mon Dec 13 10:47:19 GMT 2010]; parent: jetbrains.buildServer.spring.SpringSubContainerFactroyImpl$TeamCitySpringSubConatiner@4cf08e 
[2010-12-13 10:47:19,806]   INFO - mpl$TeamCitySpringSubConatiner - Bean factory for application context [jetbrains.buildServer.spring.SpringSubContainerFactroyImpl$TeamCitySpringSubConatiner@1caa0b6]: org.springframework.beans.factory.support.DefaultListableBeanFactory@1930208 
[2010-12-13 10:47:19,822]   INFO - ildStages.RunnerStagesExecutor - Call stage jetbrains.buildServer.agent.impl.buildStages.LogBuildRunnerInformation 
[2010-12-13 10:47:19,822]   INFO - ildStages.RunnerStagesExecutor - Call stage jetbrains.buildServer.agent.impl.buildStages.runnerStages.start.CreateBuildWorkingDirectoryStage 
[2010-12-13 10:47:19,822]   INFO - ildStages.RunnerStagesExecutor - Call stage jetbrains.buildServer.agent.impl.buildStages.runnerStages.start.RegisterPerBuildFileWriterPropertiesRunnerStage 
[2010-12-13 10:47:19,822]   INFO - ildStages.RunnerStagesExecutor - Call stage jetbrains.buildServer.agent.impl.buildStages.runnerStages.start.FireBeforeRunnerStartedStage 
[2010-12-13 10:47:19,837]   INFO - ildStages.RunnerStagesExecutor - Call stage jetbrains.buildServer.agent.impl.buildStages.runnerStages.start.CallBuildRunnerPrecondition 
[2010-12-13 10:47:19,837]   INFO - rt.CallBuildRunnerPrecondition - Call BuildRunnerPrecondition: class jetbrains.buildServer.agent.feature.RubyEnvConfiguratorService 
[2010-12-13 10:47:19,837]   INFO - ildStages.RunnerStagesExecutor - Call stage jetbrains.buildServer.agent.impl.buildStages.startStages.PerformFinalParametersResolveStage 
[2010-12-13 10:47:19,837]   INFO - ildStages.RunnerStagesExecutor - Call stage jetbrains.buildServer.agent.impl.buildStages.runnerStages.start.SavePropertiesToFilesStage 
[2010-12-13 10:47:19,837]   INFO - ildStages.RunnerStagesExecutor - Call stage jetbrains.buildServer.agent.impl.buildStages.runnerStages.start.CallRunnerStage 
[2010-12-13 10:47:19,837]   INFO - .impl.runner.CallRunnerService - 

Found runner NUnit for 31727 
[2010-12-13 10:47:19,837]   INFO - erStages.start.CallRunnerStage - 

Found runner NUnit for 31727 
[2010-12-13 10:47:19,837]   INFO - erStages.start.CallRunnerStage - Start actual runner for build 31727 NUnit 
[2010-12-13 10:47:19,837]   INFO - erStages.start.CallRunnerStage - ----------------------------------------- [ PROactive Printed Reports::Build [dev] #7.0.3.3 (buildId = 31727) ] ----------------------------------------- 
[2010-12-13 10:47:19,853]   INFO - nner2.OsProcessHandlerListener - C:\TeamCity\BuildAgent\plugins\dotnetPlugin\bin\JetBrains.BuildServer.NUnitLauncher.exe #TeamCityImplicit 
[2010-12-13 10:48:10,338]   INFO - verage.agent.CoverageProcessor - Accepted coverage report file: C:\TeamCity\BuildAgent\temp\buildTmp\tmp776C.tmp size: 279 type: dotcover 
[2010-12-13 10:48:10,432]   INFO - nner2.OsProcessHandlerListener -  
[2010-12-13 10:48:10,494]   INFO - mpl$TeamCitySpringSubConatiner - Closing jetbrains.buildServer.spring.SpringSubContainerFactroyImpl$TeamCitySpringSubConatiner@1caa0b6: display name [SubContext: running build runner context id=31,727 runner 2 of 2]; startup date [Mon Dec 13 10:47:19 GMT 2010]; parent: jetbrains.buildServer.spring.SpringSubContainerFactroyImpl$TeamCitySpringSubConatiner@4cf08e 
[2010-12-13 10:48:10,494]   INFO - verage.agent.CoverageProcessor - Processing 1 coverage report(s) 
[2010-12-13 10:48:10,494]   INFO - verage.agent.CoverageProcessor - Generating coverage report by dotcover for files: [C:\TeamCity\BuildAgent\temp\buildTmp\tmp776C.tmp] 
[2010-12-13 10:48:10,510]   INFO - otCover.DotCoverToolRunnerImpl - Start dotCover with command: report and parameters: <ReportParams>
  <Source>C:\TeamCity\BuildAgent\temp\buildTmp\tmp776C.tmp</Source>
  <Output>C:\TeamCity\BuildAgent\temp\buildTmp\dotCover8906968391000421097Report</Output>
  <IncludeStatementInfo>true</IncludeStatementInfo>
</ReportParams> 
[2010-12-13 10:48:16,958]   INFO - .CovegareReportGeneratorRunner - Started: C:\TeamCity\BuildAgent\plugins\dotCover\bin\dotCover.exe report C:\TeamCity\BuildAgent\temp\buildTmp\dotcover3186727609775875267.xml 
[2010-12-13 10:48:16,958]   INFO - .CovegareReportGeneratorRunner - Exit Code: 0 
[2010-12-13 10:48:16,989]   INFO - otCover.DotCoverToolRunnerImpl - Start dotCover with command: delete and parameters: <DeleteParams>
  <Source>
    <string>C:\TeamCity\BuildAgent\temp\buildTmp\tmp776C.tmp</string>
  </Source>
</DeleteParams> 
[2010-12-13 10:48:19,931]   INFO - .CovegareReportGeneratorRunner - Started: C:\TeamCity\BuildAgent\plugins\dotCover\bin\dotCover.exe delete C:\TeamCity\BuildAgent\temp\buildTmp\dotcover2340130615655923422.xml 
[2010-12-13 10:48:19,931]   INFO - .CovegareReportGeneratorRunner - Exit Code: 0 
[2010-12-13 10:53:32,220]   INFO - tCover.DotCoverReportGenerator - DotCover statement coverage was: 370 of 49385 ( 0.74921536%) 
[2010-12-13 10:53:32,987]   INFO -    jetbrains.buildServer.AGENT - Start: Searching for artifacts to publish 
[2010-12-13 10:53:32,987]   INFO -    jetbrains.buildServer.AGENT - Done:  Searching for artifacts to publish 
[2010-12-13 10:53:32,987]   INFO -    jetbrains.buildServer.AGENT - Start: Pre-processing artifacts if needed (archiving) 
[2010-12-13 10:53:32,987]   INFO -    jetbrains.buildServer.AGENT - Done: Pre-processing artifacts if needed (archiving) 
[2010-12-13 10:53:32,987]   INFO -    jetbrains.buildServer.AGENT - Start: Sending files 
[2010-12-13 10:53:32,987]   INFO -    jetbrains.buildServer.AGENT - Done:  Sending files 
[2010-12-13 10:53:38,590]   INFO -    jetbrains.buildServer.AGENT - Done publishing artifacts to .teamcity/.NETCoverage, total files published: 1 
[2010-12-13 10:54:18,046]   INFO -    jetbrains.buildServer.AGENT - Start: Searching for artifacts to publish 
[2010-12-13 10:54:18,046]   INFO -    jetbrains.buildServer.AGENT - Done:  Searching for artifacts to publish 
[2010-12-13 10:54:18,046]   INFO -    jetbrains.buildServer.AGENT - Start: Pre-processing artifacts if needed (archiving) 
[2010-12-13 10:54:18,046]   INFO -    jetbrains.buildServer.AGENT - Done: Pre-processing artifacts if needed (archiving) 
[2010-12-13 10:54:18,046]   INFO -    jetbrains.buildServer.AGENT - Start: Sending files 
[2010-12-13 10:54:18,046]   INFO -    jetbrains.buildServer.AGENT - Done:  Sending files 
[2010-12-13 10:54:18,046]   INFO -    jetbrains.buildServer.AGENT - Start: Searching for artifacts to publish 
[2010-12-13 10:54:18,093]   INFO -    jetbrains.buildServer.AGENT - Artifacts path teamcity-info.xml not found 
[2010-12-13 10:54:18,093]   INFO -    jetbrains.buildServer.AGENT - Done:  Searching for artifacts to publish 
[2010-12-13 10:54:18,093]   INFO -    jetbrains.buildServer.AGENT - Start: Pre-processing artifacts if needed (archiving) 
[2010-12-13 10:54:23,287]   INFO -    jetbrains.buildServer.AGENT - Done: Pre-processing artifacts if needed (archiving) 
[2010-12-13 10:54:23,287]   INFO -    jetbrains.buildServer.AGENT - Start: Sending files 
[2010-12-13 10:54:23,287]   INFO -    jetbrains.buildServer.AGENT - Done:  Sending files 
[2010-12-13 10:54:23,287]   INFO -    jetbrains.buildServer.AGENT - Build finished: 31727 
[2010-12-13 10:54:26,103]   INFO -    jetbrains.buildServer.AGENT - Done publishing artifacts to , total files published: 1 
[2010-12-13 10:54:27,339]   INFO -    jetbrains.buildServer.AGENT - Done publishing artifacts to Database/SqlServer.zip, total files published: 1 
[2010-12-13 10:54:27,792]   INFO -    jetbrains.buildServer.AGENT - Done publishing artifacts to Database/Oracle.zip, total files published: 1 
[2010-12-13 10:54:28,152]   INFO -    jetbrains.buildServer.AGENT - Done publishing artifacts to PrintedReports.zip, total files published: 1 
[2010-12-13 10:54:28,168]   INFO - nt.impl.BuildRunAgentStateImpl - Disposing build context 
[2010-12-13 10:54:28,168]   INFO - mpl$TeamCitySpringSubConatiner - Closing jetbrains.buildServer.spring.SpringSubContainerFactroyImpl$TeamCitySpringSubConatiner@4cf08e: display name [SubContext: running build context id=31727]; startup date [Mon Dec 13 10:45:02 GMT 2010]; parent: jetbrains.buildServer.agent.AgentMain2$1@b6e39f 
[2010-12-13 10:54:28,184]   INFO - ctories.CleanupRegistryCleaner - Start deleting files from C:\TeamCity\BuildAgent\temp\.old 
[2010-12-13 10:54:50,125]   INFO - ctories.CleanupRegistryCleaner - Stop deleting files from C:\TeamCity\BuildAgent\temp\.old. 4236 file(s) were deleted.  
[2010-12-13 10:54:50,125]   INFO - ctories.CleanupRegistryCleaner - Start deleting files from C:\TeamCity\BuildAgent\work\.old 
[2010-12-13 10:54:55,369]   INFO - ctories.CleanupRegistryCleaner - Stop deleting files from C:\TeamCity\BuildAgent\work\.old. 1248 file(s) were deleted.  
[2010-12-13 10:55:57,191]   INFO - mpl$TeamCitySpringSubConatiner - Refreshing jetbrains.buildServer.spring.SpringSubContainerFactroyImpl$TeamCitySpringSubConatiner@e9bbad: display name [SubContext: running build context id=31731]; startup date [Mon Dec 13 10:55:57 GMT 2010]; parent: jetbrains.buildServer.agent.AgentMain2$1@b6e39f 
[2010-12-13 10:55:57,222]   INFO - mpl$TeamCitySpringSubConatiner - Bean factory for application context [jetbrains.buildServer.spring.SpringSubContainerFactroyImpl$TeamCitySpringSubConatiner@e9bbad]: org.springframework.beans.factory.support.DefaultListableBeanFactory@8c6b1c 
[2010-12-13 10:55:57,269]   INFO - uildStages.BuildStagesExecutor - Call stage jetbrains.buildServer.agent.impl.buildStages.startStages.ClearExpiredBuildWorkingDirectoriesStage 
[2010-12-13 10:55:57,269]   INFO - uildStages.BuildStagesExecutor - Call stage 
0

Sorry for delay. I need more detailed debug information to figure out what went wrong.
Please open <agent>/plugins/dotNetPlugin/bin/teamcity-log4net.xml and replace it with <agent>/plugins/dotNetPlugin/bin/teamcity-log4net-debug.xml
Run the build
Attach produced build log.

0

What are the rules you specified. What is wrong in the build report you receive?

0

What I want to achieve is to exclude specific classes from the coverage report, more specifically when adding a service reference in VS a proxy class is created with potentially over a thousand lines of autogenerated code. Having this included in the coverage report makes it almost irrelevant.

In order to exclude this class I tried the filter combinations mentioned in previous posts.

0

Hi Alex.

Here is a similar thread with the same issue. http://devnet.jetbrains.net/thread/292759
We asked dotCover developers for help, and I'll let you know on any news.

Thanks
Michael

0

Please sign in to leave a comment.