Почему OpenCover не находит все модули при запуске кода через NUnit? - PullRequest
0 голосов
/ 11 июня 2019

У меня есть скрипт, который запускает NUnit через OpenCover. Скрипту можно дать список имен сборок, чтобы ограничить покрытие. К сожалению, OpenCover не видит все модули.

Я запускаю свой скрипт с 3 параметрами:

  1. Путь dll модульного тестирования - .\Test\UnitTests\bin\Debug\UnitTests.dll
  2. Список названий сборок - DataSvc,DataProcessor,xyz.DataManager
  3. Фильтр для нунита - class==DeviceServicesTest.PunchProcessingTest

Как это:

C:\xyz\tip> Start-TestsWithCoverage .\Test\UnitTests\bin\Debug\UnitTests.dll -AssemblyNames DataSvc,DataProcessor,xyz.DataManager -Where "class==DeviceServicesTest.PunchProcessingTest"

Скрипт выводит фильтр OpenCover, построенный из заданных имен сборок:

Using filter +[DataSvc]* +[DataProcessor]* +[xyz.DataManager]*

Затем он продолжает выводить командную строку OpenCover. Я использовал ~, чтобы заменить путь к профилю пользователя для краткости.

& ~\AppData\Local\PackageManagement\NuGet\Packages\OpenCover.4.7.922\tools\OpenCover.Console.exe -output:~\AppData\Local\Temp\a35044_20190611135327\UnitTests.CoverageResult.xml `
            -log:Info `
            -mergeoutput `
            -register:user `
            -filter:+[DataSvc]* +[DataProcessor]* +[xyz.DataManager]* `
            -target:~\AppData\Local\PackageManagement\NuGet\Packages\NUnit.ConsoleRunner.3.10.0\tools\nunit3-console.exe `
            -hideskipped:MissingPdb `
            -skipautoprops `
            -mergebyhash `
            -targetargs:"--workers=1 --trace=Info --stoponerror --result=~\AppData\Local\Temp\a35044_20190611135327\UnitTests.TestResult.xml --noh --noc --inprocess --domain=Single --where:`"class==DeviceServicesTest.PunchProcessingTest`" .\Test\UnitTests\bin\Debug\UnitTests.dll" `
        | & Write-Host

Теперь команда выполняется и выдает следующий вывод:

Executing: ~\AppData\Local\PackageManagement\NuGet\Packages\NUnit.ConsoleRunner.3.10.0\tools\nunit3-console.exe
Runtime Environment
   OS Version: Microsoft Windows NT 10.0.17763.0
  CLR Version: 4.0.30319.42000

Test Files
    .\Test\UnitTests\bin\Debug\UnitTests.dll

Test Filters
    Where: class==DeviceServicesTest.PunchProcessingTest


Run Settings
    ProcessModel: InProcess
    DomainUsage: Single
    DisposeRunners: True
    InternalTraceLevel: Info
    WorkDirectory: C:\xyz\tip
    StopOnError: True
    NumberOfTestWorkers: 1
    ImageRuntimeVersion: 4.0.30319
    ImageTargetFrameworkName: .NETFramework,Version=v4.7.2
    ImageRequiresX86: False
    ImageRequiresDefaultAppDomainAssemblyResolver: False

Test Run Summary
  Overall result: Passed
  Test Count: 501, Passed: 501, Failed: 0, Warnings: 0, Inconclusive: 0, Skipped: 0
  Start time: 2019-06-11 17:53:29Z
    End time: 2019-06-11 17:56:10Z
    Duration: 161.509 seconds

Results (nunit3) saved as ~\AppData\Local\Temp\a35044_20190611135327\UnitTests.TestResult.xml
Committing...
No results, this could be for a number of reasons. The most common reasons are:
    1) missing PDBs for the assemblies that match the filter please review the
    output file and refer to the Usage guide (Usage.rtf) about filters.
    2) the profiler may not be registered correctly, please refer to the Usage
    guide and the -register switch.

Name                           Value
----                           -----
CoverageResult                 ~\AppData\Local\Temp\a35044_20190611135327\UnitTests.CoverageResult.xml
TestResult                     ~\AppData\Local\Temp\a35044_20190611135327\UnitTests.TestResult.xml

