I using the gradle kotlin DSL and I need to exclude my acceptance tests when running build or test. Currently I have
tasks.withType<Test> {
exclude("*acceptance*")
}
Which doesn't work. The acceptance test is executed, it is not excluded.
I also need to configure my build.gradle.kts to run my acceptance tests. At the moment I have an acceptance directory which is under is under src/test/groovy and I have created a acceptanceTest task as per the documentation here. The acceptance test is not run with this configuration.
sourceSets {
create("acceptance") {
compileClasspath += sourceSets.main.get().output
runtimeClasspath += sourceSets.main.get().output
}
}
val acceptanceImplementation by configurations.getting {
extendsFrom(configurations.implementation.get())
}
val acceptanceTest = task<Test>("acceptanceTest") {
description = "Runs Acceptance tests."
group = "verification"
testClassesDirs = sourceSets["test"].output.classesDirs
classpath = sourceSets["acceptance"].runtimeClasspath
shouldRunAfter("test")
}
tasks.check { dependsOn(acceptanceTest) }