Versions Compared

Key

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

...

  1. logEnabled - Set to true if you want a log to be created

  2. logLevel - Set the log level to create. For example WARN or INFO

  3. logToFile - Set to true if you want the log to written to a file

  4. logToConsole - Set to true if you want the log to written to the console

  5. filesStorage - location of temporary folder location to store cached agent files

  6. proxy - Provide the URL to the proxy to route the calls through if needed

  7. testListenerJvmParams - Containing and array of all the parameters you want to pass to all the SeaLights test execution step, Note: the key and values must always be strings

  8. testTasks testTasksAndStages - The list A map of tasks and their test stage names to integrate SeaLights into the jvmargs in. Default are test, unitPlatformTest & integrationTesttestStage - Provide the name of the test stage you want to report on in the SeaLights dashboard. Default stage name is 'Unit Tests'.with test stage "Unit Tests" and integrationTest with test stage "Integration Tests"

In the following example, the steps needed are surrounded by an if condition which allows you to only use Sealights when you pass the -Psealights property when executing your gradle command.

Without this condition and property, Sealights integration will always be applied and used.

...

Code Block
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')

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

When using gradle on Windows, you will need to double the backslash used in path file for parameters like tokenFile, buildSessionIdFile and fileStorage - i.e. tokenFile = "C:\\Sealights\\sltoken.txt"

JUnit 5

When using JUnit 5 you need to notify the SeaLights agent that this is the case. You do so by passing sl.junitVersion=5 to the sealightsJvmParams

...

"

...