Изучение модулей, описанных в OpenCoverResult.xml, дает следующее:

C:\xyz\tip> cat ~\AppData\Local\Temp\a35044_20190611135327\UnitTests.CoverageResult.xml | sls "ModulePath>C:\\xyz"

      <ModulePath>C:\xyz\tip\Test\UnitTests\bin\Debug\nunit.framework.dll</ModulePath>
      <ModulePath>C:\xyz\tip\Test\UnitTests\bin\Debug\UnitTests.dll</ModulePath>
      <ModulePath>C:\xyz\tip\Test\UnitTests\bin\Debug\SchedulePolicyValidation.dll</ModulePath>
      <ModulePath>C:\xyz\tip\Test\UnitTests\bin\Debug\xyz.Data.dll</ModulePath>
      <ModulePath>C:\xyz\tip\Test\UnitTests\bin\Debug\xyz.WFM.Core.WorkContractPremium.Engine.dll</ModulePath>
      <ModulePath>C:\xyz\tip\Test\UnitTests\bin\Debug\MultiApprovalProcessor.dll</ModulePath>
      <ModulePath>C:\xyz\tip\Test\UnitTests\bin\Debug\HRMappingRuleEngine.dll</ModulePath>
      <ModulePath>C:\xyz\tip\Test\UnitTests\bin\Debug\RuleEngine.dll</ModulePath>
      <ModulePath>C:\xyz\tip\Test\UnitTests\bin\Debug\xyz.Common.dll</ModulePath>
      <ModulePath>C:\xyz\tip\Test\UnitTests\bin\Debug\AccrualEngine.dll</ModulePath>
      <ModulePath>C:\xyz\tip\Test\UnitTests\bin\Debug\RuleEngineHelper.dll</ModulePath>
      <ModulePath>C:\xyz\tip\Test\UnitTests\bin\Debug\StaffAssignment.dll</ModulePath>

Обратите внимание, ни одно из названий сборки, которые я просил Может быть, у них нет PDB? Но они делают:

C:\xyz\tip> 'DataSvc','DataProcessor', 'xyz.DataManager' |% { dir ".\Test\UnitTests\bin\Debug\$_.*" }


    Directory: C:\xyz\tip\Test\UnitTests\bin\Debug


Mode                LastWriteTime         Length Name
----                -------------         ------ ----
-a----        6/11/2019  12:44 PM       15237632 DataSvc.dll
-a----        6/11/2019  12:44 PM       18771456 DataSvc.pdb
-a----        6/11/2019  12:34 PM        1762816 DataProcessor.dll
-a----        6/11/2019  12:34 PM        2334208 DataProcessor.pdb
-a----        6/11/2019  12:34 PM         181760 xyz.DataManager.dll
-a----        6/11/2019  12:34 PM         368128 xyz.DataManager.pdb

А может имена сборок отличаются от имен файлов? Нету:

C:\xyz\tip> 'DataSvc','DataProcessor', 'xyz.DataManager' |% { [Reflection.AssemblyName]::GetAssemblyName("$pwd\Test\UnitTests\bin\Debug\$_.dll") }

Version        Name
-------        ----
1.0.0.0        DataSvc
1.0.0.0        DataProcessor
1.0.0.0        xyz.DataManager

А может, проведенные тесты просто не загружают эти сборки в память? Нет снова. Я не знаю, как это проверить, кроме как удалить их и перезапустить скрипт:

