Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Note

Please make sure the Sealights Test Listener is deployed to capture coverage of the application to be tested by this script.

For Java application, you can refer to Using Java Agents - Installing Test Listener as Java Agent

In order to use Sealights Gradle plugin, you’ll need to update your build.gradle file with relevant settings and enable its execution during the relevant Gradle projects.
For example, by adding the -Psealights property to your Gradle command.

...

  1. apply plugin: 'io.sealights.on-premise.agents.plugin.sealights-gradle-plugin'

  2. sealights section with the following parameters

    1. token or tokenFile - set with a token or a file containing the token obtained from the SeaLights Settings page

    2. buildSessionId or buildSessionIdFile - Set with a build session id or a file containing the build session id created externally via the config step unless you are using the labId to recieve the session ID

    3. labId - Set the lab ID of the environment being tested (if not provided, it will be set to the session ID)

    4. createBuildSessionId - Set to false

    5. runTestOnly - Set to true if you want to only run tests without scanning builds

...

Info

For additional parameters values and informaiton, please refer to Java Command Reference - Installing test listener as Java Agent

Code Block
languagegroovy
buildscript {
    repositories {
        mavenCentral()
        dependencies {
            if(project.hasProperty('sealights')){
	            classpath 'io.sealights.on-premise.agents.plugin:sealights-gradle-plugin:latest.release'
			}
		}
    }
}

allprojects { p ->
    if(project.hasProperty('sealights')){
        apply plugin: 'io.sealights.on-premise.agents.plugin.sealights-gradle-plugin'
        sealights {
            tokenFile = "./sltoken.txt" 
            createBuildSessionId = false
            buildSessionIdFile = "./buildSessionId.txt"
//          buildSessionId = System.getenv('SL_BUILD_SESSION_ID')
//          labId = "myLabId"

       	    filesStorage="/tmp"
            logEnabled = false
            logLevel = "WARN"
            logToFile = false
            logToConsole = true
            
            runTestOnly=true
            testTasksAndStages=["test":"Functional Tests"]
//          proxy = "http://localhost:8888"
//          testListenerJvmParams=["sl.param1":"true","sl.param2":"value"]
        }
    }
}

...