Before running the build scan and tests, you need to create a session ID. The session ID is provided to each step in order link them together as one complete cycle
Info |
---|
See 'Generating a an Agent token' for instructions on how to generate a token |
Generating a session ID in Node.js
Generating a session ID in Node.js is done using the SeaLights Node.js Agent with the config flag
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
./node_modules/.bin/npx slnodejs config --tokenfile "/path/to/tokenFile"./sltoken.txt --appname "myApp" --branch "master" --build "23""1" |
Each time this command successfully connects to your SeaLights instance, data structures will be created to store the build map, test monitoring data, and, generally, data pertaining to this build of your application.
Each time you call this command, the appname / branch / buildname trio needs to be unique. Typically, the buildname
changes each time, as you will scan your build once following each build of your application.
You can provide a timestamp for the buildname
parameter. For example: --build `date +"%y%m%d_%H%M"`
(Linux) or --build (Get-Date $date -Format "yyyMMdd_HHmm")
(Windows Powershell)
The most common cause of the "Module already exists" error message indicates that the config command was likely called without changing the buildname
.
Info |
---|
See 'Node.js Command Reference - Creating a session ID' for full parameter details |
Using the session ID
The session ID will be printed to the console output and a file called 'buildSessionId
.txt' will be generated containing it. The file can be used as is in the agent parameters or can be used to fill in an environment parameter to be in a command line.
Unix/Linux | Windows (CMD) | ||
---|---|---|---|
|
...
|
...
|
...
|
|
...
|
...
Related articles
Filter by label (Content by label) | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
...
hidden | true |
---|
...