[TIP] Branch report and subprocess coverage using Ned's coverage.py in Hudson matrix build job

Olemis Lang olemis at gmail.com
Tue Sep 21 10:45:03 PDT 2010

On Tue, Sep 21, 2010 at 1:10 PM, Ned Batchelder <ned at nedbatchelder.com> wrote:
>  Hi Olemis,


> On 9/21/2010 11:57 AM, Olemis Lang wrote:
>> I run Ned's coverage with `--branch` option set . After generating
>> Cobertura XML report it includes tags similar the one shown below :
> The XML report didn't have correct branch info until the latest release
> (3.4).  Update your coverage.py, and it should work for you.
>> So I suppose it's tracking branch coverage. Nonetheless the HTML report
>> published by Hudson displays (under Conditionals) `N/A` and `0/0`
>> rather than meaningful results.
>> Q:
>>   - Is it the expected behavior or probably I'm missing something?
>>   - AYCS `method` tag is always empty. Is it Ok ? Is there a way
>>     to make coverage output method info ?
> Coverage.py doesn't associate data with methods or classes, only lines and
> files.

Cool ! will do right away

>> OTOH I'm facing some problems setting up subprocess coverage .
>> export COVERAGE_PROCESS_START=.coveragerc
>> Q:
>>   - What could I do ?
> You should verify that the subprocess run by trac is using the Python
> installation and Python path that you've modified.  You also need to verify
> that it sees the COVERAGE_PROCESS_START environment variable.

I'd expect this to happen since I included the export shown above .
Nonetheless I'll check out ...

> Can you
> modify standalone.py just to get some debugging information from it?  Have
> it dump out the sys.executable, sys,path, and os.environ to see what it
> sees.

Of course !!! Let's see what happens .

> You probably want to add "parallel=True" to your .coveragerc, though I don't
> think that's the problem yet.

Ahhh ! 'cause the subprocess enables parallel option only if it's in
the config file or in COVERAGE_OPTIONS env var , isn't it ?

Thnx !
I'll let you know about progress I make .



Blog ES: http://simelo-es.blogspot.com/
Blog EN: http://simelo-en.blogspot.com/

Featured article:

More information about the testing-in-python mailing list