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

Fix for case of inherited from Test tasks with own executers #163

Open zhurs opened 1 year ago

zhurs commented 1 year ago

Now plugin relies on task executer class, but this approach don't work with inherited tasks with own executers, for example with Kotlin Multiplatform Tests.

There are some issues for this problem: https://github.com/gradle/test-retry-gradle-plugin/issues/116 https://github.com/gradle/test-retry-gradle-plugin/issues/140

Possible solution is to store last result outside of the retry executer.

marcphilipp commented 1 year ago

@zhurs Could you please elaborate how this fixes the integration issue with KMPP? As far as I can tell, there would be multiple instances of the KMPP TestExecuter implementation created so the structure would be KotlinJvmTest$Executor(RetryTestExecutor(KotlinJvmTest$Executor(...))), wouldn't it?

zhurs commented 1 year ago

@marcphilipp You are absolutely right. But KMMP executer just add "[jvm]" suffix to the test names, after fix suffix will be added twice - it is not very good, but at least retry will work correctly. I don't see better way to fix issue ;-(

On the other hands fix itself is not bad - it just remove requirement of specific executer class, it will work with other Executer delegate-chains.

JavierSegoviaCordoba commented 1 year ago

Can this be revised?

dtretyakov commented 6 months ago

@marcphilipp do you have a better solution in mind to address the original problem with test runner in Kotlin MPP projects?

If so could you please share the plan when they will be properly supported.

pshevche commented 5 months ago

@marcphilipp do you have a better solution in mind to address the original problem with test runner in Kotlin MPP projects?

If so could you please share the plan when they will be properly supported.

We don't have a clear roadmap for it yet. This is a common request (also see https://github.com/gradle/test-retry-gradle-plugin/issues/116), so we'll take it into account when planning the next set of features for this plugin. Unfortunately, I don't have more to share at the moment.