Table of Contents | ||
---|---|---|
|
...
Create a JSON configuration file with the following parameters in order to provide the necessary configuration fields to the SeaLights Gradle plugin:
token or tokenFile - set with a token or a file containing the token obtained from the SeaLights dashboard
If you create a Build Session ID externally, provide the following fields:
buildSessionId or buildSessionIdFile - Set with a build session id or a file containing the build session id created by the config step
createBuildSessionId - Set to false
If you want to create a Build Session ID using the SeaLights Gradle plugin, provide the following fields:
createBuildSessionId - Set to true
appName - Name of the application as you want to see it on the SeaLights dashboard
branchName - Name of the branch as you want to see it on the SeaLights dashboard
buildName - Name of the build as you want to see it on the SeaLights dashboard
packagesIncluded - Comma-separated list of packages to include in the scan operation. Note: This is defining a subset, so it must include the astrix star to include all sub-packages/classes
executionType - Provide which executions need to be handled by the Gradle plugin
full - Execute both the build scanner and the test listener
testsonly - Execute only the test listener
scanonly - Execute only the build scanner
filesincluded - (Optional) Set to the binary files to scan. Default: *.class
filesexcluded - (Optional) Set to the binary files to excluded from the scan. Default: *test-classes*
workspacepath - Set to the path to the binary files to scan. Default: project.buildDir
- recursive - (Optional) Set to true to scan all the subdirectories of workspacepath. Default: true
includeResources - (Optional) Set to include the token and build session ID files in the built resources
testTasksAndStages - (Optional) Mapping of test tasks’s tasks’ names to test stage names as they will be displayed on the SeaLights dashboard. It should be of the format {"testTask1":"testStage1", "testTask2":"testStage2"}
labId - (Optional) Unique ID for a set of test labs in case multiple labs are running simultaneously
filesStorage - Set to the temp folder for the agent to create temporary files in. For example /tmp
logEnabled - Set to true if you want a log to be created
logLevel - Set the log level to create. For example WARN or INFO
proxy - (Optional) Address of proxy to run connection through
sealightsJvmParams - Entry to provide JVM params to the SeaLights agent. It should be of the format {"key1":"val1", "key2":"val2"}
gradleProjectConfig - (Optional) JSON elment with definitions of following Gradle project’s integration properties:
includedProjects - (Optional) array of names of (sub)projects to include in integration.
Projects from outside this array will not be built with SeaLights integration. E.g. ["subProject1", "subProject3"]. Default: all projects included.excludedProjects - (Optional) array of names of (sub)projects to exclude in integration.
Projects from this array will not be built with SeaLights integration. E.g. ["subProject1", "subProject3"]. Default: []repoConfig - (Optional) The configuration of repositories from which the SeaLights Gradle plugin will be taken. This will be put as is in a Gradle script's buildScript { repositories { /* repoConfig */ } } block.
For multi-line configuration, use the \n character in JSON string. Default: mavenCentral()
The values provided for fields can contain interpolated Groovy code, just like for the field appName
in the above example: "${System.getenv('JOB_NAME')}"
.
It will get resolved during the Gradle build.
Note |
---|
|
Info |
---|
Info |
For additional parameters values and information, see 'Java Command Reference - Installing test listener as Java Agent' for more parameter values and information |
Code Block | ||
---|---|---|
| ||
{ "tokenFile": "sltoken.txt", "createBuildSessionId": true, "appName": "${System.getenv('JOB_NAME')}", "branchName": "master", "buildName": "${System.getenv('BUILD_NUMBER')}", "packagesIncluded": "*com.example.*", "packagesExcluded": "", "filesIncluded": "*.class", "filesExcluded": "*test-classes*", "recursive": true, "includeResources": true, "testTasksAndStages": {"test":"Unit Tests", "junitPlatformTest":"Unit Tests", "integrationTest":"Integration Tests"}, "labId": null, "executionType": "full", "logEnabled": false, "logDestination": "console", "logLevel": "off", "logFolder": "/tmp", "gradleProjectConfig": { "excludedProjects": ["subProject1", "subProject2"], "repoConfig": "mavenLocal()" } } |
The values provided for fields can contain interpolated Groovy code, just like for the field appName
in the above example: "${System.getenv('JOB_NAME')}"
.
It will get resolved during the Gradle build.
Note |
---|
|
Integrating into the Build.gradle script
...