#822 closed enhancement (fixed)
[PATCH] Read line-by-line coverage data in the `python:coverage` tool.
Reported by: | chirila.s.alexandru@… | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | 0.7 |
Component: | Recipe commands | Version: | dev |
Keywords: | Cc: | tony@… | |
Operating System: |
Description
All the necessary implementations are already in place. This patch reads the annotated files from the coverdir and put's them into the report.
Attachments (2)
Change History (8)
Changed 11 years ago by chirila.s.alexandru@…
comment:1 Changed 11 years ago by Tony Meyer <tony@…>
- Cc tony@… added
comment:2 follow-up: ↓ 3 Changed 11 years ago by osimons
Looks good. Thanks! I see we provide this feature for both python:trace and python:figleaf tools, but not for python:coverage. It should indeed be supported, although as far as I can see the tool only supports 'executed' and 'missed' markings for each line. The simple '1' and '-' results of patch is therefore not quite up to par with the other tools that actually provide full line hit count.
Could you please add unit tests for the line-by-line data so that we also indirectly have documentation of the expected format and assurance that the code works. Just update bitten.build.tests.pythontools.CoverageTestCase with new methods as needed, and include in a refreshed patch.
comment:3 in reply to: ↑ 2 Changed 11 years ago by anonymous
Replying to osimons:
The simple '1' and '-' results of patch is therefore not quite up to par with the other tools that actually provide full line hit count.
Unfortunately the coverage tool does not support this, and it will only tell if the line was hit or not, but not how many times :(
Could you please add unit tests for the line-by-line data so that we also indirectly have documentation of the expected format and assurance that the code works.
I'll be glad to do this.
Changed 11 years ago by chirila.s.alexandru@…
Patch for build/pythontools that includes line by line coverage data in the report, this also includes tests.
comment:4 Changed 11 years ago by anonymous
I've added some tests for this functionality in the new patch. (all of which are passing)
~/bitten-trunk$ python bitten/build/tests/pythontools.py ...........No handlers could be found for logger "bitten.build.pythontools" ................. ---------------------------------------------------------------------- Ran 28 tests in 0.047s OK
As I mentioned before, the coverage tool does not give the necessary information about the hit count, just 'executed' and 'missed'. This might make it a bit confusing when displaying the result, because it also displays 1 and 0 respectively.
Let me know if I can assist with anything else.
comment:5 Changed 11 years ago by osimons
- Milestone set to 0.7
- Resolution set to fixed
- Status changed from new to closed
Thanks! Patch committed in [1022].
comment:6 Changed 11 years ago by osimons
Follow-up fix for Windows tests committed in [1024].
Patch for build/pythontools that includes line by line coverage data in the report.