[Build] Fix usage of --scan parameter with test retry

Gradle fails to configure test retry when `--scan` parameter is present
It happens due to some race in plugin application
and creation of a test extension

^KTI-1339
This commit is contained in:
Bogdan Mukvich
2023-08-11 17:47:39 +02:00
committed by Space Team
parent e89334e5ba
commit ecd06ac47b
@@ -13,11 +13,13 @@ fun Project.configureTestRetriesForTestTasks() {
?.toString()?.toInt()
?: (if (kotlinBuildProperties.isTeamcityBuild) 3 else 0)
tasks.withType<Test>().configureEach {
retry {
maxRetries.set(testRetryMaxRetries)
maxFailures.set(20)
failOnPassedAfterRetry.set(false)
pluginManager.withPlugin("gradle-enterprise") {
tasks.withType<Test>().configureEach {
retry {
maxRetries.set(testRetryMaxRetries)
maxFailures.set(20)
failOnPassedAfterRetry.set(false)
}
}
}
}