Skip to content

Commit

Permalink
build: Migrate to explicit non-deprecated Gradle test suite configura…
Browse files Browse the repository at this point in the history
…tion (#100428)
  • Loading branch information
DevDavido authored Oct 9, 2024
1 parent 1cbbafa commit 4d50d2d
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 13 deletions.
2 changes: 1 addition & 1 deletion README.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ To use the Gradle Test Plugin, add the following lines to your build script:
tasks {
withType<Test>().configureEach {
//Set supported Gradle version
systemProperty("intershop.gradle.versions", "8.4,8.5")
systemProperty("intershop.gradle.versions", "8.4,8.5,8.10.2")
//working dir for tests
systemProperty("intershop.test.base.dir", project.layout.buildDirectory.get().dir("test-working").asFile.absolutePath)
}
Expand Down
31 changes: 23 additions & 8 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import org.asciidoctor.gradle.jvm.AsciidoctorTask

plugins {
`java-library`
`jvm-test-suite`
// project plugins
groovy
// test coverage
Expand Down Expand Up @@ -59,18 +60,32 @@ if (project.version.toString().endsWith("-SNAPSHOT")) {
status = "snapshot'"
}

tasks {

withType<Test>().configureEach {
testLogging.showStandardStreams = true
testing {
suites {
val test by getting(JvmTestSuite::class) {
useSpock()

// Gradle versions for test
systemProperty("intershop.gradle.versions", "8.4,8.5,8.10.2")
systemProperty("intershop.test.base.dir", project.layout.buildDirectory.dir("test-working").get().asFile.absolutePath)
dependencies {
implementation(gradleTestKit())
}

useJUnitPlatform()
targets {
all {
testTask.configure {
// Gradle versions for test
systemProperty("intershop.gradle.versions", "8.4,8.5,8.10.2")
systemProperty("intershop.test.base.dir", project.layout.buildDirectory.dir("test-working").get().asFile.absolutePath)
options {
testLogging.showStandardStreams = true
}
}
}
}
}
}
}

tasks {
val asciidoctorSrc = project.layout.buildDirectory.dir("/tmp/asciidoctorSrc")

register<Copy>("copyAsciiDoc") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,7 @@
*/
package com.intershop.gradle.test

import com.intershop.gradle.test.util.TestDir
import groovy.util.logging.Slf4j
import org.apache.commons.io.FileUtils
import org.gradle.testkit.runner.GradleRunner
import spock.lang.Specification

/**
* This abstract spec implements a special
Expand Down

0 comments on commit 4d50d2d

Please sign in to comment.