C:\xyz\tip> 'DataSvc','DataProcessor', 'xyz.DataManager' |% { del ".\Test\UnitTests\bin\Debug\$_.*" }
C:\xyz\tip> 'DataSvc','DataProcessor', 'xyz.DataManager' |% { dir ".\Test\UnitTests\bin\Debug\$_.*" }
C:\xyz\tip>  Start-TestsWithCoverage .\Test\UnitTests\bin\Debug\UnitTests.dll -AssemblyNames DataSvc,DataProcessor,xyz.DataManager -Where "class==DeviceServicesTest.PunchProcessingTest"
Using filter +[DataSvc]* +[DataProcessor]* +[xyz.DataManager]*
& ~\AppData\Local\PackageManagement\NuGet\Packages\OpenCover.4.7.922\tools\OpenCover.Console.exe -output:~\AppData\Local\Temp\a35044_20190611141815\UnitTests.CoverageResult.xml `
            -log:Info `
            -mergeoutput `
            -register:user `
            -filter:+[DataSvc]* +[DataProcessor]* +[xyz.DataManager]* `
            -target:~\AppData\Local\PackageManagement\NuGet\Packages\NUnit.ConsoleRunner.3.10.0\tools\nunit3-console.exe `
            -hideskipped:MissingPdb `
            -skipautoprops `
            -mergebyhash `
            -targetargs:"--workers=1 --trace=Info --stoponerror --result=~\AppData\Local\Temp\a35044_20190611141815\UnitTests.TestResult.xml --noh --noc --inprocess --domain=Single --where:`"class==DeviceServicesTest.PunchProcessingTest`" .\Test\UnitTests\bin\Debug\UnitTests.dll" `
        | & Write-Host
Executing: ~\AppData\Local\PackageManagement\NuGet\Packages\NUnit.ConsoleRunner.3.10.0\tools\nunit3-console.exe
Runtime Environment
   OS Version: Microsoft Windows NT 10.0.17763.0
  CLR Version: 4.0.30319.42000

Test Files
    .\Test\UnitTests\bin\Debug\UnitTests.dll

Test Filters
    Where: class==DeviceServicesTest.PunchProcessingTest


Errors, Failures and Warnings

1) Invalid : UnitTests.dll
Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
  ----> Could not load file or assembly 'DataSvc, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b3dac0a0872f0a93' or one of its dependencies. The system cannot find the file specified.
  ----> Could not load file or assembly 'DataSvc, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b3dac0a0872f0a93' or one of its dependencies. The system cannot find the file specified.
  ----> Could not load file or assembly 'DataSvc, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b3dac0a0872f0a93' or one of its dependencies. The system cannot find the file specified.
  ----> Could not load file or assembly 'DataSvc, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b3dac0a0872f0a93' or one of its dependencies. The system cannot find the file specified.
  ----> Could not load file or assembly 'DataSvc, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b3dac0a0872f0a93' or one of its dependencies. The system cannot find the file specified.
  ----> Could not load file or assembly 'DataSvc, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b3dac0a0872f0a93' or one of its dependencies. The system cannot find the file specified.
  ----> Could not load file or assembly 'DataSvc, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b3dac0a0872f0a93' or one of its dependencies. The system cannot find the file specified.
  ----> Could not load file or assembly 'DataSvc, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b3dac0a0872f0a93' or one of its dependencies. The system cannot find the file specified.
  ----> Could not load file or assembly 'DataSvc, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b3dac0a0872f0a93' or one of its dependencies. The system cannot find the file specified.
  ----> Could not load file or assembly 'xyz.DataManager, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b3dac0a0872f0a93' or one of its dependencies. The system cannot find the file specified.
  ----> Could not load file or assembly 'xyz.DataManager, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b3dac0a0872f0a93' or one of its dependencies. The system cannot find the file specified.
  ----> Could not load file or assembly 'xyz.DataManager, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b3dac0a0872f0a93' or one of its dependencies. The system cannot find the file specified.
  ----> Could not load file or assembly 'xyz.DataManager, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b3dac0a0872f0a93' or one of its dependencies. The system cannot find the file specified.

Execution terminated after first error

Run Settings
    ProcessModel: InProcess
    DomainUsage: Single
    DisposeRunners: True
    InternalTraceLevel: Info
    WorkDirectory: C:\xyz\tip
    StopOnError: True
    NumberOfTestWorkers: 1
    ImageRuntimeVersion: 4.0.30319
    ImageTargetFrameworkName: .NETFramework,Version=v4.7.2
    ImageRequiresX86: False
    ImageRequiresDefaultAppDomainAssemblyResolver: False

Test Run Summary
  Overall result: Failed
  Test Count: 0, Passed: 0, Failed: 0, Warnings: 0, Inconclusive: 0, Skipped: 0
  Start time: 2019-06-11 18:18:17Z
    End time: 2019-06-11 18:18:17Z
    Duration: 0.810 seconds

