SeaLights Python agent has been integrated into the Cloud Foundry Python Buildpack since its version v1.8.13.
Sealights use the AfterCompile
hook in the Python build pack to install an agent and all required dependencies in the target container. So once the application is pushed to the cloud foundry service the following steps occur:
Sealights hook verifies that the application is bound with the sealights service
Install the agent from the Pypi repository
Modify target application start command
Setup
Create Service Configuration
To manage application integrations with third-party services Cloud Foundry has the mechanism of the User-Provided Services. So the first step is to create such a service with the configuration. Here is the command “create-user-provided-service“ that does that:
cf cups sealights -p '{"token":"ey…"}'
It is also possible to provide a token file
cf cups sealights -p '{"tokenfile":"/path/to/sltoken.txt"}'
In the Windows commands line, you have to escape "
character so the command will look like this:
cf cups sealights -p '{\"token\":\"ey…\"}'
You will be able to change the parameters later with the command “update-user-provided-service”
See below the complete list of the available parameters.
Push an application
You can push an application as usual with the command “push”
cf push
Note: you can use a manifest.yml file to simplify an application deployment
Bind Application with the service
Now you can bind your published application with the service
cf bind-service [app name] sealights
Restage Application
To apply changes you have to publish your application again, or simply restage it with a command restage. Once the Sealights service is bound, the coverage listener will be triggered attached to your application
cf restage [app name]
Sealights' specific CF environment variables
Env vars provide sealights test listener args as the following
Prameter name | Description |
---|---|
| Allow to determine customer lab id - unique ID for a set of test labs in case multiple labs are running simultaneously |
| Sealights build session id |
| File that contains Sealights session id. |
| Address of proxy to run connection through. |