Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Table of Contents

...

Configure a session and create session ID

Code Block
languagebash
./node_modules/.bin/npx slnodejs config {--token <token> | --tokenfile <file>} --appname <appname> --branch <branch> --build <build> [--buildsessionid <buildsessionid>] [--proxy <proxy>] [--failbuild {true|false}]

...

Scanning a build

Code Block
languagebash
./node_modules/.bin/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>]

Parameter

Description

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" value

  • jsxFor 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 the outputpath folder

  • skipOnly - Do not copy the *.js.map files from workspacepath into outputpath folder

  • skipAndDelete - Skip copy of *.js.map files and delete them from the worspacepath

Ending a multi-module build 

Code Block
languagebash
./node_modules/.bin/npx slnodejs buildend {--token  <token> | --tokenfile <file>} {--buildsessionid <id> | --buildsessionidfile <file>} [--proxy <proxy>] [--failbuild {true|false}] [--skipUpgrade {true|false}] --ok | --failed

...

Updating/Deleting a component from an Integration build

Code Block
languagebash
./node_modules/.bin/npx slnodejs {componentUpdate | componentDelete} {-token  <arg> | -tokenfile <arg>} {-buildsessionid <arg> | -buildsessionidfile <arg>} [--proxy <proxy>] {-componentIds <arg> | -componentFile <file>}

Parameter

Description 

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

...

Starting a test stage

Code Block
languagebash
./node_modules/.bin/npx slnodejs start {--token  <token> | --tokenfile <file>} {--buildsessionid <id> | --buildsessionidfile <file>} --teststage <teststage> [--labid <labid>] [--proxy <proxy>] [--failbuild {true|false}]

...

Report files must be JUnit style XML reports

Code Block
languagebash
./node_modules/.bin/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}]

...

The coverage file must be in JSON format, created by the Istanbuljs/nyc framework

Code Block
languagebash
./node_modules/.bin/npx slnodejs nycReport {--token  <token> | --tokenfile <file>} {--buildsessionid <id> | --buildsessionidfile <file>} {--report <reportFile> | --projectRoot <project root dir>} [--labid <labid>] [--proxy <proxy>]

...

Ending a test stage

Code Block
./node_modules/.bin/npx slnodejs end {--token  <token> | --tokenfile <file>} {--buildsessionid <id> | --buildsessionidfile <file>} [--labid <labid>] [--proxy <proxy>] [--failbuild {true|false}]

...

Running Tests using Mocha

Code Block
languagebash
./node_modules/.bin/npx slnodejs mocha {--token  <token> | --tokenfile <file>} {--buildsessionid <id> | --buildsessionidfile <file>} --teststage <teststage> [--labid <labid>] [--proxy <proxy>] [--failbuild {true|false}] -- args...

...

Running Tests using jasmine-node

Code Block
./node_modules/.bin/npx slnodejs jasmine {--token  <token> | --tokenfile <file>} {--buildsessionid <id> | --buildsessionidfile <file>} --teststage <teststage> [--labid <labid>] [--proxy <proxy>] [--failbuild {true|false}] args...

...

Running backend server

Code Block
./node_modules/.bin/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...
Info

Example of command:

./node_modules/.bin/npx slnodejs run --tokenfile ./sltoken.txt --buildsessionidfile buildSessionId --labid "LAB_ID_2" --workspacepath "./server" --useinitialcolor true --useslnode2 -- "./server/app.js"

Note the /your/backend/server/command refers to "./server/app.js" in the above example.

...