Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

In order to collect coverage information SeaLights agents need to first scan the python script files for the build information.

Info

See 'Generating an Agent token' for instructions on how to generate a token

Scanning a build

Scanning a build in Python is done using the Python agent with the build flag.

...

languagebash

...

Report the structure of your build to SeaLights. Following this step, you will see the build structure in the SeaLights dashboard.
Statically instrument the code files, creating a version of the files for testing (the original code is not modified). The instrumentation inserts code to gather and send coverage (function signatures only, no runtime arguments) to SeaLights.

Scanning a standalone project

Code Block
./slcli scan  /
    --bsid buildSessionId.txt  
    --path-to-scanner ./<path-to-build-scanner-app> / 
    --workspacepath <path-to-app-dir> 
    --scm git 
    --scmBaseUrl <base-url> 
    --scmVersion "0" 
    --scmProvider github
    --disable-on-init true

Scanning a Lambda project

Code Block
languagebash
slcli scan  \
    --collector-url http://<your-collector-url>/api \ 
    --light-mode true \
    --bsid buildSessionId.txt \ 
    --path-to-scanner ./<path-to-build-scanner-app> \ 
    --workspacepath <path-to-app-dir> \
    --scm git \
    --scmBaseUrl <base-url> \ 
    --scmVersion "0" \
    --scmProvider github 
    --disable-on-init true

Ignoring Files during the build scan

To ignore certain files during the buildscan phase, create an .slignore file and place it at the root folder of the project. The agent will automatically look for this file during the execution of the command.

Below is a sample content of the file

Code Block
types # ignoring all the files and folders below types folder
types/results # ignoring all the files and folders below types/results folder
server/calc.go # ignoring only calc.go file under the server folder
**/result.go # ignoring all the result.go files under all the folders
cmd