-
-
Notifications
You must be signed in to change notification settings - Fork 433
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
DO-NOT-MERGE: Patched-on LCOV file format support for coveragepy v4.x #863
Conversation
This is gross, it was done in a way that minized diffs. Reworking this to be non-ugly code for proper support in coveragepy would be great. I'm making the PR on a branch of v4.5.x as our existing changes do not apply cleanly after some of the refactoring in the git master (v5) code. We're still using patched 4.4.2 internally at the time of PR creation.
@gpshead Thanks. I have to admit, when I saw you started with "this is gross," I thought, "come on, how gross could it be?" Then I looked at the diffs... :) Is there a reference anywhere for the lcov file format? I found this: http://ltp.sourceforge.net/coverage/lcov/geninfo.1.php |
Oops, that was already in #587 (slurps coffee). |
@gpshead a couple of questions:
|
- 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. Closes #10433. PiperOrigin-RevId: 291166690
Fixed by #1289 ? |
oh boy! I can't wait to try that out and delete this ugly pile of code. :) |
This is gross as is, it was originally done in a way that minized diffs. :/
This PR is for discussion purposes only. I expect a new PR to be created by anyone interested on master to add lcov support in a non-hacky manner. :)
I'm making the PR on a branch of v4.5.x as our existing changes do not apply cleanly after some of the refactoring in the git master (v5) code.
We are using a patched 4.4.2 internally at the time of PR creation. This patch comes from Google where we've been carrying around some variant of this patch on top of coverage for a very long time. It clearly belongs upstream (starting that here), as the LCOV format seems to be supported by a variety of IDEs and other systems(?).
I don't expect to do future work in this PR itself. Follow #587 for actual details.
Lacking: Any LCOV format unittests. (sadface)
(I did not successfully run the coverage testsuite on this PR but that might have been my lack of trying and possibly a weird environment? They don't seem to run properly for me when following the v4.5.x branch howto.txt instructions but I didn't try to debug why)