Results (nunit3) saved as ~\AppData\Local\Temp\a35044_20190611141815\UnitTests.TestResult.xml
Committing...
No results, this could be for a number of reasons. The most common reasons are:
    1) missing PDBs for the assemblies that match the filter please review the
    output file and refer to the Usage guide (Usage.rtf) about filters.
    2) the profiler may not be registered correctly, please refer to the Usage
    guide and the -register switch.

Name                           Value
----                           -----
CoverageResult                 ~\AppData\Local\Temp\a35044_20190611141815\UnitTests.CoverageResult.xml
TestResult                     ~\AppData\Local\Temp\a35044_20190611141815\UnitTests.TestResult.xml


C:\xyz\tip>

Итак, нет ответа - сборки загружены. Итак, что у меня есть:

  1. Существуют фактические сборки, соответствующие заданным именам сборок
  2. У них есть PDB
  3. Они загружены модульными тестами
  4. Пока OpenCover не сообщает о них

Может кто-нибудь объяснить мне, что я делаю не так?

Редактировать 1

Я только что запустил без фильтра:

C:\Xyz\tip> Start-TestsWithCoverage .\Test\UnitTests\bin\Debug\UnitTests.dll -Where "class==DeviceServicesTest.PunchProcessingTest"
& ~\AppData\Local\PackageManagement\NuGet\Packages\OpenCover.4.7.922\tools\OpenCover.Console.exe -output:~\AppData\Local\Temp\a24272_20190611200801\UnitTests.CoverageResult.xml `
            -log:Info `
            -mergeoutput `
            -register:user `
             `
            -target:~\AppData\Local\PackageManagement\NuGet\Packages\NUnit.ConsoleRunner.3.10.0\tools\nunit3-console.exe `
            -hideskipped:MissingPdb `
            -skipautoprops `
            -mergebyhash `
            -targetargs:"--workers=1 --trace=Info --stoponerror --result=~\AppData\Local\Temp\a24272_20190611200801\UnitTests.TestResult.xml --noh --noc --inprocess --domain=Single --where:`"class==DeviceServicesTest.PunchProcessingTest`" .\Test\UnitTests\bin\Debug\UnitTests.dll" `
        | & Write-Host
Executing: ~\AppData\Local\PackageManagement\NuGet\Packages\NUnit.ConsoleRunner.3.10.0\tools\nunit3-console.exe
Runtime Environment
   OS Version: Microsoft Windows NT 10.0.17763.0
  CLR Version: 4.0.30319.42000

Test Files
    .\Test\UnitTests\bin\Debug\UnitTests.dll

Test Filters
    Where: class==DeviceServicesTest.PunchProcessingTest


Run Settings
    ProcessModel: InProcess
    DomainUsage: Single
    DisposeRunners: True
    InternalTraceLevel: Info
    WorkDirectory: C:\Xyz\tip
    StopOnError: True
    NumberOfTestWorkers: 1
    ImageRuntimeVersion: 4.0.30319
    ImageTargetFrameworkName: .NETFramework,Version=v4.7.2
    ImageRequiresX86: False
    ImageRequiresDefaultAppDomainAssemblyResolver: False

Test Run Summary
  Overall result: Passed
  Test Count: 501, Passed: 501, Failed: 0, Warnings: 0, Inconclusive: 0, Skipped: 0
  Start time: 2019-06-12 00:08:02Z
    End time: 2019-06-12 00:12:59Z
    Duration: 296.238 seconds

Results (nunit3) saved as ~\AppData\Local\Temp\a24272_20190611200801\UnitTests.TestResult.xml
Committing...
Source file is modified: C:\Xyz\tip\Test\UnitTests\DeviceServices\DeviceServicesTest.cs
Visited Classes 20 of 5617 (0.36)
Visited Methods 46 of 34372 (0.13)
Visited Points 133 of 335922 (0.04)
Visited Branches 67 of 169563 (0.04)

==== Alternative Results (includes all methods including those without corresponding source) ====
Alternative Visited Classes 20 of 10833 (0.18)
Alternative Visited Methods 46 of 44579 (0.1)

