<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    On 2/1/2012 7:07 PM, Dustin Lee wrote:
    <blockquote
cite="mid:CAN3sYc0NN9tB4Z0VfHzbjw9BuBoCYgm7wbc2fYt=CFhjVD2KSQ@mail.gmail.com"
      type="cite">I'm attempting to set up coverage to run for *any*
      python process that runs on a specific server.
      <div><br>
      </div>
      <div>currently I have the following in sitecustomize.py</div>
      <div><br>
      </div>
      <div>
        <div>import os</div>
        <div>
          os.environ['COVERAGE_PROCESS_START']='/home/dlee/.coveragerc'</div>
        <div>import sys</div>
        <div>sys.path.append('/home/dlee/downloads/python/coverage-3.5.1/')</div>
        <div>import coverage</div>
        <div>coverage.process_startup()</div>
        <div><br>
        </div>
        <div><br>
        </div>
        <div>The problem is that some of the processes run as root and
          some run as particular users. &nbsp;This was causing the non-root
          processes to fail due to the fact that they couldn't write to
          the .coverage file.</div>
        <div><br>
        </div>
        <div>Is there some way to automagically open up .coverage to be
          writable by anything? &nbsp;(Does coverage manage perms at all or
          should I just do this with umask maybe? &nbsp;(I don't want to mess
          with this and change how particular programs behave))</div>
        <div><br>
        </div>
      </div>
    </blockquote>
    Coverage.py does no manipulation of permissions for the data file.&nbsp;
    It tries to write it, and either can or can't.&nbsp; You'll have to use
    the OS tools to make sure it can.<br>
    <blockquote
cite="mid:CAN3sYc0NN9tB4Z0VfHzbjw9BuBoCYgm7wbc2fYt=CFhjVD2KSQ@mail.gmail.com"
      type="cite">
      <div>
        <div>Is there some easy way to have each process write to a
          different file so they don't stomp on each other? &nbsp;I see there
          is a&nbsp;&nbsp;--parallel-mode switch but is there a way to set this up
          automatically? &nbsp;My goal is to have ALL processes run
          coverage.py nolens volens.</div>
      </div>
    </blockquote>
    I would think parallel mode is exactly what you want.&nbsp; You can
    enable it in the .coveragerc file with:&nbsp; [run]\n parallel=True<br>
    <br>
    --Ned.<br>
    <blockquote
cite="mid:CAN3sYc0NN9tB4Z0VfHzbjw9BuBoCYgm7wbc2fYt=CFhjVD2KSQ@mail.gmail.com"
      type="cite">
      <div>
        <div><br>
        </div>
        <div>thanks,</div>
        <div><br>
        </div>
        <div>dustin</div>
        <div>&nbsp;</div>
        <div><br>
        </div>
        -- <br>
        Dustin Lee<br>
        qhfgva=rot13(dustin)<br>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
testing-in-python mailing list
<a class="moz-txt-link-abbreviated" href="mailto:testing-in-python@lists.idyll.org">testing-in-python@lists.idyll.org</a>
<a class="moz-txt-link-freetext" href="http://lists.idyll.org/listinfo/testing-in-python">http://lists.idyll.org/listinfo/testing-in-python</a>
</pre>
    </blockquote>
  </body>
</html>