Changes between Initial Version and Version 1 of Ticket #1698, comment 13


Ignore:
Timestamp:
2014-09-07T20:56:03Z (10 years ago)
Author:
daira
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #1698, comment 13

    initial v1  
    33Note that the argument to "`coverage run`" is a Python script, not an arbitrary executable. It will always be run in-process, i.e. in the same Python interpreter instance as `coverage`.
    44
    5 The reason why "`coverage run bin/tahoe debug trial`" does not work is that `bin/tahoe` runs the "`debug trial`" command in a subprocess, in order to pass the correct `PYTHONPATH`. (Running it directly wouldn't help, because `coverage` does not have the right `PYTHONPATH` and so neither does any script it runs.) So `src/allmydata/__init__.py` complains and exits, as it should.
     5The reason why "`coverage run bin/tahoe debug trial`" does not work is that `bin/tahoe` runs the "`debug trial`" command in a subprocess, in order to pass the correct `PYTHONPATH`. `coverage` isn't capable of capturing coverage information for subprocesses. (Running it directly wouldn't help, because `coverage` does not have the right `PYTHONPATH` and so neither does any script it runs.) So `src/allmydata/__init__.py` complains and exits, as it should.
    66
    77When `coverage` is run from `bin/tahoe` using `@`, it gets the correct `PYTHONPATH`, and so does the script that it runs. This was one of the main motivations for adding `@`. Importantly, `bin/tahoe` will expand `@tahoe` to the absolute path of the support script --not its own path-- before invoking `coverage`. If it expanded `@tahoe` to its own absolute path, then the tests would be running in a subprocess of `coverage` which wouldn't work for the same reason as above.