Name                           Value
----                           -----
CoverageResult                 ~\AppData\Local\Temp\a24272_20190611200801\UnitTests.CoverageResult.xml
TestResult                     ~\AppData\Local\Temp\a24272_20190611200801\UnitTests.TestResult.xml

Полученный файл довольно большой:

C:\Xyz\tip> dir ~\AppData\Local\Temp\a24272_20190611192946\UnitTests.CoverageResult.xml


    Directory: ~\AppData\Local\Temp\a24272_20190611192946


Mode                LastWriteTime         Length Name
----                -------------         ------ ----
-a----        6/11/2019   7:33 PM      170794313 UnitTests.CoverageResult.xml


C:\Xyz\tip>

Но он по-прежнему не содержит сборок, в которых я абсолютно уверен:

C:\Xyz\tip> cat ~\AppData\Local\Temp\a24272_20190611192946\UnitTests.CoverageResult.xml | sls "ModulePath>C:\\Xyz"

      <ModulePath>C:\Xyz\tip\Test\UnitTests\bin\Debug\nunit.framework.dll</ModulePath>
      <ModulePath>C:\Xyz\tip\Test\UnitTests\bin\Debug\UnitTests.dll</ModulePath>
      <ModulePath>C:\Xyz\tip\Test\UnitTests\bin\Debug\SchedulePolicyValidation.dll</ModulePath>
      <ModulePath>C:\Xyz\tip\Test\UnitTests\bin\Debug\Xyz.Data.dll</ModulePath>
      <ModulePath>C:\Xyz\tip\Test\UnitTests\bin\Debug\Xyz.WFM.Core.WorkContractPremium.Engine.dll</ModulePath>
      <ModulePath>C:\Xyz\tip\Test\UnitTests\bin\Debug\MultiApprovalProcessor.dll</ModulePath>
      <ModulePath>C:\Xyz\tip\Test\UnitTests\bin\Debug\HRMappingRuleEngine.dll</ModulePath>
      <ModulePath>C:\Xyz\tip\Test\UnitTests\bin\Debug\RuleEngine.dll</ModulePath>


C:\Xyz\tip>

Нет ни DataSvc, ни DataProcessor, ни Xyz.DataManager.

РЕДАКТИРОВАТЬ 2

Меня попросили запустить исполняемый файл OpenCover напрямую, так что мы идем:

C:\Xyz\tip [master ↓290 +9 ~1 -0 !]> $d = Get-DumpDir
C:\Xyz\tip [master ↓290 +9 ~1 -0 !]> $d
~\AppData\Local\Temp\a24272_20190612091253
C:\Xyz\tip [master ↓290 +9 ~1 -0 !]> dir $d
C:\Xyz\tip [master ↓290 +9 ~1 -0 !]> $OpenCover = (Resolve-Path '~\AppData\Local\PackageManagement\NuGet\Packages\OpenCover.4.7.922\tools\OpenCover.Console.exe').Path
C:\Xyz\tip [master ↓290 +9 ~1 -0 !]> $NUnit = (Resolve-Path '~\AppData\Local\PackageManagement\NuGet\Packages\NUnit.ConsoleRunner.3.10.0\tools\nunit3-console.exe').Path
C:\Xyz\tip [master ↓290 +9 ~1 -0 !]> $CovResult = "$d\UnitTests.CoverageResult.xml"
C:\Xyz\tip [master ↓290 +9 ~1 -0 !]> $NUnitResult = "$d\UnitTests.TestResult.xml"
C:\Xyz\tip [master ↓290 +9 ~1 -0 !]> & $OpenCover -output:$CovResult -log:Info -mergeoutput -register:user -target:$NUnit -hideskipped:MissingPdb -skipautoprops -mergebyhash `
>> -targetargs:"--workers=1 --trace=Info --stoponerror --result=$NUnitResult --noh --inprocess --domain=Single --where:`"class==DeviceServicesTest.PunchProcessingTest`" .\Test\UnitTests\bin\Debug\UnitTests.dll"
Executing: ~\AppData\Local\PackageManagement\NuGet\Packages\NUnit.ConsoleRunner.3.10.0\tools\nunit3-console.exe
Runtime Environment
   OS Version: Microsoft Windows NT 10.0.17763.0
  CLR Version: 4.0.30319.42000

