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

Implementation of HTML Reports #105

Closed

Conversation

hunterjm
Copy link
Contributor

I know that you mentioned in #90 that you were leaning toward letting people choose their own HTML report generator, but my PR into ReportGenerator was recently merged, and this is a completely optional way of letting people who want to generate both coverage results and HTML reports in one command do so. If the new, optional, ReportTypes property is not specified, nothing changes.

@hunterjm hunterjm changed the title initial implementation of ReportGenerator.Core Implementation of HTML Reports May 21, 2018
@codecov
Copy link

codecov bot commented May 21, 2018

Codecov Report

❗ No coverage uploaded for pull request base (master@74fa3a2). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##             master     #105   +/-   ##
=========================================
  Coverage          ?   98.91%           
=========================================
  Files             ?       15           
  Lines             ?     1378           
  Branches          ?        0           
=========================================
  Hits              ?     1363           
  Misses            ?       15           
  Partials          ?        0

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 74fa3a2...955f021. Read the comment docs.

Copy link
Contributor

@coenm coenm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMHO, a report generator shouldn't be part of coverlet.core. Maybe it can be part of a coverlet plugin or something like that.
For users who want report generation, they can add a buildstep in their project specifying the generator of their choice.

Besides that, your code looks good to me.

@@ -7,13 +7,15 @@
using Coverlet.Core.Reporters;
using Microsoft.Build.Framework;
using Microsoft.Build.Utilities;
using Palmmedia.ReportGenerator.Core;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think coverlet should have a dependency on this specific report generator.

@hunterjm
Copy link
Contributor Author

@coenm - I see where you are going with that. Really this feature is completely optional. It does add a separate dependency to coverlet, but there are plenty of code coverage tools that include HTML report generation as a part of the base package. Istanbul for JavaScript, and Cobertura for Java are good examples of this.

I added this functionality more for simplicity than anything else. For simple projects that don't utilize a build script or custom MSBuild configuration, it seems overkill to have them add an extra step to add one. I suppose I could make a separate nuget package that hooks into MSBuild and runs after coverlet's GenerateCoverageResult task.

@tonerdo, if you believe that would be a better approach, let me know.

@tonerdo
Copy link
Collaborator

tonerdo commented May 22, 2018

I tend to agree with @coenm, this feature will be good as an add-on but doesn't really fit into the core library. Here a some reasons behind my reservation:

  • I imagine a situation where people might have issues with the html generation feature and open them in this repo.
  • This will take away visibility from the ReportGenerator project. I prefer Coverlet to focus on just the coverage bit and co-exist with supporting projects as opposed to trying to do everything in itself.

That being said, I understand the work that went into this. I'll leave this PR open and if there's considerable interest for this feature from the community then I'll merge it in

@hunterjm
Copy link
Contributor Author

@tonerdo - no worries. Wasn't too hard to implement. I do really like the simplicity of hooking into dotnet test for both, however. I'm going to explore creating a separate package that can marry the two and create a separate task that executes after GenerateCoverageResult to handle report generation.

@p10tyr
Copy link

p10tyr commented Oct 12, 2018

😮 This is a great feature! But I agree that this should not be in the Core

Problem is that we cannot consume Coverlet.Core because there is no package. The only way is to download the code and use that.. or make Private packages.

Please check this issue. #212

@MarcoRossignoli MarcoRossignoli added the enhancement General enhancement request label Jun 11, 2019
@MarcoRossignoli
Copy link
Collaborator

We close this stale PR for the moment, we'll re-open in future if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement General enhancement request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants