The QALIPSIS Gradle Plugin simplifies the creation of new QALIPSIS projects and integration into CI pipelines.
The bootstrap plugin simplifies the creation of a new QALIPSIS project.
The cloud plugin allows for the upload, management and execution of scenarios into the QALIPSIS cloud environment.
plugins {
id("io.qalipsis.bootstrap") version "0.1.6"
}plugins {
id 'io.qalipsis.bootstrap' version '0.1.6'
}The plugin includes a default QALIPSIS version, but you can specify a different one:
qalipsis {
version("0.18.e")
}qalipsis {
version = '0.18.e'
}Add to gradle.properties or Gradle execution options:
qalipsis.version=0.18.eBy default, the bootstrap plugin creates a QALIPSIS project with all dependencies for running as head, factory or standalone. You can then select at runtime which deployment mode you want to use.
However, if you want to create a QALIPSIS project with only the dependencies for running as a head (respectively as a factory), you can call the statement
qalipsis { asHead() } (respectively qalipsis { asFactory() }) in your build.gradle.kts or build.gradle file.
By doing so, you will have a QALIPSIS project with only the dependencies for running as head (respectively factory) and do not have to select the deployment mode at runtime.
qalipsis {
asHead() // or asFactory()
}qalipsis {
asHead() // or asFactory()
}To integrate QALIPSIS plugins, configure them in build.gradle.kts or build.gradle:
qalipsis {
plugins {
apacheKafka()
jackson("1.2.3") // You can override the version of the plugin.
}
}qalipsis {
plugins {
apacheKafka()
jackson("1.2.3") // You can override the version of the plugin.
}
}Available plugins:
apacheCassandraapacheKafkaelasticsearchgraphitehttpinfluxDbjacksonjmsjakartaMessagingmailmongoDbnettyr2dbcJasyncrabbitMqredisLettuceslacksqltimescaleDb
plugins {
id("io.qalipsis.cloud") version "0.1.6"
}plugins {
id 'io.qalipsis.cloud' version '0.1.6'
}To ensure proper configuration of the QALIPSIS cloud plugin, the following environment variables should be defined:
# Root url to use to access to the factory builder defaults to the value below.
qalipsis.cloud.registry.url=https://app.qalipsis.io/api/scenarios"
# Flag to specify if scenarios should be listed or not.
qalipsis.cloud.registry.list=true
# The token generated from the QALIPSIS GUI or from the api.
qalipsis.cloud.registry.token=api-token
# Root url to run campaigns.
qalipsis.cloud.api.url=https://app.qalipsis.io/apiThe qalipsisRunAllScenarios task runs all scenarios in your project's classpath.
All the tasks that extend RunQalipsis will save the text and HTML reports in the build/report folder and the JUnit results in the build/test-results folder. But you can easily disable or overwrite this
by configuration, as shown below.
tasks {
named("qalipsisRunAllScenarios") {
configuration(
"report.export.html.enabled" to "true",
"report.export.html.folder" to project.layout.buildDirectory.dir("test-results/my-new-scenario").get().asFile.path
)
}
}tasks.named('qalipsisRunAllScenarios') {
configuration 'report.export.html.enabled': 'true',
'report.export.html.folder': layout.buildDirectory.dir('test-results/my-new-scenario').get().asFile.path
}Create custom tasks of type RunQalipsis to run specific scenarios with custom configurations:
tasks {
create("executeRestApiSpikeTest", RunQalipsis::class.java) {
scenarios("spike-test-of-rest-api", "constant-monitoring")
configuration(
"report.export.html.enabled" to "true",
"report.export.html.folder" to project.layout.buildDirectory.dir("test-results/my-new-scenario").get().asFile.path
)
}
}tasks.create('executeRestApiSpikeTest', RunQalipsis) {
scenarios 'spike-test-of-rest-api', 'constant-monitoring'
configuration 'report.export.html.enabled': 'true',
'report.export.html.folder': layout.buildDirectory.dir('test-results/my-new-scenario').get().asFile.path
}The tasks created from the template qalipsisRunCampaign creates and executes a new campaign in the cloud.
tasks {
create("qalipsisRunCampaign", CloudRunQalipsis::class.java) {
campaign("Test campaign") {
speedFactor.set(2.0)
startOffsetMs.set(2000)
campaignTimeout.set("PT1H30M")
hardTimeout.set(false)
// Configure your scenario(s) as needed.
scenario("My scenario 1") {
minionsCount = 710
zones {
"US" to 45
"DE" to 55
}
// Any implementation of the profile configuration(more, regular, stages, immediate,
// percentage, accelerate, timeframe) can be configured in the profile block.
profile {
stages(completionMode = CompletionMode.HARD) {
stage(
minionsCount = 10,
rampUpDurationMs = 10,
totalDurationMs = 100000,
resolutionMs = 10000
)
stage(
minionsCount = 200,
rampUpDurationMs = 100,
totalDurationMs = 10000,
resolutionMs = 1000
)
stage(
minionsCount = 500,
rampUpDurationMs = 2000,
totalDurationMs = 1000,
resolutionMs = 4000
)
}
}
}
}
}
}tasks.create('qalipsisRunCampaign', CloudRunQalipsis) {
campaign("Test campaign") {
speedFactor = 2.0
startOffsetMs = 2000
campaignTimeout = "PT1H30M"
hardTimeout = false
// Configure your scenario(s) as needed.
scenario("My scenario 1") {
minionsCount = 710
zones {
US 45
DE 55
}
// Any implementation of the profile configuration(more, regular, stages, immediate,
// percentage, accelerate, timeframe) can be configured in the profile block.
profile {
stages(completionMode = CompletionMode.HARD) {
stage(
minionsCount = 10,
rampUpDurationMs = 10,
totalDurationMs = 100000,
resolutionMs = 10000
)
stage(
minionsCount = 200,
rampUpDurationMs = 100,
totalDurationMs = 10000,
resolutionMs = 1000
)
stage(
minionsCount = 500,
rampUpDurationMs = 2000,
totalDurationMs = 1000,
resolutionMs = 4000
)
}
}
}
}
}Find more information at docs.qalipsis.io.