Test Files
    .\Test\UnitTests\bin\Debug\UnitTests.dll

Test Filters
    Where: class==DeviceServicesTest.PunchProcessingTest


Run Settings
    ProcessModel: InProcess
    DomainUsage: Single
    DisposeRunners: True
    InternalTraceLevel: Info
    WorkDirectory: C:\Xyz\tip
    StopOnError: True
    NumberOfTestWorkers: 1
    ImageRuntimeVersion: 4.0.30319
    ImageTargetFrameworkName: .NETFramework,Version=v4.7.2
    ImageRequiresX86: False
    ImageRequiresDefaultAppDomainAssemblyResolver: False

Test Run Summary
  Overall result: Passed
  Test Count: 501, Passed: 501, Failed: 0, Warnings: 0, Inconclusive: 0, Skipped: 0
  Start time: 2019-06-12 13:15:34Z
    End time: 2019-06-12 13:20:17Z
    Duration: 283.230 seconds

Results (nunit3) saved as ~\AppData\Local\Temp\a24272_20190612091253\UnitTests.TestResult.xml
Committing...
Source file is modified: C:\Xyz\tip\Test\UnitTests\DeviceServices\DeviceServicesTest.cs
Visited Classes 20 of 5617 (0.36)
Visited Methods 46 of 34372 (0.13)
Visited Points 133 of 335922 (0.04)
Visited Branches 67 of 169563 (0.04)

==== Alternative Results (includes all methods including those without corresponding source) ====
Alternative Visited Classes 20 of 10833 (0.18)
Alternative Visited Methods 46 of 44579 (0.1)
C:\Xyz\tip>

Сообщенные модули:

C:\Xyz\tip> cat $CovResult | sls "ModulePath>C:\\Xyz"

      <ModulePath>C:\Xyz\tip\Test\UnitTests\bin\Debug\nunit.framework.dll</ModulePath>
      <ModulePath>C:\Xyz\tip\Test\UnitTests\bin\Debug\UnitTests.dll</ModulePath>
      <ModulePath>C:\Xyz\tip\Test\UnitTests\bin\Debug\SchedulePolicyValidation.dll</ModulePath>
      <ModulePath>C:\Xyz\tip\Test\UnitTests\bin\Debug\Xyz.Data.dll</ModulePath>
      <ModulePath>C:\Xyz\tip\Test\UnitTests\bin\Debug\Xyz.WFM.Core.WorkContractPremium.Engine.dll</ModulePath>
      <ModulePath>C:\Xyz\tip\Test\UnitTests\bin\Debug\MultiApprovalProcessor.dll</ModulePath>
      <ModulePath>C:\Xyz\tip\Test\UnitTests\bin\Debug\HRMappingRuleEngine.dll</ModulePath>
      <ModulePath>C:\Xyz\tip\Test\UnitTests\bin\Debug\RuleEngine.dll</ModulePath>
      <ModulePath>C:\Xyz\tip\Test\UnitTests\bin\Debug\Xyz.Common.dll</ModulePath>
      <ModulePath>C:\Xyz\tip\Test\UnitTests\bin\Debug\AccrualEngine.dll</ModulePath>
      <ModulePath>C:\Xyz\tip\Test\UnitTests\bin\Debug\RuleEngineHelper.dll</ModulePath>
      <ModulePath>C:\Xyz\tip\Test\UnitTests\bin\Debug\StaffAssignment.dll</ModulePath>

Излишне говорить, что этот список очень короткий. Слишком коротко. Ни одна из отсутствующих сборок не является .NET Core. Я более чем готов предоставить больше информации, просто дайте мне знать, что именно.

РЕДАКТИРОВАТЬ 3

Та же командная строка, только без флагов -merge... и -hideskipped...:

