-
Notifications
You must be signed in to change notification settings - Fork 559
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
feat: new COVERAGEPY_IGNORE_ERRORS env var #2597
base: main
Are you sure you want to change the base?
feat: new COVERAGEPY_IGNORE_ERRORS env var #2597
Conversation
I think it makes sense to provide a mechanism to let coveragepy ignore errors. I also wonder if it makes sense to provide a way for all of the coveragepy CLI arguments to be supplied? I think the torch errors that motivate this PR can probably also be avoided by excluding that source from coverage. Ignoring all errors would avoid the torch error, but possibly also mask others. To be clear, I still think there are valid scenarios to ignore all, so this PR still LGTM. WDYT @rickeylev |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Co-authored-by: Greg Roodt <[email protected]>
This was initially my approach but since there are 2 runs:
From nedbat/coveragepy#1921 (comment), I think an alternative would be
Yeah, that's indeed another risk. Although, I think we should be fine since |
How about enabling ignore errors by default instead? |
That's one option but it could hide other potential issues by default. I think it'd be best if the user can first see the error, then decide if errors are to be ignored. This opt-in approach is sufficient for the time being. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I heartily endorse this
Background
This is a proposal to have a workaround for #2575 where an inherent issue from coverage.py when creating the lcov output file.
Proposed Changes
An env var flag that a user can turn on via
--test_env=COVERAGEPY_IGNORE_ERRORS=true
when runningbazel coverage
.Reproducible steps
We can see how this proposal addresses the issue described from https://github.com/BurnzZ/rules_python.
MODULE.bazel
:Issue from #2575 now resolved. 🎉