Edgewall Software
Modify

Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#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)

line_by_line_coverage.patch (1.6 KB) - added by chirila.s.alexandru@… 11 years ago.
Patch for build/pythontools that includes line by line coverage data in the report.
line_by_line_coverage2.patch (5.2 KB) - added by chirila.s.alexandru@… 11 years ago.
Patch for build/pythontools that includes line by line coverage data in the report, this also includes tests.

Download all attachments as: .zip

Change History (8)

Changed 11 years ago by chirila.s.alexandru@…

Patch for build/pythontools that includes line by line coverage data in the report.

comment:1 Changed 11 years ago by Tony Meyer <tony@…>

  • Cc tony@… added

comment:2 follow-up: 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].

Add Comment

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The ticket will remain with no owner.
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.