#2297 new defect

improve precision of coverage reports by including coverage by subprocesses — at Version 1

Reported by: daira Owned by:
Priority: normal Milestone: undecided
Component: code Version: 1.10.0
Keywords: coverage subprocess Cc:
Launchpad Bug:

Description (last modified by daira)

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 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.

Change History (1)

comment:1 Changed at 2014-09-10T08:35:02Z by daira

  • Description modified (diff)
Note: See TracTickets for help on using tickets.