DotCover“cover”命令需要数小时才能生成快照

时间:2017-10-23 13:18:47

标签: wpf nunit nunit-3.0 dotcover

我有一个WPF Windows应用程序的UI自动化。我们的管理层决定使用dotCover来计算覆盖率。 在使用命令行运行简单测试后,我正在尝试获取应用程序覆盖率。这是它:

dotcover.exe cover coverage.xml

Coverage.xml文件内容如下所示:

<?xml version="1.0" encoding="utf-8"?>
<CoverageParams>
  <TargetExecutable>nunit3-console.exe</TargetExecutable>
  <TargetArguments>CI.UIAutomationTests.dll --where="test =~ /TC100/" --agents=1 --workers=1 --labels=All</TargetArguments>
  <TargetWorkingDir></TargetWorkingDir>
  <TempDir><!-- Directory for auxiliary files. Set to the system temp by default. --></TempDir>
  <Output>ClientCoverage_TC100.snapshot</Output>
  ...

测试成功执行,耗时约2分钟。但是它会停止大约2-3个小时,如果我让它工作,我会得到快照:

Test Run Summary
Overall result: Failed
Test Count: 1, Passed: 0, Failed: 1, Warnings: 0, Inconclusive: 0, Skipped: 0
Failed Tests - Failures: 0, Errors: 1, Invalid: 0
Start time: 2017-10-23 07:41:57Z
End time: 2017-10-23 07:45:28Z
Duration: 211.288 seconds

Results (nunit3) saved as TestResult.xml
[JetBrains dotCover] Coverage session finished [10/23/2017 10:49:11 AM]
[JetBrains dotCover] Analyzed application exited with code '1'
[JetBrains dotCover] Coverage results post-processing started [10/23/2017 10:49:11 AM]
[JetBrains dotCover] Coverage results post-processing finished [10/23/2017 10:49:12 AM]

所以问题是:为什么需要这么长时间?

2 个答案:

答案 0 :(得分:0)

我认为它会分析您的所有第三方依赖项。您是否尝试过滤它以仅分析具有命名空间的程序集? https://www.jetbrains.com/help/dotcover/Running_Coverage_Analysis_from_the_Command_LIne.html#filters_xml?section=

答案 1 :(得分:0)

已解决。 被测应用程序将启动另一个应用程序,并且在测试完成后未关闭。当我决定关闭它时,我意识到dot.cover不再卡住了。 因此,解决方案是-关闭受测应用的所有子进程