Versions Compared

Key

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

...

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

Panel
panelIconId26a0
panelIcon:warning:
panelIconText⚠️
bgColor#DEEBFF

Unit Test Coverage in Lambda Workflows

Using --light-mode true during the scan step may result in inaccurate Unit Test coverage data, depending on your workflow. If you find this is the case, you should take the following steps:
1. Remove light-mode true from the slcli scan command
2. Set the environment variable SEALIGHTS_LIGHT_MODE: "true"

As noted, “light-mode” is a necessary parameter when deploying a Lambda function with SeaLights. Using this approach allows the unit test coverage data to be accurately resolved, while still deploying the Lambda layer with the correct configuration.

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