Skip to content

Code coverage is not collected for all the visits when Service is ran as command prompt console application. #237

@rinkal-chomal7

Description

@rinkal-chomal7

I am instrumenting and collecting dotnet code coverage using steps given below. The dotnet service for which this coverage is getting collected is started as command prompt console application and not as registered windows service.

Steps for Instrumentation and collection:

  1. altcover --save --inplace --single -i "C:\Users\Admin\Desktop\BuildServices\OEAService"
  2. Starting dotnet service application
  3. Running testcases
  4. Stopping dotnet service using below powershell command:
    if (Get-Process 'EAService' -ErrorAction SilentlyContinue) { Stop-Process -Name 'EAService' }
  5. altcover runner --collect -r "C:\Users\Admin\Desktop\BuildServices\OEAService" -c="C:\Users\Admin\Desktop\CodeCoverage\OEAService\coverage.xml"

When validated if all the visits were captured correctly in Cobertua coverage.xml, it was found that it is capturing only the hits which were captured on the console application i.e., main method and not rest of the logic/methods present in that EAService.exe.

But when i am registering this service and using it for starting and stopping the EAService, then it is capturing all the hits/visits properly in coverage file.

Can you please guide as if there are any changes required in my commands for collecting all the hits of EAService.exe.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions