Skip to content

Can't figure out command line for coverlet global tool #911

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
michaelakin opened this issue Jul 22, 2020 · 4 comments
Closed

Can't figure out command line for coverlet global tool #911

michaelakin opened this issue Jul 22, 2020 · 4 comments
Labels
waiting for customer Waiting for customer action

Comments

@michaelakin
Copy link

michaelakin commented Jul 22, 2020

I am using the following two commands to try and generate a file in the opencover format so I can use the ReportGenerator and generate a coverage report locally.

coverlet "ProjectName.Library.Test\bin\Debug\netcoreapp3.1\ProjectName.Library.dll" --target "dotnet" --verbosity detailed --targetargs "test ProjectName.Library.Test\ProjectName.Library.Test --no-build" --output Coverage\coverage.json --exclude "[*Tests]*,[Shared.Library]*"
coverlet "ProjectName.Service.Test\bin\Debug\netcoreapp3.1\ProjectName.Service.dll" --target "dotnet" --verbosity detailed --targetargs "test ProjectName.Servcie.Test\ProjectName.Service.Test --no-build" --output Coverage\coverage.json --exclude "[*Tests]*,[Shared.Library]*" --merge-with Coverage\coverage.json --format "opencover"

This does not seem to work and I cannot figure out the syntax.
Here are the problems I am encountering:

  • It shows zero percent coverage.
  • There is only one file in the Coverage folder.
  • it does not seem to be excluding the SharedLibary

Please help me figure this out. Thanks in advance.

here is the results showing zero percent coverage and including the shared library when it should not.

2020-07-22_17-23-57

@MarcoRossignoli
Copy link
Collaborator

MarcoRossignoli commented Jul 23, 2020

Checking your logs there are a problem with hits file...that hits file...not found tell us that no hits are collected during tests, issue can be two:

  1. you're not running any tests
  2. you're suffering by know issue https://github.com/coverlet-coverage/coverlet/blob/master/Documentation/KnownIssues.md#1-vstest-stops-process-execution-earlydotnet-test

Can you try to enable verbose logging and attach https://github.com/coverlet-coverage/coverlet/blob/master/Documentation/Troubleshooting.md#coverlet-global-tool
Also you should try with collectors(doesn't suffer of know issue and it's the reliable way to use coverlet today) https://github.com/coverlet-coverage/coverlet/blob/master/Documentation/VSTestIntegration.md

@MarcoRossignoli MarcoRossignoli added the waiting for customer Waiting for customer action label Jul 23, 2020
@michaelakin
Copy link
Author

I tried to enable the detailed verobisity and I get:
Unexpected value 'detailed' for option 'verbosity'

On the collectors, nothing I have seen so far will let me specify where the files go and to merge multiple project files into one so I can see the coverage percent for the solution.

@MarcoRossignoli
Copy link
Collaborator

MarcoRossignoli commented Jul 24, 2020

For collectors the way to get logs is https://github.com/coverlet-coverage/coverlet/blob/master/Documentation/Troubleshooting.md#collectors-integration

At the moment collectors doesn't provide a way to merge reports as is. There are two workaround, first use report tools like reportgenerator (it accepts a list of reports and merge together) the second is a script trick #225 (comment)

@MarcoRossignoli
Copy link
Collaborator

close 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

2 participants