Uh oh!
There was an error while loading. Please reload this page.
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 |
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Greg Roodt <groodt@gmail.com>
BurnzZ
commented
Feb 2, 2025
This was initially my approach but since there are 2 runs:
From coveragepy/coveragepy#1921 (comment), I think an alternative would be
Yeah, that's indeed another risk. Although, I think we should be fine since |
rickeylev
commented
Feb 2, 2025
How about enabling ignore errors by default instead? |
BurnzZ
commented
Feb 2, 2025
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. |
timothy-tlj-jones-canva
left a comment
There was a problem hiding this comment.
I heartily endorse this
aignas
commented
Mar 7, 2025
Is this needed if we have #2607? |
BurnzZ
commented
Mar 7, 2025
…ests (#2607) This ensures that un-executed files _(i.e. files that aren't tested)_ are included in the coverage report. The current behavior is that coverage.py excludes them by default. This PR configures source files via the auto-generated `.coveragerc` file. See https://coverage.readthedocs.io/en/7.6.10/source.html#execution: > If the source option is specified, only code in those locations will be measured. Specifying the source option also enables coverage.py to report on un-executed files, since it can search the source tree for files that haven’t been measured at all. Closes#2599Closes#2597Fixes#2575 --------- Co-authored-by: Ignas Anikevicius <240938+aignas@users.noreply.github.com>
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=truewhen 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. 🎉