C:\Xyz\tip> $d = Get-DumpDir
C:\Xyz\tip> dir $d
C:\Xyz\tip> $d
~\AppData\Local\Temp\a24272_20190614085640
C:\Xyz\tip> & $OpenCover -output:$CovResult -log:Info -register:user -target:$NUnit -targetargs:"--workers=1 --trace=Info --stoponerror --result=$NUnitResult --noh --inprocess --domain=Single --where:`"class==DeviceServicesTest.PunchProcessingTest`" .\Test\UnitTests\bin\Debug\UnitTests.dll"
Executing: ~\AppData\Local\PackageManagement\NuGet\Packages\NUnit.ConsoleRunner.3.10.0\tools\nunit3-console.exe
Runtime Environment
   OS Version: Microsoft Windows NT 10.0.17763.0
  CLR Version: 4.0.30319.42000

Test Files
    .\Test\UnitTests\bin\Debug\UnitTests.dll

Test Filters
    Where: class==DeviceServicesTest.PunchProcessingTest


Run Settings
    ProcessModel: InProcess
    DomainUsage: Single
    DisposeRunners: True
    InternalTraceLevel: Info
    WorkDirectory: C:\Xyz\tip
    StopOnError: True
    NumberOfTestWorkers: 1
    ImageRuntimeVersion: 4.0.30319
    ImageTargetFrameworkName: .NETFramework,Version=v4.7.2
    ImageRequiresX86: False
    ImageRequiresDefaultAppDomainAssemblyResolver: False

Test Run Summary
  Overall result: Passed
  Test Count: 500, Passed: 500, Failed: 0, Warnings: 0, Inconclusive: 0, Skipped: 0
  Start time: 2019-06-14 12:57:10Z
    End time: 2019-06-14 13:01:54Z
    Duration: 283.427 seconds

Results (nunit3) saved as ~\AppData\Local\Temp\a24272_20190614084338\UnitTests.TestResult.xml
Committing...
Visited Classes 20 of 10321 (0.19)
Visited Methods 56 of 154629 (0.04)
Visited Points 143 of 456738 (0.03)
Visited Branches 77 of 289454 (0.03)

==== Alternative Results (includes all methods including those without corresponding source) ====
Alternative Visited Classes 20 of 10857 (0.18)
Alternative Visited Methods 56 of 164855 (0.03)
C:\Xyz\tip> dir $CovResult


    Directory: ~\AppData\Local\Temp\a24272_20190614084338


Mode                LastWriteTime         Length Name
----                -------------         ------ ----
-a----        6/14/2019   9:02 AM      262507890 UnitTests.CoverageResult.xml


C:\Xyz\tip> cat $CovResult | sls "ModulePath>C:\\Xyz"

      <ModulePath>C:\Xyz\tip\Test\UnitTests\bin\Debug\nunit.framework.dll</ModulePath>
      <ModulePath>C:\Xyz\tip\Test\UnitTests\bin\Debug\UnitTests.dll</ModulePath>
      <ModulePath>C:\Xyz\tip\Test\UnitTests\bin\Debug\SchedulePolicyValidation.dll</ModulePath>
      <ModulePath>C:\Xyz\tip\Test\UnitTests\bin\Debug\Xyz.Data.dll</ModulePath>
      <ModulePath>C:\Xyz\tip\Test\UnitTests\bin\Debug\Xyz.WFM.Core.WorkContractPremium.Engine.dll</ModulePath>
      <ModulePath>C:\Xyz\tip\Test\UnitTests\bin\Debug\MultiApprovalProcessor.dll</ModulePath>
      <ModulePath>C:\Xyz\tip\Test\UnitTests\bin\Debug\HRMappingRuleEngine.dll</ModulePath>
      <ModulePath>C:\Xyz\tip\Test\UnitTests\bin\Debug\RuleEngine.dll</ModulePath>
      <ModulePath>C:\Xyz\tip\Test\UnitTests\bin\Debug\Xyz.Common.dll</ModulePath>
      <ModulePath>C:\Xyz\tip\Test\UnitTests\bin\Debug\AccrualEngine.dll</ModulePath>
      <ModulePath>C:\Xyz\tip\Test\UnitTests\bin\Debug\RuleEngineHelper.dll</ModulePath>
      <ModulePath>C:\Xyz\tip\Test\UnitTests\bin\Debug\StaffAssignment.dll</ModulePath>


C:\Xyz\tip>

Тот же результат.

...