Skip to content

Commit 323f312

Browse files
authored
Replace usages RandomizedTestingTask with built-in Gradle Test (#40978)
This commit replaces the existing RandomizedTestingTask and supporting code with Gradle's built-in JUnit support via the Test task type. Additionally, the previous workaround to disable all tasks named "test" and create new unit testing tasks named "unitTest" has been removed such that the "test" task now runs unit tests as per the normal Gradle Java plugin conventions.
1 parent f2873fe commit 323f312

File tree

98 files changed

+743
-1546
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

98 files changed

+743
-1546
lines changed

benchmarks/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ mainClassName = 'org.openjdk.jmh.Main'
2424
assemble.enabled = false
2525
archivesBaseName = 'elasticsearch-benchmarks'
2626

27-
unitTest.enabled = false
27+
test.enabled = false
2828

2929
dependencies {
3030
compile("org.elasticsearch:elasticsearch:${version}") {

buildSrc/build.gradle

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -198,17 +198,14 @@ if (project != rootProject) {
198198
from configurations.distribution
199199
into localDownloads
200200
}
201-
202-
// This can't be an RandomizedTestingTask because we can't yet reference it
201+
203202
task integTest(type: Test) {
204203
// integration test requires the local testing repo for example plugin builds
205204
dependsOn project.rootProject.allprojects.collect {
206205
it.tasks.matching { it.name == 'publishNebulaPublicationToLocalTestRepository'}
207206
}
208207
dependsOn setupLocalDownloads
209208
exclude "**/*Tests.class"
210-
testClassesDirs = sourceSets.test.output.classesDirs
211-
classpath = sourceSets.test.runtimeClasspath
212209
inputs.dir(file("src/testKit"))
213210
// tell BuildExamplePluginsIT where to find the example plugins
214211
systemProperty (
@@ -224,11 +221,7 @@ if (project != rootProject) {
224221
if (isLuceneSnapshot) {
225222
systemProperty 'test.lucene-snapshot-revision', isLuceneSnapshot[0][1]
226223
}
227-
String defaultParallel = System.getProperty('tests.jvms', project.rootProject.ext.defaultParallel)
228-
if (defaultParallel == "auto") {
229-
defaultParallel = Math.max(Runtime.getRuntime().availableProcessors(), 4)
230-
}
231-
maxParallelForks defaultParallel as Integer
224+
maxParallelForks System.getProperty('tests.jvms', project.rootProject.ext.defaultParallel.toString()) as Integer
232225
}
233226
check.dependsOn(integTest)
234227

buildSrc/src/main/groovy/com/carrotsearch/gradle/junit4/BalancersConfiguration.groovy

Lines changed: 0 additions & 53 deletions
This file was deleted.

buildSrc/src/main/groovy/com/carrotsearch/gradle/junit4/ListenersConfiguration.groovy

Lines changed: 0 additions & 25 deletions
This file was deleted.

buildSrc/src/main/groovy/com/carrotsearch/gradle/junit4/RandomizedTestingPlugin.groovy

Lines changed: 0 additions & 60 deletions
This file was deleted.

0 commit comments

Comments
 (0)