Gradle Integration Test Plugin provides an easy set up for integration tests
plugins {
id("com.scalified.plugins.gradle.it") version "$VERSION"
}After applying the plugin, the following takes place:
- JavaPlugin applied if not yet applied
- IdeaPlugin applied if not yet applied
- New directories are created (if missing):
- Source set directory for integration tests (
src/it/javaby default) - Resources directory for integration tests (
src/it/resourcesby default)
- Source set directory for integration tests (
- Gradle configurations added:
itImplementation- configuration for integration test compile scope (containsimplementationclasspath)itRuntimeOnly- configuration for integration test runtime scope (containstestRuntimeOnlyclasspath)it*- other configurations inherited fromTest(e.g.itAnnotationProcessor)
- Gradle
ittask created, which runs integration tests located within the integration test source set - Integration test sources directory marked as test sources in IntelliJ IDEA
tasks.it {
srcDir = "src/it/kotlin"
resourcesDir = "src/it/resources"
useJUnitPlatform()
maxParallelForks = 4
finalizedBy(tasks.cleanDb) // assuming there is some cleanDb task
}Made with ❤️ by Scalified