[tahoe-lafs-trac-stream] [Tahoe-LAFS] #2297: improve precision of coverage reports by including coverage by subprocesses
Tahoe-LAFS
trac at tahoe-lafs.org
Wed Sep 10 08:35:02 UTC 2014
#2297: improve precision of coverage reports by including coverage by subprocesses
------------------------+---------------------------------
Reporter: daira | Owner:
Type: defect | Status: new
Priority: normal | Milestone: undecided
Component: code | Version: 1.10.0
Resolution: | Keywords: coverage subprocess
Launchpad Bug: |
------------------------+---------------------------------
Description changed by daira:
Old description:
> Currently, coverage reports underestimate covered code in some places
> (this particularly affects the code for running nodes) because only
> Python code directly executed by `coverage run` is measured.
>
> `coverage` has a feature to measure the code running in multiple
> processes and then combine the measurements:
>
> http://nedbatchelder.com/code/coverage/subprocess.html
> http://nedbatchelder.com/code/coverage/cmd.html#cmd-combining
>
> To make this work, we need to:
>
> * Run this early on when starting Tahoe processes (e.g. in
> [source:src/allmydata/__init__.py]):
> {{{
> try:
> from coverage import process_startup
> process_startup()
> except ImportError:
> pass
> }}}
>
> * Set the `COVERAGE_PROCESS_START` environment variable (which will be
> inherited by subprocesses) when running `coverage` from [source:setup.py]
> and the [source:Makefile].
>
> * Pass the `-p` option to the `coverage` command line.
>
> * Ensure that the `.coverage.*` files are being generated in the same
> directory.
>
> * After `coverage run`, execute `coverage combine`.
New description:
Currently, coverage reports underestimate covered code in some places
(this particularly affects the code for starting nodes) because only
Python code directly executed by `coverage run` is measured.
`coverage` has a feature to measure the code running in multiple processes
and then combine the measurements:
http://nedbatchelder.com/code/coverage/subprocess.html
http://nedbatchelder.com/code/coverage/cmd.html#cmd-combining
To make this work, we need to:
* Run this early on when starting Tahoe processes (e.g. in
[source:src/allmydata/__init__.py]):
{{{
try:
from coverage import process_startup
process_startup()
except ImportError:
pass
}}}
* Set the `COVERAGE_PROCESS_START` environment variable (which will be
inherited by subprocesses) when running `coverage` from [source:setup.py]
and the [source:Makefile].
* Pass the `-p` option to the `coverage` command line.
* Ensure that the `.coverage.*` files are being generated in the same
directory.
* After `coverage run`, execute `coverage combine`.
--
--
Ticket URL: <https://tahoe-lafs.org/trac/tahoe-lafs/ticket/2297#comment:1>
Tahoe-LAFS <https://Tahoe-LAFS.org>
secure decentralized storage
More information about the tahoe-lafs-trac-stream
mailing list