Skip to end of metadata
Go to start of metadata

You are viewing an old version of this content. View the current version.

Compare with Current View Version History

« Previous Version 11 Next »

In order to capture code coverage on your backend server, you need to run it using our Python test listener agent

The below commands assume the token and session id are located in the working directory. If not you can provide the location to them using the sl.tokenFile and sl.buildSessionIdFile environment variables

uWSGI

When working with uWSGI you need to run uWSGI with the following flags either in the command line or in the uwsgi configuration file: --enable-threads  --single-interpreter --lazy-apps --import python_agent.init

Sample Usage
uwsgi ... --enable-threads  --single-interpreter --import python_agent.init


Sample uWSGI config file
[uwsgi]
...
enable-threads = true
single-interpreter = true
import = python_agent.init

Gunicorn WSGI

When working with Gunicorn WSGI you need to run it with the following a configuration file which contains an import of the SeaLights Python agent in the post_fork section

Sample Gunicorn config file
...
def post_fork(server, worker):
    import python_agent.init
...

Other servers

For other servers, run with the SeaLights Python agent and the run flags

Sample Usage
sl-python run {--cov-report /path/to/report.xml --labid Lab1} <your server and args...>

The first parameter after the run command should be an executable file



  • No labels