我尝试使用内置的NUNIT和捆绑的dotCover配置TeamCity 6.5。由于我不理解dotCover Merge命令失败的原因,以及带有一些非零退出代码的所有后续命令。
在64位计算机上使用Nunit 2.5.10,x64,使用针对nunit的.NET4.0运行时。我选择了dotCover作为覆盖工具,留空以使用内置的dotCover,我的过滤器看起来像这样:
+:BSF
-:Aspose.Cells
-:BSF.UnitTest
-:BSF.IntegrationTests
-:DataAnnotationsExtensions.ClientValidation
-:DataAnnotationsExtensions
-:Elmah
-:FluentNHibernate
-:Iesi.Collections
-:NHibernate
-:Ninject
-:NLog
-:nunit.framework
-:nunit.mocks
-:pnunit.framework
-:Rhino.Mocks
-:WebActivator
-:Yahoo.Yui.Compressor
这是构建日志:
Step 2/2] Coverage session finished [2/19/2012 5:16:06 PM]
[17:16:06]: [Step 2/2] Coverage results post-processing started [2/19/2012 5:16:06 PM]
[17:16:06]: [Step 2/2] Coverage results post-processing finished [2/19/2012 5:16:06 PM]
[17:16:06]: [Step 2/2] ##teamcity[importData type='dotNetCoverage' tool='dotcover' file='C:\System\TeamCity\Agent007\temp\buildTmp\tmpEB31.tmp']
[17:16:06]: [Step 2/2] Importing data from 'C:\System\TeamCity\Agent007\temp\buildTmp\tmpEB31.tmp' with 'dotNetCoverage' processor
[17:16:06]: [Step 2/2] Process exited with code 0
[17:16:06]: Waiting for 1 service processes to complete
[17:16:06]: Processing 1 coverage report(s)
[17:16:06]: Generating coverage report by dotcover for files: [C:\System\TeamCity\Agent007\temp\buildTmp\tmpEB31.tmp]
[17:16:06]: Get dotCover version (1s)
[17:16:08]: [Get dotCover version] Started dotCover: C:\System\TeamCity\buildAgent\tools\dotCover\dotCover.exe version C:\System\TeamCity\Agent007\temp\buildTmp\dotCover1818874175934681230Version
[17:16:08]: [Get dotCover version] Output: JetBrains dotCover Console Runner v1.1.252.2. Copyright (c) 2009-2012 JetBrains s.r.o. All rights reserved.
[17:16:08]: [Get dotCover version] dotCover exited with code: 0
[17:16:08]: Use DotCover 1.1.x commands set
[17:16:08]: Merge dotCover reports (3s)
[17:16:11]: [Merge dotCover reports] Started dotCover: C:\System\TeamCity\buildAgent\tools\dotCover\dotCover.exe merge C:\System\TeamCity\Agent007\temp\buildTmp\dotcover3528224551281727042.xml
[17:16:11]: [Merge dotCover reports] Output: JetBrains dotCover Console Runner v1.1.252.2. Copyright (c) 2009-2012 JetBrains s.r.o. All rights reserved.
[17:16:11]: [Merge dotCover reports] dotCover exited with code: -1073740940
[17:16:11]: [Merge dotCover reports] dotCover returned non-zero exit code.
[17:16:12]: Remove dotCover snapshot files
[17:16:12]: [Remove dotCover snapshot files] Started dotCover: C:\System\TeamCity\buildAgent\tools\dotCover\dotCover.exe delete C:\System\TeamCity\Agent007\temp\buildTmp\dotcover2466421969996709368.xml
[17:16:12]: [Remove dotCover snapshot files] Output: JetBrains dotCover Console Runner v1.1.252.2. Copyright (c) 2009-2012 JetBrains s.r.o. All rights reserved.
[17:16:12]: [Remove dotCover snapshot files] dotCover exited with code: 0
[17:16:12]: Generate dotCover report (3s)
[17:16:16]: [Generate dotCover report] Started dotCover: C:\System\TeamCity\buildAgent\tools\dotCover\dotCover.exe report C:\System\TeamCity\Agent007\temp\buildTmp\dotcover1373956647492282113.xml
[17:16:16]: [Generate dotCover report] Output: JetBrains dotCover Console Runner v1.1.252.2. Copyright (c) 2009-2012 JetBrains s.r.o. All rights reserved.
[17:16:16]: [Generate dotCover report] dotCover exited with code: -1073740940
[17:16:16]: [Generate dotCover report] dotCover returned non-zero exit code.
[17:16:16]: Generate dotCover HTML report
[17:16:16]: Packing snapshot files (3s)
[17:16:20]: [Packing snapshot files] Started dotCover: C:\System\TeamCity\buildAgent\tools\dotCover\dotCover.exe zip C:\System\TeamCity\Agent007\temp\buildTmp\dotcover128074978195207834.xml
[17:16:20]: [Packing snapshot files] Output: JetBrains dotCover Console Runner v1.1.252.2. Copyright (c) 2009-2012 JetBrains s.r.o. All rights reserved.
[17:16:20]: [Packing snapshot files] dotCover exited with code: -1073740940
[17:16:20]: [Packing snapshot files] dotCover returned non-zero exit code.
[17:16:20]: Remove dotCover snapshot files
[17:16:21]: [Remove dotCover snapshot files] Started dotCover: C:\System\TeamCity\buildAgent\tools\dotCover\dotCover.exe delete C:\System\TeamCity\Agent007\temp\buildTmp\dotcover1456730463762641811.xml
[17:16:21]: [Remove dotCover snapshot files] Output: JetBrains dotCover Console Runner v1.1.252.2. Copyright (c) 2009-2012 JetBrains s.r.o. All rights reserved.
Failed to obtain source files for the 'delete' command. File 'C:\System\TeamCity\Agent007\temp\buildTmp\dotCover9185619990474525744Merge' is nor a snapshot in supported format, nor a coverage results descriptor
[17:16:21]: [Remove dotCover snapshot files] dotCover exited with code: -2
[17:16:21]: [Remove dotCover snapshot files] dotCover returned non-zero exit code.
[17:16:21]: No statistics values are provided by dotCover report generator
[17:16:21]: Publishing artifacts
[17:16:21]: [Publishing artifacts] Paths to publish: [C:\System\TeamCity\Agent007\temp\buildTmp\coverage1694097105968668380zip\CoverageReport.xml=>.teamcity/.NETCoverage]
[17:16:21]: [Publishing artifacts] Sending files
[17:16:21]: Publishing internal artifacts
[17:16:21]: [Publishing internal artifacts] Sending build.finish.properties.gz file
[17:16:21]: Build finished
答案 0 :(得分:1)
对不起,迟到了。你可以有这样的过滤器,这应该足够了:
+:BSF*
-:BSF.UnitTest
-:BSF.IntegrationTests
奇怪的退出代码可能意味着控制台运行程序进程因不明原因而崩溃。您可以尝试最新的控制台运行版(http://confluence.jetbrains.net/display/DCVR/dotCover+2.2+Nightly+Builds)或更新内置TC的dotCover。为了做到这一点,将TC服务器上的zip放到以下路径: TeamCity \ webapps \ ROOT \ WEB-INF \ plugins \ dotNetRunners \ agent \ dotCover.zip(完整路径可能有所不同) 这将自动将其部署到所有代理。 如果这对您不起作用,请随时与支持人员联系。