community-plugins icon indicating copy to clipboard operation
community-plugins copied to clipboard

🐛 Code Coverage: Coverage value shown for folders in the File Explorer doesn't match line coverage

Open ChrisVandoo opened this issue 1 year ago • 1 comments

Plugin Name

code-coverage

📜 Description

The coverage value shown in the File Explorer for folders doesn't match the line coverage value.

👍 Expected behavior

The coverage value reported for a folder should match ( total lines - missed lines)/total lines.

👎 Actual Behavior with Screenshots

Screenshot 2024-07-05 at 3 23 08 PM In this case, the reported coverage for a top level directory was 67%.

However with 426 missed lines and 1492 tracked lines, we should have coverage of 1066/1492*100 = 71%

👟 Reproduction steps

  • setup Backstage/ configure the code coverage plugin
  • upload an lcov coverage report for a component with multiple files of differing lengths Example:
internal/ 
-- main.go (ex. 50 lines, 40 lines covered)
-- main_test.go
-- helper.go (ex. 200 lines, 50 lines covered)
-- helper_test.go

📃 Provide the context for the Bug.

Trying to avoid developer confusion when code coverage values don't line up as expected. Especially noticeable when looking at the root of a component and comparing with the line coverage value in the History tab.

👀 Have you spent some time to check if this bug has been raised before?

  • [X] I checked and didn't find similar issue

🏢 Have you read the Code of Conduct?

Are you willing to submit PR?

None

ChrisVandoo avatar Jul 05 '24 19:07 ChrisVandoo

Contributions welcome to address this 👍

awanlin avatar Jul 30 '24 14:07 awanlin

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar Sep 28 '24 18:09 github-actions[bot]