[TIP] coverage for any python process that run (regardless of user)

Dustin Lee qhfgva at gmail.com
Wed Feb 1 16:07:56 PST 2012


I'm attempting to set up coverage to run for *any* python process that runs
on a specific server.

currently I have the following in sitecustomize.py

import os
os.environ['COVERAGE_PROCESS_START']='/home/dlee/.coveragerc'
import sys
sys.path.append('/home/dlee/downloads/python/coverage-3.5.1/')
import coverage
coverage.process_startup()


The problem is that some of the processes run as root and some run as
particular users.  This was causing the non-root processes to fail due to
the fact that they couldn't write to the .coverage file.

Is there some way to automagically open up .coverage to be writable by
anything?  (Does coverage manage perms at all or should I just do this with
umask maybe?  (I don't want to mess with this and change how particular
programs behave))

Is there some easy way to have each process write to a different file so
they don't stomp on each other?  I see there is a  --parallel-mode switch
but is there a way to set this up automatically?  My goal is to have ALL
processes run coverage.py nolens volens.

thanks,

dustin


-- 
Dustin Lee
qhfgva=rot13(dustin)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.idyll.org/pipermail/testing-in-python/attachments/20120201/bc2e9e11/attachment.htm>


More information about the testing-in-python mailing list