QALIPSIS Gradle plugin

The QALIPSIS Gradle plugin simplifies the creation of new QALIPSIS projects and the integration of QALIPSIS projects into CI pipelines.

Setup

The Gradle plugin is built into the bootstrap project. If you choose not use the bootstrap project skeleton, you can still setup your project to take advantage of the Gradle plugin.

You can check the latest version of the QALIPSIS Gradle plugin from the Gradle Plugin Portal.

Gradle Plugin Portal Version

With Bootstrap

Kotlin
plugins {
    id("io.qalipsis.bootstrap") version "..."
}
Groovy
plugins {
    id 'io.qalipsis.bootstrap' version '...'
}

Version Configuration

The Gradle plugin includes a default QALIPSIS version; you can specify a different version in the appropriate build file.

Kotlin

In build.gradle.kts, to specify version 0.16.a:

qalipsis {
    version("0.16.a")
}
Groovy

In build.gradle, to specify version 0.16.a:

qalipsis {
    version = '0.16.a'
}
As a Gradle property

To specify version 0.16.a, add the version in the gradle.properties or Gradle execution options:

qalipsis.version=0.16.a

Creating a QALIPSIS head/factory-only project

By 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.

In build.gradle.kts (Kotlin)

qalipsis {
    asHead() // or asFactory()
}

In build.gradle (Groovy)

qalipsis {
    asHead() // or asFactory()
}

Adding QALIPSIS plugins

To integrate QALIPSIS plugins, configure them in build.gradle.kts or build.gradle:

Kotlin
qalipsis {
    plugins {
        apacheKafka()
        jackson("1.2.3") // You can override the version of the plugin.
    }
}
Groovy
qalipsis {
    plugins {
        apacheKafka()
        jackson("1.2.3") // You can override the version of the plugin.
    }
}

Gradle is available for the following QALIPSIS plugins:

  • apacheCassandra

  • apacheKafka

  • elasticsearch

  • graphite

  • influxDb

  • jackson

  • jms

  • jakartaMessaging

  • mail

  • mongoDb

  • netty

  • r2dbcJasync

  • rabbitMq

  • redisLettuce

  • slack

  • timescaleDb

Executing QALIPSIS

Default Execution

The QALIPSIS RunAllScenarios task runs all scenarios in your project’s classpath.

Kotlin
tasks {
    named("qalipsisRunAllScenarios") {
        configuration(
            "report.export.junit.enabled" to "true",
            "report.export.junit.folder" to project.layout.buildDirectory.dir("test-results/my-new-scenario").get().asFile.path
        )
    }
}
Groovy
tasks.named('qalipsisRunAllScenarios') {
    configuration 'report.export.junit.enabled': 'true',
                  'report.export.junit.folder': layout.buildDirectory.dir('test-results/my-new-scenario').get().asFile.path
}

Custom Execution

You can create custom tasks of type RunQalipsis to run specific scenarios with custom configurations.

Kotlin
tasks {
    create("executeRestApiSpikeTest", RunQalipsis::class.java) {
        scenarios("spike-test-of-rest-api", "constant-monitoring")
        configuration("report.export.junit.enabled" to "true",
            "report.export.junit.folder" to project.layout.buildDirectory.dir("test-results/my-new-scenario").get().asFile.path
        )
    }
}
Groovy
tasks.create('executeRestApiSpikeTest', RunQalipsis) {
    scenarios 'spike-test-of-rest-api', 'constant-monitoring'
    configuration 'report.export.junit.enabled': 'true',
                  'report.export.junit.folder': layout.buildDirectory.dir('test-results/my-new-scenario').get().asFile.path
}