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

The calculation of test coverage percentage does not account for all source files #402

Closed
a1div0 opened this issue Nov 13, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@a1div0
Copy link
Collaborator

a1div0 commented Nov 13, 2024

Let's consider an example. We have a project with several source files:

  • too.lua with 4 lines
  • foo.lua with 100 lines
  • bar.lua with 200 lines

Let's assume each has a hundred lines. And suppose there is one test that covers the entire too.lua file.

What I expect to see:

==============================================================================
Summary
==============================================================================

File                        Hits Missed Coverage
------------------------------------------------
too.lua                     4    0      100.00%
foo.lua                     0    100    0.00%
bar.lua                     0    200    0.00%
------------------------------------------------
Total                       4    300    1.32%

What we see now:

==============================================================================
Summary
==============================================================================

File                        Hits Missed Coverage
------------------------------------------------
too.lua                     4    0      100.00%
------------------------------------------------
Total                       4    0      100.00%

In my opinion, if foo.lua and bar.lua are not in the list of excluded directories and files, then this result is incorrect.

@a1div0 a1div0 self-assigned this Nov 13, 2024
@a1div0 a1div0 added the bug Something isn't working label Nov 13, 2024
@a1div0 a1div0 linked a pull request Nov 13, 2024 that will close this issue
@a1div0
Copy link
Collaborator Author

a1div0 commented Nov 14, 2024

Fixed here

@a1div0 a1div0 closed this as completed Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant