Command Reference
Configure a session and create a session ID
npx slnodejs config {--token <token> | --tokenfile <file>} --appname <appname> --branch <branch> --build <build> [--buildsessionid <buildsessionid>] [--proxy <proxy>] [--failbuild {true|false}]
token
Access token generated from the Sealights server
tokenfile
Path to file containing access token generated from the SeaLights server
appname
Name of the application
branch
The source branch of the application
build
The build label of the current build
buildsessionid
(Optional) A user provided session ID
proxy
Address of proxy to run connection through
failbuild
Exit with an error code if an error is encountered (Default: false
)
Scanning a build
npx slnodejs scan {--token <token> | --tokenfile <file>} {--buildsessionid <id> | --buildsessionidfile <file>} --workspacepath <workspacepath> --scm {git|none} [--projectRoot <folder>] [--excludedpaths <excludedpaths>] [--uniqueModuleId <id>] [--es-modules] [--jobName <jobName>] [--logsUrl <logsUrl>] [--dependenciesFile <dependenciesFile>] [--instrumentForBrowsers --outputpath <folder> [--downloadAgent {true|false}] [--instrumentationOnly] [--labid <labid>] [--excludeSourceMapFiles {none|skipCopy|skipAndDelete}]] [--proxy <proxy>] [--failbuild {true|false}] [--scmBaseUrl <url> --scmProvider {github|gitlab|bitbucket} --scmVersion <arg>] [--es6Modules] [--babylonPlugins decorators-legacy|jsx] [--collectorUrl <url>] [--splitPreambleIntoFile --preambleFileUrl <url> --preambleFileName <fileName>] [--embedCorrectUniqueId]
token
Access token generated from the SeaLights server
tokenfile
Path to file containing access token generated from the SeaLights server
buildsessionid
Session ID of configuration created
buildsessionidfile
Path to file containing the Session ID of configuration created
workspacepath
Path to the source workspace
excludedpaths
Comma-separated list of files to exclude from scan
Supports wildcards (* = any string, ? = any character). For example: '*-with-dependencies.jar , bad-bad?.war, *-source.jar'
projectRoot
Path to the root of the project. Usually where the src folder resides
uniqueModuleId
Unique name when providing more than one build scan per build
es6Modules
Indicates that you use es6 modules
jobName
Name of Jenkins job
logsUrl
Path to Jenkins log folder
scm
Source control used. Current options are: git
, none
dependenciesFile
A path to a JSON file that is in the following format:
[{"appName":"","branch":"","build":""}, {...}]
instrumentForBrowsers
Instrument the JS files for providing browser front-end coverage information. Must be used with the outputpath
parameter.
downloadAgent
Set this value to 'false
' in order to prevent the instrumented javascript to try and download the browser test listener (for example, when using 'Karma').
instrumentationOnly
Only instrument the javascript files, without sending the build information to the SeaLights server (i.e. skip the build scan).
This parameter must be used in addition to the instrumentForBrowsers
parameter.
outputpath
Folder to generate the instrumented JS files in when using the instrumentForBrowsers
parameter
labid
Unique ID for a set of test labs in case multiple labs are running simultaneously or for an integration build.
This needs to be done during the instrumentation process when using the instrumentForBrowsers
option
proxy
Address of proxy to run connection through
failbuild
Exit with an error code if an error is encountered (Default: false
)
scmProvider
The provider name of your Source Control Management (SCM) tool.
Values: Github, Bitbucket and Gitlab (Default is Github
)
scmBaseUrl
The URL to the repository which contains the code. If not provided, the URL of the remote GIT origin will be used
Example: https://my.bitbucket.com/projects/ABCD/repos/XYZ/browse/A1
scmVersion
The version of your Source Control Management (SCM) tool. If not provided, Cloud version is assumed
babylonPlugins
Values:
decorators-legacy
- When there are decorators in the code, you should use this flag with the "decorators-legacy" valuejsx
- For React applications
collectorUrl
The URL for the Collector service. Format: “https://<collectorIP>:<collectorPort>/api”
excludeSourceMapFiles
(Optional) During files instrumentation step, this option explicits what to do with *.js.map
files in the workspacepath
and outputpath
folders:
none
- Do nothing and copy*.js.map
files as is to theoutputpath
folderskipCopy
- Do not copy the*.js.map
files fromworkspacepath
intooutputpath
folderskipAndDelete
- Skip copy of*.js.map
files and delete them from theworspacepath
splitPreambleIntoFile
Split the preamble used for browser application into a separate file.
Important: customer is responsible to make this file non-cacheable and accessible from the browser
Usage is --splitPreambleIntoFile
to use (not --splitPreambleIntoFile true
)
preambleFileUrl
Used together with preambleFileName
to define a custom url (default: "" which equals to root, you can pass like https://example.com/a/b/c or relative like a/b/c).
Important: Only use this if you need a different server than the one used for the instrumented files
Important: actual url will be {preambleFileUrl}/{preambleFileName}
preambleFileName
Used together with splitPreambleIntoFile
to define a custom name
enableOpenTelemetry
Used to enable context propagation on the Node application. Used with the slnodejs scan
command.
See also:
Ending a multi-module build
npx slnodejs buildend {--token <token> | --tokenfile <file>} {--buildsessionid <id> | --buildsessionidfile <file>} [--proxy <proxy>] [--failbuild {true|false}] [--skipUpgrade {true|false}] --ok | --failed
token
Access token generated from the SeaLights server
tokenfile
Path to file containing access token generated from the SeaLights server
buildsessionid
Session ID of configuration created
buildsessionidfile
Path to file containing the Session ID of configuration created
proxy
Address of proxy to run connection through
failbuild
Exit with an error code if an error is encountered (Default: false
)
skipUpgrade
Should not try to upgrade agent (Default: false
)
ok
build finished successfully
failed
build not finished successfully
Instrumenting a front-end build
npx slnodejs instrument {--token <token> | --tokenfile <file>} {--buildsessionid <id> | --buildsessionidfile <file>} --workspacepath <workspacepath> [--projectRoot <folder>] [--excludedpaths <excludedpaths>] --outputpath <folder> [--downloadAgent {true|false}] [--labid <labid>] [--excludeSourceMapFiles {none|skipCopy|skipAndDelete}]] [--proxy <proxy>] [--failbuild {true|false}] [--collectorUrl <url>] [--splitPreambleIntoFile --preambleFileUrl <url> --preambleFileName <fileName>] [--embedCorrectUniqueId]
token
Access token generated from the SeaLights server
tokenfile
Path to file containing access token generated from the SeaLights server
buildsessionid
Session ID of configuration created
buildsessionidfile
Path to file containing the Session ID of configuration created
workspacepath
Path to the source workspace
excludedpaths
Comma-separated list of files to exclude from scan
Supports wildcards (* = any string, ? = any character). For example: '*-with-dependencies.jar , bad-bad?.war, *-source.jar'
downloadAgent
Set this value to 'false
' in order to prevent the instrumented javascript to try and download the browser test listener (for example, when using 'Karma').
instrumentationOnly
Only instrument the javascript files, without sending the build information to the SeaLights server (i.e. skip the build scan).
This parameter must be used in addition to the instrumentForBrowsers
parameter.
outputpath
Folder to generate the instrumented JS files in when using the instrumentForBrowsers
parameter
labid
Unique ID for a set of test labs in case multiple labs are running simultaneously or for an integration build.
This needs to be done during the instrumentation process when using the instrumentForBrowsers
option
proxy
Address of proxy to run connection through
failbuild
Exit with an error code if an error is encountered (Default: false
)
collectorUrl
The URL for the Collector service. Format: “https://<collectorIP>:<collectorPort>/api”
excludeSourceMapFiles
(Optional) During files instrumentation step, this option explicits what to do with *.js.map
files in the workspacepath
and outputpath
folders:
none
- Do nothing and copy*.js.map
files as is to theoutputpath
folderskipCopy
- Do not copy the*.js.map
files fromworkspacepath
intooutputpath
folderskipAndDelete
- Skip copy of*.js.map
files and delete them from theworspacepath
splitPreambleIntoFile
Split the preamble used for browser application into a separate file.
Important: customer is responsible to make this file non-cacheable and accessible from the browser
Usage is --splitPreambleIntoFile
to use (not --splitPreambleIntoFile true
)
preambleFileUrl
Used together with preambleFileName
to define a custom url (default: "" which equals to root, you can pass like https://example.com/a/b/c or relative like a/b/c).
Important: Only use this if you need a different server than the one used for the instrumented files
Important: actual url will be {preambleFileUrl}/{preambleFileName}
preambleFileName
Used together with splitPreambleIntoFile
to define a custom name
enableOpenTelemetry
Used to enable context propagation on the Node application. Used with the slnodejs scan
command.
See also:
Running a backend server
npx slnodejs run {--token <token> | --tokenfile <file>} {--buildsessionid <id> | --buildsessionidfile <file>} [--workspacepath <path>] [--useinitialcolor {true|false}] [--teststage <teststage>] [--labid <labid>] [--proxy <proxy>] [--failbuild {true|false}] args...
token
Access token generated from the SeaLights server
tokenfile
Path to file containing access token generated from the SeaLights server
buildsessionid
Session ID of configuration created
buildsessionidfile
Path to file containing the Session ID of configuration created
workspacepath
Path to the source workspace
useinitialcolor
When reporting tests manually this should be set to false (Default: false)
teststage
Name of the test stage
labid
Unique ID for a set of test labs in case multiple labs are running simultaneously
proxy
Address of proxy to run connection through
failbuild
Exit with an error code if an error is encountered (Default: false)
args...
Extra arguments for running mocha framework tests
Updating/Deleting a component from an Integration build
npx slnodejs {componentUpdate | componentDelete} {-token <arg> | -tokenfile <arg>} {-buildsessionid <arg> | -buildsessionidfile <arg>} [--proxy <proxy>] {-componentIds <arg> | -componentFile <file>}
token
Access token generated from the SeaLights server
tokenfile
Path to file containing access token generated from the SeaLights server
buildsessionid
Session ID of configuration created
buildsessionidfile
Path to file containing the Session ID of configuration created
componentIds
One or several build session ID's (comma separated) of the component(s) to be updated or deleted
componentFile
A path to a JSON file that is in the following format:
[{"appName":"","branch":"","build":""}, {...}]
or
[{"buildSessionId":"", {...}]
proxy
Address of proxy to run connection through
Test Listener
Starting a test stage
npx slnodejs start {--token <token> | --tokenfile <file>} {--buildsessionid <id> | --buildsessionidfile <file>} --teststage <teststage> [--labid <labid>] [--proxy <proxy>] [--failbuild {true|false}]
token
Access token generated from the SeaLights server
tokenfile
Path to file containing access token generated from the SeaLights server
buildsessionid
Session ID of configuration created
buildsessionidfile
Path to file containing the Session ID of configuration created
teststage
Name of the test stage
labid
Unique ID for a set of test labs in case multiple labs are running simultaneously
proxy
Address of proxy to run connection through
failbuild
Exit with an error code if an error is encountered (Default: false)
Upload report files
Report files must be JUnit style XML reports
npx slnodejs uploadReports {--token <token> | --tokenfile <file>} {--buildsessionid <id> | --buildsessionidfile <file>} {--reportFile <reportFile> | --reportFilesFolder <reportFilesFolder>} [--labid <labid>] [--source <source>] [--type <type>] [--proxy <proxy>] [--failbuild {true|false}]
token
Access token generated from the SeaLights server
tokenfile
Path to file containing access token generated from the SeaLights server
buildsessionid
Session ID of configuration created
buildsessionidfile
Path to file containing the Session ID of configuration created
reportFile
Path to report file (multiple entries can be provided)
reportFilesFolder
Path to folder containing report files (multiple entries can be provided)
Note: all files in the folder will be uploaded
labid
Unique ID for a set of test labs in case multiple labs are running simultaneously
source
The reports provider. Default: Junit xml report
type
Values:
JUnitReport
- For uploading JUnit test report filescommitLog
- For uploading git style commit logs
type
Name of testing framework type
proxy
Address of proxy to run connection through
failbuild
Exit with an error code if an error is encountered (Default: false
)
Optional override parameters:
appname
Name of the application
branch
The source branch of the application
build
The build label of the current build
Upload Coverage files
The coverage file must be in JSON format, created by the Istanbuljs/nyc framework
npx slnodejs nycReport {--token <token> | --tokenfile <file>} {--buildsessionid <id> | --buildsessionidfile <file>} {--report <reportFile> | --projectRoot <project root dir>} [--labid <labid>] [--proxy <proxy>]
token
Access token generated from the SeaLights server
tokenfile
Path to file containing access token generated from the SeaLights server
buildsessionid
Session ID of configuration created
buildsessionidfile
Path to file containing the Session ID of configuration created
report
Path to coverage-final.json
projectRoot
Path to the root of the project. Usually where the src folder resides
labid
Unique ID for a set of test labs in case multiple labs are running simultaneously
proxy
Address of proxy to run connection through
Ending a test stage
npx slnodejs end {--token <token> | --tokenfile <file>} {--buildsessionid <id> | --buildsessionidfile <file>} [--labid <labid>] [--proxy <proxy>] [--failbuild {true|false}]
token
Access token generated from the SeaLights server
tokenfile
Path to file containing access token generated from the SeaLights server
buildsessionid
Session ID of configuration created
buildsessionidfile
Path to file containing the Session ID of configuration created
labid
Unique ID for a set of test labs in case multiple labs are running simultaneously
proxy
Address of proxy to run connection through
failbuild
Exit with an error code if an error is encountered (Default: false)
Running Tests using Mocha
npx slnodejs mocha {--token <token> | --tokenfile <file>} {--buildsessionid <id> | --buildsessionidfile <file>} --teststage <teststage> [--labid <labid>] [--proxy <proxy>] [--failbuild {true|false}] -- args...
token
Access token generated from the SeaLights server
tokenfile
Path to file containing access token generated from the SeaLights server
buildsessionid
Session ID of configuration created
buildsessionidfile
Path to file containing the Session ID of configuration created
teststage
Name of the test stage
labid
Unique ID for a set of test labs in case multiple labs are running simultaneously
proxy
Address of proxy to run connection through
failbuild
Exit with an error code if an error is encountered (Default: false)
tiaDisabled
Set to true
to ignore Tests Recommendations and execute all the tests. (Default: false)
reportSuites
Set to true
to map Sealights Tests to Mocha Suites instead of the Mocha tests within them. This flag should be passed as a --reporterOptions
(Default: false
).
-- args...
Extra arguments for running mocha framework tests Note: the double dash delimits between the SeaLights agent options and parameters passed to mocha
Running Tests using jasmine-node
npx slnodejs jasmine {--token <token> | --tokenfile <file>} {--buildsessionid <id> | --buildsessionidfile <file>} --teststage <teststage> [--labid <labid>] [--proxy <proxy>] [--failbuild {true|false}] args...
token
Access token generated from the SeaLights server
tokenfile
Path to file containing access token generated from the SeaLights server
buildsessionid
Session ID of configuration created
buildsessionidfile
Path to file containing the Session ID of configuration created
teststage
Name of the test stage
labid
Unique ID for a set of test labs in case multiple labs are running simultaneously
proxy
Address of proxy to run connection through
failbuild
Exit with an error code if an error is encountered (Default: false)
args...
Extra arguments for running mocha framework tests
Logging
To enable logs, you can set the NODE_DEBUG
environment variable to a value defining the output per the table below:
export NODE_DEBUG=sl
$env:NODE_DEBUG="sl"
sl
Display log output to the console
sl-file
Export the log information to a log file named 'sl.node.log
'
Furthermore, you can set the logging level using the SL_LOG_LEVEL
environment variable with one of the following options: info
(default) or debug
.
export NODE_DEBUG=sl
export SL_LOG_LEVEL=debug
To write the log to a specific directory, use SL_LOG_OUTPUT_FILE
and ensure that the directory has a write permissions.
export NODE_DEBUG=sl-file
export SL_LOG_LEVEL=debug
export SL_LOG_OUTPUT_FILE=/var/log/my-custom.log
To disable logs, unset the NODE_DEBUG
variable.
export NODE_DEBUG=
Last updated
Was this helpful?