Heyho, similar to <Hantsy>, I am trying to have a ...
# community-support
b
Heyho, similar to Hantsy, I am trying to have a custom test task, to run just one single test. in/excluding by name, by tag did not work. Gradle still executed other tests as well. As Test suites seem to be the way to go, I tried these. Same result. Gradle keeps executing all other tests. No matter, what I try. This is my current state. You can see the level of my frustration from the different excludes:
Copy code
testing {
            suites {
                val test by getting(JvmTestSuite::class) {
                    targets {
                        all {
                            testTask.configure {
                                exclude("*KarateTest")
                            }
                        }
                    }
                }

                register<JvmTestSuite>("karateTests") {
                    testType = TestSuiteType.INTEGRATION_TEST

                    dependencies {
                        implementation(projects.libraries.test.karate)
                    }

                    sources {
                        kotlin {
                            setSrcDirs(listOf("src/karateTests/kotlin"))
                        }
                    }

                    targets {
                        all {
                            testTask.configure {
                                exclude("**", "*.*", "*", "*/*", "**/**", "*/**", "**/*")
                                include("*KarateTest")
                            }
                        }
                    }

                }
            }
        }
I try to execute the one test with the
karateTests
task
v
Test suite or not should not make much difference here. In the end you just have a task of type
Test
that you configure. But I'd like to ask you the same I asked Hantsy. Can you maybe knit an MCVE that demoes the problem?
b
I'll try
👌 1
Oh boy. While I was building the MCVE, I had an idea to change something in my project: We have a multi module project, and we were configuring the test task like so:
Copy code
tasks.withType<Test>().configureEach {
// (...)
}
I moved this configuration into the test suite conf and et voila. It works
👌 1
v
Then the MCVE already fulfilled its purpose 🙂