Opened at 2014-09-10T08:34:42Z
Last modified at 2020-08-26T18:38:23Z
#2297 new defect
improve precision of coverage reports by including coverage by subprocesses — at Initial Version
Reported by: | daira | Owned by: | |
---|---|---|---|
Priority: | normal | Milestone: | undecided |
Component: | code | Version: | 1.10.0 |
Keywords: | coverage subprocess | Cc: | |
Launchpad Bug: |
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 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 setup.py and the 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.
Note: See
TracTickets for help on using
tickets.