Skip to content

Support coverage for py_test #43

@hwright

Description

@hwright

bazel coverage should generate a coverage report for the python tests it runs. Ideally, it gathers the list of dependencies, and then computes coverage over that for a given test. When multiple tests are run in the same Bazel invocation, their reports should be merged into a single one.

I'm dropping this here mostly as a python-specific version of bazelbuild/bazel#1118. I know that the py_test rule is currently implemented natively in Bazel, and the implementation in rules_python just forwards there, but this is fundamentally a python issue, so this repo feels appropriate.

The general plan is to modify the python test runner within Bazel to use coverage.py to generate reports when running under coverage. I suspect it is a journey fraught with peril.

Alternatively, if it is possible to invoke coverage.py in ways other than modifying core Bazel, I'm open to suggestions.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions