#109 closed defect (wontfix)

current upstream figleaf doesn't do the right thing

Reported by: warner Owned by: warner
Priority: minor Milestone: 1.7.0
Component: dev-infrastructure Version: 1.5.0
Keywords: figleaf Cc:
Launchpad Bug:

Description (last modified by warner)

http://allmydata.org/tahoe-figleaf/figleaf-edgy-432/allmydata.util.version_class.html

This code-coverage annotation is weird. I think we've got another bug in the way that figleaf figures out which lines are which. This is the only file for which I'm seeing weird behavior, though, so maybe it is related to the fact that version_class is imported slightly weirdly: (allmydata/__init__.py imports allmydata._version which imports allmydata.util.version_class which must of course import allmydata.util.__init__ first.. ok, maybe not all that weird.

Change History (9)

comment:1 Changed at 2007-08-17T01:35:45Z by warner

looking at that annotated file, it's almost as if all the lines of code that were executed at initial import were then removed from the set of lines that figleaf thought got executed, like there's some sort of set math gone wrong.

comment:2 Changed at 2007-08-17T01:36:14Z by warner

  • Description modified (diff)

comment:3 Changed at 2008-06-01T20:47:51Z by warner

  • Milestone changed from eventually to undecided

comment:4 Changed at 2009-11-12T01:15:09Z by warner

  • Summary changed from our figleaf line-counting code is broken again to current upstream figleaf doesn't do the right thing
  • Version changed from 0.4.0 to 1.5.0

this is a very old ticket, and figleaf has changed since then (not that the issue has been fixed, mind you). And our customized figleaf code was entirely ripped out a month ago in the interests of getting Tahoe into Ubuntu (to make it easier to explain the copyright and provenance of all the source files: figleaf is free software, but not written by us, and removing it was the fastest solution).

So I'm going to repurpose this ticket to document the problems I'm currently experience with figleaf (using figleaf-0.6.1, installed with "easy_install").

  • changing our Makefile's figleaf-output target to run: figleaf2html -d coverage-html -x misc/figleaf.excludes is a starting point
  • but it includes every non-stdlib .py file ever touched, including Twisted and a variety of support libraries, and I want our coverage info to only include files under src/allmydata
  • creating a list of all desired .py files (by figuring out the absolute path of the current directory, and doing find ABSPATH/src -name '*.py' >allfiles, then passing that to figleaf's new --files option, correctly causes figleaf to ignore everything outside of src/allmydata/
  • but the HTML output fails in a few ways:
    • files are named by their absolute paths, which is noisy and not uniform between systems. Each filename should have the ABSPATH/src/ prefix removed. Ideally, the filename should be turned into an import path (so allmydata.immutable.filenode instead of allmydata/immutable/filenode.py)
    • there should be a "lines uncovered" column
    • there should be one copy of the table sorted by lines uncovered (with least-coverage at the top): the top-most file indicates where the test-adding work should be done
    • there should be another copy of the table sorted by filename (alphabetically)

In addition to that, I think the which-lines-are-code-vs-comments machinery is off.. on my OS-X 10.6 system (with python2.6.1), blank lines appear as uncovered code, many "then:" statements show as uncovered even though their subsequent statements are covered, and comments appear as a mix of non-code and uncovered code. (I saw similar problems when I moved from py2.4 to py2.5, but not as bad as these. (I was kind of hoping that a new upstream version would work better).

comment:5 Changed at 2009-11-12T04:05:53Z by zooko

Hrm, so where can we report these bugs so that other figleaf maintainers will see them? figleaf doesn't seem to have a bug tracker. Hm, I just found https://launchpad.net/txfigleaftrial . That sounds interesting. Okay I think the next step is "request that an issue tracker be created for figleaf".

comment:6 Changed at 2009-11-12T04:08:48Z by zooko

Oh, easy_install figleaf should have gotten figleaf v0.6.1: http://pypi.python.org/pypi/figleaf , and there are four patches in the upstream figleaf darcs repository since v0.6.1:

Sun Nov 16 21:22:47 MST 2008  titus@idyll.org
  * Mark Seaborn's fix for leading whitespace

Sun Jul 20 14:17:56 MDT 2008  titus@idyll.org
  * Added Ondrej Certik's patch fixing get_lines, after some refactoring

Sat Mar 22 11:29:25 MDT 2008  titus@idyll.org
  * fixed excl behavior for imports to look at __file__ before f.f_code.co_filename

Thu Jan 10 03:24:24 MST 2008  titus@idyll.org
  tagged release-0.6.1

Maybe try figleaf HEAD?

http://darcs.idyll.org/~t/projects/figleaf

comment:7 Changed at 2009-11-13T03:20:48Z by zooko

If you like this ticket, you may also like #810 (where did figleaf_htmlizer.py come from?), #387 (figleaf confused by python2.5), and #623 (figleaf: compute+display differential coverage).

comment:8 Changed at 2010-01-27T23:14:11Z by zooko

  • Milestone changed from undecided to 1.7.0

comment:9 Changed at 2010-02-27T18:19:40Z by zooko

  • Resolution set to wontfix
  • Status changed from new to closed

We no longer care about this ticket because #930 (switch from figleaf to coverage.py).

Note: See TracTickets for help on using tickets.