Skip to content

Commit

Permalink
Replace usages RandomizedTestingTask with built-in Gradle Test (elast…
Browse files Browse the repository at this point in the history
…ic#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.
  • Loading branch information
mark-vieira authored Apr 8, 2019
1 parent f2873fe commit 323f312
Show file tree
Hide file tree
Showing 98 changed files with 743 additions and 1,546 deletions.
2 changes: 1 addition & 1 deletion benchmarks/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ mainClassName = 'org.openjdk.jmh.Main'
assemble.enabled = false
archivesBaseName = 'elasticsearch-benchmarks'

unitTest.enabled = false
test.enabled = false

dependencies {
compile("org.elasticsearch:elasticsearch:${version}") {
Expand Down
11 changes: 2 additions & 9 deletions buildSrc/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -198,17 +198,14 @@ if (project != rootProject) {
from configurations.distribution
into localDownloads
}

// This can't be an RandomizedTestingTask because we can't yet reference it

task integTest(type: Test) {
// integration test requires the local testing repo for example plugin builds
dependsOn project.rootProject.allprojects.collect {
it.tasks.matching { it.name == 'publishNebulaPublicationToLocalTestRepository'}
}
dependsOn setupLocalDownloads
exclude "**/*Tests.class"
testClassesDirs = sourceSets.test.output.classesDirs
classpath = sourceSets.test.runtimeClasspath
inputs.dir(file("src/testKit"))
// tell BuildExamplePluginsIT where to find the example plugins
systemProperty (
Expand All @@ -224,11 +221,7 @@ if (project != rootProject) {
if (isLuceneSnapshot) {
systemProperty 'test.lucene-snapshot-revision', isLuceneSnapshot[0][1]
}
String defaultParallel = System.getProperty('tests.jvms', project.rootProject.ext.defaultParallel)
if (defaultParallel == "auto") {
defaultParallel = Math.max(Runtime.getRuntime().availableProcessors(), 4)
}
maxParallelForks defaultParallel as Integer
maxParallelForks System.getProperty('tests.jvms', project.rootProject.ext.defaultParallel.toString()) as Integer
}
check.dependsOn(integTest)

Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 323f312

Please sign in to comment.