Skip to content
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

how to use coverlet as project in a solution #600

Closed
Nitin5acc opened this issue Oct 29, 2019 · 10 comments
Closed

how to use coverlet as project in a solution #600

Nitin5acc opened this issue Oct 29, 2019 · 10 comments
Labels
question This issue is a question

Comments

@Nitin5acc
Copy link

Hello,

we would like to use this source code and create coverlet .net core projects in our application (sln) which can be used on other projects to check coverage.
We have taken the code from this repo and added it in our solution. However, no coverage is generated.

@MarcoRossignoli MarcoRossignoli added the question This issue is a question label Oct 29, 2019
@MarcoRossignoli
Copy link
Collaborator

MarcoRossignoli commented Oct 29, 2019

Hi Nitin,

it's not clear to me your question...would you like to have a coverage after run your test projects?
You need to follow the guide https://github.com/tonerdo/coverlet#installation
Why you download sources?

@Nitin5acc
Copy link
Author

Nitin5acc commented Oct 29, 2019

Hello, we would not like to use coverlet as package. We want to bring source code into our solution, build the same and use that as dll to check the coverage on other projects.

Also, we are using the release 5.2.2 version as its new and advance but the package(coverlet.collector) version is 1.1.0

@MarcoRossignoli
Copy link
Collaborator

MarcoRossignoli commented Oct 29, 2019

Hello, we would not like to use coverlet as package. We want to bring source code into our solution, build the same and use that as dll to check the coverage on other projects.

Why?I mean coverlet needs some steps to work...if you want to use directly che code you need to follow more or less what console do https://github.com/tonerdo/coverlet/blob/master/src/coverlet.console/Program.cs#L64

Coverlet need to do some steps https://github.com/tonerdo/coverlet#how-it-works

BTW we have future plan to expose coverlet core as stand alone package for custom coverage #212

@MarcoRossignoli
Copy link
Collaborator

Coverlet works in 3 different way and it depends on "drivers".
We can run using custom .NET tool, msbuild tasks injection or integrated inside vstest as collectors. So depends on how you want to use it, the more secure way is through collectors due to some know issue https://github.com/tonerdo/coverlet/blob/master/Documentation/KnowIssues.md#1-vstest-stops-process-execution-earlydotnet-test

@Nitin5acc
Copy link
Author

Hello,
We cloned all three projects - Core, Collector, and Console but still, we see no coverage file. Do you have any samples where source code was used?

@MarcoRossignoli
Copy link
Collaborator

MarcoRossignoli commented Oct 30, 2019

As I've said above you can copy .net tool usage https://github.com/tonerdo/coverlet/blob/master/src/coverlet.console/Program.cs#L64 we don't have an example on codebase
Maybe @shargon can help here, they used coverlet by code.

TL;DR; We don't have an example because at the moment core features are designed only for internal usage so they're not stable until we'll release core coverlet features as "standalone".

@MarcoRossignoli
Copy link
Collaborator

At the moment we're blocked on vstest bug, after that fix we can go on with hiding all class and design a stable api to expose internal features microsoft/vstest#2221

@shargon
Copy link

shargon commented Oct 31, 2019

@MarcoRossignoli
Copy link
Collaborator

@Nitin5acc feel free to close if solved, thanks @shargon for the sample!

@MarcoRossignoli
Copy link
Collaborator

@Nitin5acc related PR #628

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question This issue is a question
Projects
None yet
Development

No branches or pull requests

3 participants