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
Add simple filtering to generated html report #442
Conversation
Hi @Otanikotani , could you please clarify use case?
I believe that without any modifications in JaCoCo it is already possible to exclude/include only files from specific packages into report. Using an Ant Task you can even split them into different groups - see http://www.eclemma.org/jacoco/trunk/doc/ant.html#report |
Hi @Godin , Thank you for sharing about grouping, I didn't know that there is a feature like that. Here are the reasons why I added a filter:
It could be that my use-case (making screenshots, sigh) is not very common, I understand. What can be done instead of adding a filter (as in this pull request) is adding a possibility to template the report. Of course, when ant is used I can just inject anything I want into index.html once it is generated (it is getting more difficult with maven) - but I feel like it would be a hacky way of doing it. |
@Otanikotani speaking about Maven - in example.zip you'll find example of project for which you can
Note that you don't need to change any files and re-run tests to generate reports containing new set of files. I assume (strongly believe) that time to generate report is much smaller and negligible compared to time to execute tests. If this is not the case, then please provide exact measurements for your case. This way you can attach to Jira ticket whole report containing required classes without need in a screenshot. IMO this fully covers your use case, isn't it? |
Forgot to say that CSV report is easy to filter out:
And most likely application of XSLT stylesheet on XML report already gives "templating". |
I would like to vote for the PR, since I have the same issues as @Otanikotani . The project I'm working on isn't maven based, but ant based. Also, the project I'm working in has some complex configurations that I'm not supposed to touch. I agree that CSV and XML reports can be filtered, but I mostly use the HTML report, and having filtering would be really beneficial. |
I think this can be a nice feature just for convenience if the project is large enough and the number of packages and classes is large. |
In projects I work on it is important to be able to see only specific packages in the JaCoCo HTML report. Hence I added a very simple input field to the report to filter packages\classes by name. Here is an example of how it looks\works: http://prnt.sc/c6be4i
Please note that Total row is a lie after filtering ;)
P.S. I also added a cdn style from Materialize project to make report look more beautiful but I think it is not to be included there (this is how it looks with minimal effort: http://prnt.sc/c6bhso)