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

Show # of Covered Lines Diff in Summary #359

Open
grant opened this issue Apr 12, 2023 · 5 comments
Open

Show # of Covered Lines Diff in Summary #359

grant opened this issue Apr 12, 2023 · 5 comments
Labels
enhancement New feature or request

Comments

@grant
Copy link

grant commented Apr 12, 2023

Idea

Our codebase always shows coverage diff results that aren't significant. Examples:

  • -0%
  • 7162/33582 statements covered

I'd like to report the exact number of statements/branches/functions/lines covered and added/removed. For small PRs it will show something like 0 of 4 statements added have coverage.

Description

Here's a proposal.

Actual

St.
Category Percentage Covered / Total
🔴 Statements
21.33% (-0% 🔻)
7162/33582
🔴 Branches
12.93% (-0% 🔻)
2412/18660
🔴 Functions 18.52% 1764/9524
🔴 Lines
21.32% (-0% 🔻)
6525/30599

Desired

St.
Category Percentage Covered / Total
🔴 Statements
21.33% (-0% 🔻)
7162/33582 (0/4)
🔴 Branches
12.93% (-0% 🔻)
2412/18660 (0/1)
🔴 Functions 18.52% 1764/9524 (0/1)
🔴 Lines
21.32% (-0% 🔻)
6525/30599 (0/4)

Alternatives

Not show the diff number, only show the diff percent.

Additional context

Happy to create a PR, or just start a discussion.

`${currSummary.covered}/${currSummary.total}`,

@grant grant added the enhancement New feature or request label Apr 12, 2023
@ArtiomTr
Copy link
Owner

Hey @grant 👋,

Great idea! I think that report could just contain statement/branch/etc. delta, if percent change is insignificant. For instance, in your case, this could look like:

St.
Category Percentage Covered Total
🔴 Statements 21.33% 7162
33582 (+4 🔺)
🔴 Branches 12.93% 2412
18660 (+1 🔺)
🔴 Functions 18.52% 1764 9524
🔴 Lines 21.32% 6525
30599 (+4 🔺)

So if percent delta is below some threshold (for instance 0.1 percent), then action should generate information about exact category changes, not percents.

I think, with this format, the report will contain more useful information in large codebases, while being simple in smaller repositories. Let me know what you think about this solution!

@grant
Copy link
Author

grant commented Apr 12, 2023

Yeah that resulting UI would be perfect @ArtiomTr!

I think the 0.1 threshold sounds reasonable, users don't get much info from that percentage change, but may get some useful info from the line change at that level.

Not sure how hard it is to change that; happy to test it.

@ArtiomTr
Copy link
Owner

@grant PRs are welcome, if you have any questions regarding the code - feel free to ping me 🙌

@grant
Copy link
Author

grant commented Apr 13, 2023

I'll try to get to a PR for this, thanks!

@grant
Copy link
Author

grant commented Apr 24, 2023

Note: I'm not able to get to a PR for this, tried but it was a little complicated setting things up. We're using a different reporting method, but could use this action in the future.

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

No branches or pull requests

2 participants