Skip to content

Commit 5ebf9dd

Browse files
authored
Replace usages RandomizedTestingTask with built-in Gradle Test (#40978) (#40995)
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. (cherry picked from commit 323f312)
1 parent e3e90ad commit 5ebf9dd

File tree

98 files changed

+732
-1530
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

+732
-1530
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: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -199,11 +199,11 @@ if (project != rootProject) {
199199
into localDownloads
200200
}
201201

202-
unitTest {
202+
test {
203203
// The test task is configured to runtimeJava version, but build-tools doesn't support all of them, so test
204204
// with compiler instead on the ones that are too old.
205205
if (project.runtimeJavaVersion <= JavaVersion.VERSION_1_10) {
206-
jvm = "${project.compilerJavaHome}/bin/java"
206+
executable = "${project.compilerJavaHome}/bin/java"
207207
}
208208
}
209209

@@ -215,8 +215,6 @@ if (project != rootProject) {
215215
}
216216
dependsOn setupLocalDownloads
217217
exclude "**/*Tests.class"
218-
testClassesDirs = sourceSets.test.output.classesDirs
219-
classpath = sourceSets.test.runtimeClasspath
220218
inputs.dir(file("src/testKit"))
221219
// tell BuildExamplePluginsIT where to find the example plugins
222220
systemProperty (
@@ -232,6 +230,7 @@ if (project != rootProject) {
232230
if (isLuceneSnapshot) {
233231
systemProperty 'test.lucene-snapshot-revision', isLuceneSnapshot[0][1]
234232
}
233+
maxParallelForks System.getProperty('tests.jvms', project.rootProject.ext.defaultParallel.toString()) as Integer
235234
}
236235
check.dependsOn(integTest)
237236

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)