From 782813510c4f2d79888e53f996e059910fe99517 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Champeau?= Date: Fri, 6 May 2022 16:04:10 +0200 Subject: [PATCH] Upgrade test distribution plugin (#333) This fixes a bug which prevented test selection to work properly with JUnit 5.7. We can now remove the constraint, which should avoid cache misses when a build is executed on CI and that test selection is enabled locally. --- build.gradle | 2 +- .../build/MicronautBuildCommonPlugin.groovy | 19 +------------------ 2 files changed, 2 insertions(+), 19 deletions(-) diff --git a/build.gradle b/build.gradle index bc19dcd1..f8774d02 100644 --- a/build.gradle +++ b/build.gradle @@ -75,7 +75,7 @@ dependencies { } implementation 'com.gradle:gradle-enterprise-gradle-plugin:3.10' - implementation 'com.gradle.enterprise:test-distribution-gradle-plugin:2.3' + implementation 'com.gradle.enterprise:test-distribution-gradle-plugin:2.3.1' implementation 'org.nosphere.gradle.github:gradle-github-actions-plugin:1.3.2' implementation 'com.gradle:common-custom-user-data-gradle-plugin:1.6.5' implementation 'org.gradle:test-retry-gradle-plugin:1.3.2' diff --git a/src/main/groovy/io/micronaut/build/MicronautBuildCommonPlugin.groovy b/src/main/groovy/io/micronaut/build/MicronautBuildCommonPlugin.groovy index e204f8e8..28fd4328 100644 --- a/src/main/groovy/io/micronaut/build/MicronautBuildCommonPlugin.groovy +++ b/src/main/groovy/io/micronaut/build/MicronautBuildCommonPlugin.groovy @@ -108,23 +108,6 @@ class MicronautBuildCommonPlugin implements Plugin { } } - def testSelectionEnabled = micronautBuildExtension.environment.isTestSelectionEnabled() - project.dependencies { - testImplementation(testSelectionEnabled.map { enabled -> - if (enabled) { - platform('org.junit:junit-bom') { - version { - require '[5.8,)' - prefer '5.8.2' - } - because "Predictive test selection requires JUnit 5.8+" - } - } else { - null - } - }) - } - project.tasks.withType(Test).configureEach { jvmArgs '-Duser.country=US' jvmArgs '-Duser.language=en' @@ -141,7 +124,7 @@ class MicronautBuildCommonPlugin implements Plugin { failOnPassedAfterRetry.set(false) } predictiveSelection { - enabled = testSelectionEnabled + enabled = micronautBuildExtension.environment.isTestSelectionEnabled() } }