-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Respect Run Tests Using
setting
#178
Comments
I've added a reply to the other ticket. |
@sksamuel The static properties support doesn't help us because our gradle build sets up dynamic properties around test tasks (e.g. kubernetes endpoints for integration tests). IntelliJ is set to run tests via gradle and running a test class does a |
I guess in theory we could make the forked process propagate properties too. |
That would be really helpful. Right now we are using environment variables -- they are easier to manage when the apps are containerized and running in Kubernetes, for example. But we could switch to system properties or make our code use either.
Do we need special gradle support here? The plugin could run something like |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
@sksamuel From your suggestion I built a solution that generates a a kotest properties file and adds it to the test classpath. It's pretty unobvious though, and the default behaviour in the IDE is confusing: Running a test class is run as a normal gradle task with all the riders attached, and running a single test runs AFAICS the testClasses goal in gradle, and then the tests as a separate process. Additionally, we have multiple test configurations beside |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
The inability to set tasks.withType<Test>().configureEach {
// WORKAROUND: https://github.com/reactor/BlockHound/issues/33 required for JDK >=13
if (JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_13)) {
jvmArgs = listOf("-XX:+AllowRedefinitionToAddDeleteMethods")
}
} |
We would also be very interested in a fix for this. We currently have to resort to prepending |
@ulrikrasmussen Just a hint that does not solve the original problem, but may help in your use case: You could use test filtering in the build script instead of prepending "f:" to individual tests: tasks.withType<Test>().configureEach {
filter {
listOf<String>(
// "serialization.CommonSerializationTests*",
"serialization.JvmSerializationTests*",
).forEach {
includeTestsMatching("$it")
}
}
} Might be easier with groups of tests and/or running tests across multiple subprojects. |
I have Intellij configured to run tests with gradle (
Settings > Build, Execution, Deployment > Build Tools > Gradle > Run Tests Using
).It seems like this setting is not yet picked up by the kotest plugin. I've checked the Kotest run configurations, but it doesn't look like I can do anything with gradle there. Some of our tests can now not be run in the IDE because they rely on configuration in gradle.
The text was updated successfully, but these errors were encountered: