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
Integrate Code Coverage into CI #423
Comments
I like the idea of OpenCover. Since it's maintained by the guy who was last For my teams, I've never been a believer in running coverage more than Initially, I think we should get it baked into our NUnit.proj file. To do Charlie On Mon, Dec 15, 2014 at 10:43 AM, Rob Prouse notifications@github.com
|
I have also noticed that the open source version of ncover has had some development activity by other folks since the original developer formed his company. Since this is clearly something we should do at some point, I'm taking it out of the 'idea' category. I recognize it may not actually get done for 3.0. |
Interesting. Where have you seen this activity? On 18 July 2015 at 16:43, CharliePoole notifications@github.com wrote:
|
Well, I can't confirm because sourceforge is offline. The odd thing is that I saw activity as late as 2013 but there is no binary release after 2004. I'll check again when I can. |
Wow, Sourceforge has been down for quite a while. it looks like their On 18 July 2015 at 22:33, CharliePoole notifications@github.com wrote:
|
@rprouse, I suggest your initial thoughts of using OpenCover and ReportGenerator are good. I have used these tools on two previous projects. We added OpenCover and ReportGenerator to the Solution via NuGet and included the packages in source control so the CI server checked them out. I have virtually generic batch files that can be executed as postbuild steps (we were using Jenkins) The hardest part is to get the opencover exclusion syntax correct. It can be a bit tricky as the OpenCover documentation is not the best. |
From duplicate #883
|
Made this a build task. |
@dicko2 - I'm unassigning you from this issue for now - please feel free to grab it back if you want! |
OpenCover and ReportGenerator nuget packages are always my never fail go to packages. I also add OpenCoverToCoberturaConverter nuget package into the mix so I end up with test result XML that can be reported on (in my case) in Jenkins. My batch process is:
Then in post build I report on the NUnit Test results and publish HTML reports. Works a charm. Has been my approach now for 5 years. Dependable! Getting OpenCover filters correct the trickiest bit but after grappling with it for a while I can offer some insights if requested. |
@agray : This is my first real run in with the .NET world and nunit. I have a use case which is the following. Multiple NUnit dll's. Need to execute them all in one run. I can do this from powershell like this.
Now I need to somehow wrap this for OpenCover? Would you have a suggestion for this? |
@nunit/framework-team, would you be interested in using codecov.io? It adds and updates a comment like this one: OmerMor/AsyncBridge#16 (comment) The codecov diff helped me catch this really subtle error. Would the PR comment be too noisy? We can also configure how much is in it or remove it altogether. |
@jnm2 I would be for using codecov.io. I was planning to look into this or a similar code coverage tool for the analyzers project. And I don't mind the PR comments. |
I used OpenCover at AsyncBridge since the tests are .NET Framework-only, but OpenCover works via debugger profiling API so it doesn't work with .NET Core yet. |
I don't have a strong preference over framework, but I also like this idea. I found this after seeing a slack discussion from a bit ago about if we produced coverage reports. @OsirisTerje mentioned that the adapter is already doing this there and updating a badge in the readme to make the coverage visible. |
Just updating this to bring us up to speed after it came up tangentially again. I think the best way to proceed on this is going to be to use Coverlet which has become very popular for this purpose. Coverlet also has a Cake Plugin which I'm thinking might integrate nicely with how we're currently doing things. I may try to take this on, because why not? :) |
@stevenaw Yes, you're right. The adapter uses it, and Coverlet is also included in the nunit template we maintain in the dotnet test templates repository. So we should absolutely use it for the rest. |
I just wanted to put this out there as an idea and possibly a future task. I have been experimenting with OpenCover to run code coverage on the project and used ReportGenerator to generate HTML reports.
So far I've just run one of the framework tests, but we are getting 86.7% coverage which is pretty good. It does highlight some areas that are poorly tested, so I think it is a worthy exercise.
I am using the command line versions of both tools, but they are also available as NuGet packages that add MSBuild tasks.
An alternative might also be to use JetBrains' DotCover. They have a free license for open source teams that we could take advantage of.
The text was updated successfully, but these errors were encountered: