I have a cucumber test suite, which was working fine until gradle 7.6 version and Quarkus 3.5.3 version.
Once I upgrade to gradle 8.6 and Quarkus version 3.8.4 my cucumber tests are not recognized by gradle command.
If I switch to run the test suite with IntelliJ idea the tests get detected and works absolutely fine.
Below is my CucumberTest class.
@Suite
@IncludeEngines("cucumber")
@SelectClasspathResource("features")
@ConfigurationParameter(key = GLUE_PROPERTY_NAME, value = "engine.job.mock")
public class RunCucumberTest {
}
build.gradle.kts configs are as below
configurations.all {
resolutionStrategy.eachDependency {
if (requested.group == "org.junit.platform") {
useVersion("1.10.2")
because("quarkus brings in its own junit platform version that can override bom")
}
}
}
testImplementation(platform("io.cucumber:cucumber-bom:7.18.0"))
testImplementation("io.cucumber:cucumber-java")
testImplementation("io.cucumber:cucumber-junit-platform-engine")
testImplementation("org.junit.platform:junit-platform-suite")
testImplementation("org.junit.platform:junit-platform-suite-engine")
testImplementation("org.junit.jupiter:junit-jupiter")
tasks.withType<Test> {
// Work around. Gradle does not include enough information to disambiguate
// between different examples and scenarios.
useJUnitPlatform()
testLogging {
events("passed", "skipped", "failed")
}
}
The gradle command which I am running is as below.
gradle -p modules/abc :engine:test --tests "engine.job.mock.RunCucumberTest" -Dorg.gradle.jvmargs=-Xmx4096m --stacktrace
The error which I am getting on command run
Execution failed for task ':engine:test'.
> No tests found for given includes: [engine.job.mock.RunCucumberTest](--tests filter)
I went through all the blog posts on this issue and tried different suggested solution but nothing worked in this case.