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

ensure hides actual exception coverage #588

Closed
gurukamath opened this issue Aug 21, 2022 · 0 comments
Closed

ensure hides actual exception coverage #588

gurukamath opened this issue Aug 21, 2022 · 0 comments
Labels
A-spec Area: specification C-enhance Category: a request for an improvement E-medium Experience: of moderate difficulty

Comments

@gurukamath
Copy link
Collaborator

gurukamath commented Aug 21, 2022

I have been analysing if we can identify the need for writing additional tests (or expanding the current tests that we support) based not the coverage report from codecov.

I've found that the ensure statements in the specs hide the real coverage of a check that we perform.

For example - line 511 in the frontier/spec.py file
The codecov report shows that the line is covered. However, the single line ensure hides whether the InvalidBlock exception is actually ever triggered here. Turns out that it never is triggered.

There are a few other instances as above.

I propose that we replace all ensure statements in the spec with multiline checks of the format. That way we can identify exactly which checks have no real "hits"

if check:
      raise InvalidBlock

@SamWilsn @petertdavies What do you think?

@SamWilsn SamWilsn added this to the Post-Cancun Refactoring milestone Apr 10, 2024
@SamWilsn SamWilsn added A-spec Area: specification C-enhance Category: a request for an improvement E-medium Experience: of moderate difficulty labels Apr 10, 2024
@SamWilsn SamWilsn closed this as completed May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-spec Area: specification C-enhance Category: a request for an improvement E-medium Experience: of moderate difficulty
Projects
None yet
Development

No branches or pull requests

2 participants