...
...
...
...
Table of Contents |
---|
...
Configure a session and create session ID
...
Info |
---|
Passing Parameters as Environment Variables All of the below For example,
|
Generating a session ID
Standard Session ID
Code Block |
---|
sl-python config {--token <token> | --tokenfile <file>} --appname <appname> --branchbranchname <branch> --buildbuildname <build> --workspacepath <path> [--include <include>] [--exclude <exclude>] [--buildsessionid <buildsessionid>] [--proxy <proxy>] [--failbuild {true|false}] help] |
...
Parameter | Description |
---|---|
| Access token generated from the Sealights server |
| Path to file containing access token generated from the SeaLights server |
| Name of the application |
| The source branch of the application |
| The build label of the current build |
| Path to the workspace where the source code exists |
| Include only files whose paths match one of these patterns. |
| Omit files whose paths match one of these patterns. |
| Optional: A user provided session ID (case-sensitive) |
| Address of proxy to run connection through |
failbuild
Scanning a build
...
| Show Help message and exit. |
Pull Request Session ID
Code Block |
---|
sl-python buildprConfig {--token <token> | --tokenfile <file>} {--buildsessionidappname <id> |<appname> --buildsessionidfiletargetbranch <file>}<branch> --workspacepath <workspacepath> latestcommit <commit_sha> --scm {git|none} [pullrequestnumber <number> --projectRootrepourl <folder>]<url> [--excludedpathsworkspacepath <excludedpaths>]<path> [--uniqueModuleIdinclude <id><include>] [--es-modulesexclude <exclude>] [--jobNamebuildsessionid <jobName><buildsessionid>] [--logsUrlproxy <logsUrl><proxy>] [--dependenciesFile <dependenciesFile>] [--instrumentForBrowsers --outputpath <folder> [--downloadAgent {true|false}] [--instrumentationOnly] [--labid <labid>]] [--proxy <proxy>] [--failbuild {true|false}]help] |
Parameter | Description |
---|---|
| Access token generated from the Sealights server |
| Path to file containing access token generated from the SeaLights server |
| Name of the application |
| The branch to which this PR will be merged into (already reported to SeaLights) |
| The full SHA of the last commit made to the Pull Request |
| he number assigned to the Pull Request from the source control |
| The pull request URL for the PR to be scanned, up until the section before the pullRequestNumber value |
| Path to the workspace where the source code exists |
| Include only files whose paths match one of these patterns. |
| Omit files whose paths match one of these patterns. |
| Optional: A user provided session ID (case-sensitive) |
| Address of proxy to run connection through |
| Show Help message and exit. |
Scanning a build
Code Block |
---|
sl-python scan {--token <token> | --tokenfile <file>} {--buildsessionid <id> | --buildsessionidfile <file>} --scm {git|none} [--scmBaseUrl <url> --scmProvider {github|gitlab|bitbucket} [--scmVersion <version>] [--babylonPlugins decorators-legacy] proxy <proxy>] [--help] |
...
Parameter | Description |
---|---|
| Access token generated from the SeaLights server |
| Path to file containing access token generated from the SeaLights server |
|
Session ID of configuration created | |
| 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
uniqueModuleId
jobName
logsUrl
|
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
downloadAgent
instrumentationOnly
outputpath
labid
This needs to be done during the instrumentation process when using the instrumentForBrowsers option
proxy
failbuild
| The provider name of your Source Control Management (SCM) tool. |
| The URL to the repository which contains the code. If not provided, the url of the remote GIT origin will be used Example: |
| The version of your Source Control Management (SCM) tool. |
If |
left blank, cloud version is assumed |
Ending a multi module build
...
. Otherwise, specify the version of your on-premise server. | |
| Address of proxy to run connection through |
| Show Help message and exit. |
Running backend server
Code Block |
---|
sl-python buildendrun {--token <token> | --tokenfile <file>} {--buildsessionid <id> | --buildsessionidfile <file>} [--cov-proxyreport <proxy><path>] [--per-failbuildtest {true|false}] [--interval <interval>] [--skipUpgrade {true|false}labid <labid>] [--okproxy |<proxy>] [--failed help] args... |
Parameter | Description |
---|---|
| Access token generated from the SeaLights server |
| Path to file containing access token generated from the SeaLights server |
| Session ID of configuration created |
| Path to file containing the Session ID of configuration created |
| Path to generate XML coverage report |
| Collect coverage per test (Default: false) |
Should not try to upgrade agent (Default: false)
build finished successfully
build not finished successfully
Updating/Deleting a component from an Integration build
Code Block | ||||
---|---|---|---|---|
| ||||
sl-python {componentUpdate | componentDelete} {-token <arg> | -tokenfile <arg>} {-buildsessionid <arg> | -buildsessionidfile <arg>} [--proxy <proxy>] {-componentIds <arg> | -componentFile <file>}
|
[{"appName":"","branch":"","build":""}, {...}]
or
[{"buildSessionId":"", {...}]
| Interval in milliseconds to send data |
| Unique ID for a set of test labs in case multiple labs are running simultaneously (case-sensitive) |
| Address of proxy to run connection through |
| Show Help message and exit. |
| Extra arguments for running the application server |
Test Listener
Starting a test stage
Code Block | |
---|---|
firstline | 1 | title | Usage
sl-python start {--token <token> | --tokenfile <file>} {--buildsessionid <id> | --buildsessionidfile <file>} --teststage <teststage> [--labid <labid>] [--proxy <proxy>] [--failbuild {true|false}] help] |
Parameter | Description |
---|---|
| Access token generated from the SeaLights server |
| Path to file containing access token generated from the SeaLights server |
|
Session ID of configuration created | |
| Path to file containing the Session ID of configuration created |
| Name of the test stage |
| Unique ID for a set of test labs in case multiple labs are running simultaneously |
| Address of proxy to run connection through |
failbuild
Upload report files
Report files must be junit JUnit style xml XML reports
Code Block | |
---|---|
firstline | 1 | title | Usage
sl-python uploadReports {--token <token> | --tokenfile <file>} {--buildsessionid <id> | --buildsessionidfile <file>} {--reportFilereportfile <reportFile> | --reportFilesFolderreportfilesfolder <reportFilesFolder>} [--hasmorerequests {False|True}] [--labid <labid>] [--source <source>] [--type <type>] [--proxy <proxy>] [--failbuild {true|false}] help] |
Parameter | Description |
---|---|
| Access token generated from the SeaLights server |
| Path to file containing access token generated from the SeaLights server |
|
Session ID of configuration created | |
| Path to file containing the Session ID of configuration created |
| Path to report file |
. This argument can be declared multiple times in order to upload multiple files. | |
| Path to folder |
that contains nothing but report files. All files in folder will be uploaded. Note: all files in the folder will be uploaded | |
| Set to ‘True’ if test results contains multiple reports (Default: ‘False’). |
| Unique ID for a set of test labs in case multiple labs are running simultaneously (case-sensitive) |
| The reports provider |
. If not set, the default will be 'Junit xml report'. |
|
Name of testing framework type. The report type. If not set, the default will be 'JunitReport'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
...
Coverage file must be in JSON format, created by the Istanbul framework
Code Block | ||||
---|---|---|---|---|
| ||||
sl-python nycReport {--token <token> | --tokenfile <file>} {--buildsessionid <id> | --buildsessionidfile <file>} {--report <reportFile> | --projectRoot <project root dir>} [--labid <labid>] [--proxy <proxy>]
|
token
tokenfile
buildsessionid
buildsessionidfile
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
| Address of proxy to run connection through |
failbuild
Optional override parameters:
...
appname
...
branch
...
build
...
| Show Help message and exit. |
Ending a test stage
Code Block | |
---|---|
firstline | 1 | title | Usage
sl-python end {--token <token> | --tokenfile <file>} {--buildsessionid <id> | --buildsessionidfile <file>} [--labid <labid>] [--proxy <proxy>] [--failbuild {true|false}]
|
Parameter | Description |
---|---|
| Access token generated from the SeaLights server |
| Path to file containing access token generated from the SeaLights server |
|
Session ID of configuration created | |
| Path to file containing the Session ID of configuration created |
| Unique ID for a set of test labs in case multiple labs are running simultaneously |
| Address of proxy to run connection through |
failbuild
...
Code Block | ||||
---|---|---|---|---|
| ||||
sl-python mocha {--token <token> | --tokenfile <file>} {--buildsessionid <id> | --buildsessionidfile <file>} --teststage <teststage> [--labid <labid>] [--proxy <proxy>] [--failbuild {true|false}] -- args... |
...
token
...
tokenfile
...
buildsessionid
...
buildsessionidfile
...
teststage
...
Name of the test stage
...
labid
...
Unique ID for a set of test labs in case multiple labs are running simultaneously
...
proxy
...
failbuild
...
Extra arguments for running mocha framework tests
Note the double dash delimits between the sealights options and parameters passed to mocha
...
Code Block | ||||
---|---|---|---|---|
| ||||
sl-python jasmine {--token <token> | --tokenfile <file>} {--buildsessionid <id> | --buildsessionidfile <file>} --teststage <teststage> [--labid <labid>] [--proxy <proxy>] [--failbuild {true|false}] args...
|
...
token
...
tokenfile
...
buildsessionid
...
buildsessionidfile
...
teststage
...
Name of the test stage
...
labid
...
Unique ID for a set of test labs in case multiple labs are running simultaneously
...
proxy
...
failbuild
...
Code Block | ||||
---|---|---|---|---|
| ||||
sl-python 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
...
tokenfile
...
buildsessionid
...
buildsessionidfile
...
workspacepath
...
Path to the source workspace
...
useinitialcolor
...
teststage
...
Name of the test stage
...
labid
...
Unique ID for a set of test labs in case multiple labs are running simultaneously
...
proxy
...
failbuild
...
Logging
In order to enable logs you can set the NODE_DEBUG environment variable to one of the following:
...
sl
...
sl-file
...
Furthermore, you can set the level of logging by using the SL_LOG_LEVEL environment variable with one of the following options error, warn, info or debug
...
language | bash |
---|---|
title | Sample |
...
| Show Help message and exit. |
Running Tests via pytest, unittest, unit2 or nose
These commands will be documented soon, please refer to their --help option via the command below
Code Block |
---|
sl-python {pytest|unittest|unit2|nose} --help |
Logging
Enabling logging in Python is done using by setting the SL_DEBUG environment variable to “true”.
Messages will be written to stdout
and the file, sealights-python-agent.log
Code Block | ||
---|---|---|
| ||
export SL_DEBUG=true |