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

Python coverage: experimental first steps #10433

Closed
wants to merge 1 commit into from

Conversation

ulfjack
Copy link
Contributor

@ulfjack ulfjack commented Dec 17, 2019

  • Add lcov_merger as an attribute to the py_test rule so that it does
    not immediately fall over
  • Add a small section to python_stub_template.txt to perform minimal
    setup for coverage integration

I was able to get this to work manually by using a modified version of
coverage.py, see:
nedbat/coveragepy#863

Note that the patch does not work out of the box.

It's basically ~impossible to add integration tests until we get a
working version of coverage.py, but this is the minimum change required
in Bazel to get a basic working version.

- Add lcov_merger as an attribute to the py_test rule so that it does
  not immediately fall over
- Add a small section to python_stub_template.txt to perform minimal
  setup for coverage integration

I was able to get this to work manually by using a modified version of
coverage.py, see:
nedbat/coveragepy#863

Note that the patch does not work out of the box.

It's basically ~impossible to add integration tests until we get a
working version of coverage.py, but this is the minimum change required
in Bazel to get a basic working version.
@jin jin added the team-Rules-Python Native rules for Python label Dec 20, 2019
@ulfjack ulfjack closed this Jan 22, 2020
@ulfjack ulfjack deleted the py-coverage branch January 22, 2020 10:46
bazel-io pushed a commit that referenced this pull request Jan 23, 2020
- Add lcov_merger as an attribute to the py_test rule so that it does
  not immediately fall over
- Add a small section to python_stub_template.txt to perform minimal
  setup for coverage integration

I was able to get this to work manually by using a modified version of
coverage.py, see:
nedbat/coveragepy#863

Note that the patch does not work out of the box.

It's basically ~impossible to add integration tests until we get a
working version of coverage.py, but this is the minimum change required
in Bazel to get a basic working version.

Closes #10433.

PiperOrigin-RevId: 291166690
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes team-Rules-Python Native rules for Python
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants