Skip to content

Coverlet is displaying the coverage as zero. #1021

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
AbedhBabu opened this issue Dec 18, 2020 · 9 comments
Closed

Coverlet is displaying the coverage as zero. #1021

AbedhBabu opened this issue Dec 18, 2020 · 9 comments
Labels
waiting for customer Waiting for customer action

Comments

@AbedhBabu
Copy link

We are using Coverlet to find the code coverage of our application. The UI automation tests are executed via an external tool called Rapise. After execution from TeamCity, the coverage is displaying as zero.

https://www.inflectra.com/Rapise/

Rapise is a tool used to automate Desktop/Windows applications.
SesVSUnit.dll is used to integrate the Rapise test suite with Visual Studio and from Visual Studio the test suites are triggered using Rapise.TestExecute() command.
Xunit is the test caller project.

Please note - we are able to get the coverage of unit tests and integration tests.

@AbedhBabu AbedhBabu changed the title Coverlet is giving the coverage. Coverlet is displaying the coverage as zero. Dec 18, 2020
@MarcoRossignoli
Copy link
Collaborator

Can you elaborate more?Can you write the command line command you're using?

@MarcoRossignoli MarcoRossignoli added the waiting for customer Waiting for customer action label Dec 20, 2020
@Adityanr
Copy link

Adityanr commented Dec 21, 2020

These are the commands we have used @AbedhBabu @MarcoRossignoli 👍

  1. Using Dotnet Test with Coverlet output: "C:\Program Files\dotnet\dotnet.exe" test UISDKStyle.csproj --configuration Release --no-build --verbosity Normal /property:CollectCoverage=True /property:CoverletOutput=UISDKStyle.opencover.xml /property:CoverletOutputFormat=opencover

  2. Using Coverlet.exe directly: C:\Users\abedh\.dotnet\tools\coverlet.exe UISDKStyle.dll --target dotnet --targetargs "test UISDKStyle.csproj --no-build --verbosity normal" --output UISDKStyle.opencover.xml --format opencover'

UISDKStyle: This is a UI Automation test SDK style project whose tests are run through an external tool called Rapise.

@daveMueller
Copy link
Collaborator

Sorry just to make it more clear. Your output UISDKStyle.opencover.xml doesn't have any coverage data or is it only teamcity that doesn't display the coverage?

@AbedhBabu
Copy link
Author

Hi Dave, after the test execution, the UISDKStyle.opencover.xml is not having any coverage data.

@daveMueller
Copy link
Collaborator

OK so you basically want to know how much of your UI Code is covered by the Rapise tests? Can I ask what kind of UI it is, WPF, Forms, Web or some mobile?
I personally never tried to use coverlet on UI code thus I really don't know if those assemblies are instrumented and I have to give it a try.

@AbedhBabu
Copy link
Author

We are using Win Forms.

@daveMueller
Copy link
Collaborator

Sorry for the late response but it took some time to set a project up that is comparable to your scenario. Instead of Rapise I used Appium with the WinAppDriver. You can find my project here (https://github.com/daveMueller/CoverletWinFormsUiAutomationTests).

While setting this up i stumbled across a recent change in coverlet which is documented here (https://github.com/coverlet-coverage/coverlet/blob/master/Documentation/GlobalTool.md#code-coverage-for-integration-tests-and-end-to-end-tests)

You can check the powershell file in my repo to see how I'm using coverlet. However it works better than I had expected.

image

image

And even the generated UI Code is covered.

image

There is one issue. I think this feature isn't released yet because the PR was just merged recently (#991). @MarcoRossignoli is there already a release with this PR?

In my test repo I compiled it myself but to try it with Rapise you could just grab the coverlet version in my repo or compile current master by yourself.

@MarcoRossignoli
Copy link
Collaborator

@MarcoRossignoli is there already a release with this PR?

No will be release on 3.0.0 #1030 for now we can use the nightly build https://github.com/coverlet-coverage/coverlet/blob/master/Documentation/ConsumeNightlyBuild.md

@MarcoRossignoli
Copy link
Collaborator

Closing for stale conversation, feel free to reopen if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting for customer Waiting for customer action
Projects
None yet
Development

No branches or pull requests

4 participants