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

Print total coverage in console #229

Closed
stepango opened this issue Aug 31, 2022 · 6 comments · Fixed by #365
Closed

Print total coverage in console #229

stepango opened this issue Aug 31, 2022 · 6 comments · Fixed by #365
Assignees
Labels
Feature Feature request issue type Kover Coverage Tool S: ready for release Status: merged in the main branch
Milestone

Comments

@stepango
Copy link

After the koverMergedHtmlReport task is executed, I only see the link to the report, so to check the actual total coverage value I need to open the report itself. So I want to avoid that.

Is there any way to print the total coverage value in the console?

@shanshin
Copy link
Collaborator

Relates #155

@shanshin
Copy link
Collaborator

@stepango , if I understand correctly, do you want the total percentage of line coverage with the same class-filters used for the HTML report to be displayed in the console?

We planning to add a separate task to output the coverage to the build log, but we would like to understand how to make it convenient:

  • is it necessary to add output formatting
  • is it necessary to overload class filters as for other reports
  • print only total coverage or it is necessary to print by classes/packages
  • which metric should be used: always by lines or additionally need a metric by instructions/branches

@stepango
Copy link
Author

stepango commented Sep 6, 2022

@shanshin yes that's correct. Back in a days, I used to parse jacoco reports, get total coverage from there and print in console, which is helpful on CI or on local if I just want to check current coverage after the latest changes.

So yeah, for my use case smth as simple as printing total coverage in already existing tasks together with the path to the full report will work.

@shanshin shanshin added Kover Coverage Tool Feature Feature request issue type Design needed S: postponed Status: work on the issue is not in the short term plans labels Oct 17, 2022
@shanshin shanshin added this to the Release 0.8.0 milestone Oct 27, 2022
@shanshin shanshin self-assigned this Oct 27, 2022
@CLOVIS-AI
Copy link

Since the issue about the integration of these metrics with GitLab was merged as duplicate with this one, I'll summarize here what GitLab requires:

• if multiple values are printed, there should be only one per line
• it should be easy to grep for a specific value

The common solution with other tools is to output similar to:

Total class coverage: 50.0%
Total branch coverage: 37.5%
...

Other than that there are no particular requirements so hopefully this doesn't hinder what you had in mind.

shanshin added a commit that referenced this issue Jun 22, 2023
Added task with name `koverLog`, configured by `log { }` block in report variant's configuration

Resolves #229
shanshin added a commit that referenced this issue Jun 22, 2023
Added task with name `koverLog`, configured by `log { }` block in report variant's configuration

Resolves #229
@dragetd
Copy link

dragetd commented Jun 25, 2023

@shanshin I am so happy to see this being integrated! Thank you very much! <3 Looking forward for the next release.

shanshin added a commit that referenced this issue Jun 26, 2023
Added task with name `koverLog`, configured by `log { }` block in report variant's configuration

Resolves #229
@shanshin shanshin added S: ready for release Status: merged in the main branch and removed S: postponed Status: work on the issue is not in the short term plans labels Jun 26, 2023
@shanshin shanshin reopened this Jun 26, 2023
@shanshin
Copy link
Collaborator

Implemented in 0.7.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Feature request issue type Kover Coverage Tool S: ready for release Status: merged in the main branch
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants