gradle / test-retry-gradle-plugin

Gradle plugin to retry tests that have failed to mitigate test flakiness.
Apache License 2.0
222 stars 50 forks source link

Cannot use this plugin in tandem with Kotlin Multiplatform Tests #116

Open eriwen opened 2 years ago

eriwen commented 2 years ago

We got a report from one of our users that was having trouble running the test retry plugin with a kotlin project. After some digging, we found that org.jetbrains.kotlin.multiplatform.gradle.plugin creates their own test executer for KotlinJvmTest per https://github.com/JetBrains/kotlin/blob/master/libraries/tools/kotlin-gradle-plug[…]/org/jetbrains/kotlin/gradle/targets/jvm/tasks/KotlinJvmTest.kt When this happens, this part of the test retry plugin is reached: https://github.com/gradle/test-retry-gradle-plugin/blob/v1.3.1/plugin/src/main/java/org/gradle/testretry/internal/config/TestTaskConfigurer.java#L142 so tests fail with the following:

> Configure project :
Kotlin Multiplatform Projects are an Alpha feature. See: https://kotlinlang.org/docs/reference/evolution/components-stability.html. To hide this message, add 'kotlin.mpp.stability.nowarn=true' to the Gradle properties.

> Task :jvmTest FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':jvmTest'.
> Unexpected test executer: org.jetbrains.kotlin.gradle.targets.jvm.tasks.KotlinJvmTest$Executor@1073de17

Bug reproducer project

abelkov commented 2 years ago

Mirror issue on Kotlin side: https://youtrack.jetbrains.com/issue/KT-49155