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

Coverage report fails when there are 0 resources #803

Open
raemer opened this issue Aug 19, 2020 · 0 comments
Open

Coverage report fails when there are 0 resources #803

raemer opened this issue Aug 19, 2020 · 0 comments

Comments

@raemer
Copy link
Contributor

raemer commented Aug 19, 2020

Hi,

while writing tests for a provider with coverage reports on, I noticed this behavior:
If there are no resources, this is detected correctly as "Total resources: 0, Touched resources: 0", but the resources coverage is NaN%. The code coverage check then fails:

expected: >= 100.0
got:    0.0

As the test doesn't really have a meaning if there are no resources, I implemented a check if the total is zero, setting the coverage to 100% if so and opened pull request #802 .
Though 100% is as wrong as 0%, it seems to be more useful as it does not generate meaningless failed tests.

Best regards,
Jan-Martin

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

No branches or pull requests

1 participant