Skip to content

Commit e7587cb

Browse files
Merge remote-tracking branch 'elastic/master' into eventually-consistent-mock-repo
2 parents 86e3d62 + fd5ef6b commit e7587cb

File tree

743 files changed

+12856
-130031
lines changed

Some content is hidden

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

743 files changed

+12856
-130031
lines changed

.ci/java-versions.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55
# are 'java' or 'openjdk' followed by the major release number.
66

77
ES_BUILD_JAVA=openjdk12
8-
ES_RUNTIME_JAVA=java8
8+
ES_RUNTIME_JAVA=java11
99
GRADLE_TASK=build
1010

.ci/matrix-runtime-javas.yml

-3
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,8 @@
66
# or 'openjdk' followed by the major release number.
77

88
ES_RUNTIME_JAVA:
9-
- java8
10-
- java8fips
119
- java11
1210
- java12
1311
- openjdk12
14-
- zulu8
1512
- zulu11
1613
- zulu12

CONTRIBUTING.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,10 @@ Contributing to the Elasticsearch codebase
9595
JDK 12 is required to build Elasticsearch. You must have a JDK 12 installation
9696
with the environment variable `JAVA_HOME` referencing the path to Java home for
9797
your JDK 12 installation. By default, tests use the same runtime as `JAVA_HOME`.
98-
However, since Elasticsearch supports JDK 8, the build supports compiling with
99-
JDK 12 and testing on a JDK 8 runtime; to do this, set `RUNTIME_JAVA_HOME`
100-
pointing to the Java home of a JDK 8 installation. Note that this mechanism can
101-
be used to test against other JDKs as well, this is not only limited to JDK 8.
98+
However, since Elasticsearch supports JDK 11, the build supports compiling with
99+
JDK 12 and testing on a JDK 11 runtime; to do this, set `RUNTIME_JAVA_HOME`
100+
pointing to the Java home of a JDK 11 installation. Note that this mechanism can
101+
be used to test against other JDKs as well, this is not only limited to JDK 11.
102102

103103
> Note: It is also required to have `JAVA8_HOME`, `JAVA9_HOME`, `JAVA10_HOME`
104104
and `JAVA11_HOME` available so that the tests can pass.

Vagrantfile

+5-1
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,10 @@ def linux_common(config,
246246
touch /is_vagrant_vm # for consistency between linux and windows
247247
SHELL
248248

249+
config.vm.provision 'jdk-11', type: 'shell', inline: <<-SHELL
250+
curl -sSL https://download.java.net/java/GA/jdk11/9/GPL/openjdk-11.0.2_linux-x64_bin.tar.gz | tar xz -C /opt/
251+
SHELL
252+
249253
# This prevents leftovers from previous tests using the
250254
# same VM from messing up the current test
251255
config.vm.provision 'clean es installs in tmp', run: 'always', type: 'shell', inline: <<-SHELL
@@ -342,7 +346,7 @@ def sh_install_deps(config,
342346
}
343347
cat \<\<JAVA > /etc/profile.d/java_home.sh
344348
if [ -z "\\\$JAVA_HOME" ]; then
345-
export JAVA_HOME=$(dirname $(dirname $(readlink -f $(which java))))
349+
export JAVA_HOME=/opt/jdk-11.0.2
346350
fi
347351
export SYSTEM_JAVA_HOME=\\\$JAVA_HOME
348352
unset JAVA_HOME

benchmarks/build.gradle

+1-1
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}") {

build.gradle

+1-32
Original file line numberDiff line numberDiff line change
@@ -338,14 +338,6 @@ gradle.projectsEvaluated {
338338
integTest.mustRunAfter test
339339
}
340340
configurations.all { Configuration configuration ->
341-
/*
342-
* The featureAwarePlugin configuration has a dependency on x-pack:plugin:core and x-pack:plugin:core has a dependency on the
343-
* featureAwarePlugin configuration. The below task ordering logic would force :x-pack:plugin:core:test
344-
* :x-pack:test:feature-aware:test to depend on each other circularly. We break that cycle here.
345-
*/
346-
if (configuration.name == "featureAwarePlugin") {
347-
return
348-
}
349341
dependencies.all { Dependency dep ->
350342
Project upstreamProject = dependencyToProject(dep)
351343
if (upstreamProject != null) {
@@ -357,7 +349,7 @@ gradle.projectsEvaluated {
357349
Task task = project.tasks.findByName(taskName)
358350
Task upstreamTask = upstreamProject.tasks.findByName(taskName)
359351
if (task != null && upstreamTask != null) {
360-
task.mustRunAfter(upstreamTask)
352+
task.shouldRunAfter(upstreamTask)
361353
}
362354
}
363355
}
@@ -382,21 +374,6 @@ allprojects {
382374
// also ignore other possible build dirs
383375
excludeDirs += file('build')
384376
excludeDirs += file('build-eclipse')
385-
386-
iml {
387-
// fix so that Gradle idea plugin properly generates support for resource folders
388-
// see also https://issues.gradle.org/browse/GRADLE-2975
389-
withXml {
390-
it.asNode().component.content.sourceFolder.findAll { it.@url == 'file://$MODULE_DIR$/src/main/resources' }.each {
391-
it.attributes().remove('isTestSource')
392-
it.attributes().put('type', 'java-resource')
393-
}
394-
it.asNode().component.content.sourceFolder.findAll { it.@url == 'file://$MODULE_DIR$/src/test/resources' }.each {
395-
it.attributes().remove('isTestSource')
396-
it.attributes().put('type', 'java-test-resource')
397-
}
398-
}
399-
}
400377
}
401378
}
402379

@@ -414,14 +391,6 @@ idea {
414391
vcs = 'Git'
415392
}
416393
}
417-
// Make sure gradle idea was run before running anything in intellij (including import).
418-
File ideaMarker = new File(projectDir, '.local-idea-is-configured')
419-
tasks.idea.doLast {
420-
ideaMarker.setText('', 'UTF-8')
421-
}
422-
if (System.getProperty('idea.active') != null && ideaMarker.exists() == false) {
423-
throw new GradleException('You must run `./gradlew idea` from the root of elasticsearch before importing into IntelliJ')
424-
}
425394

426395
// eclipse configuration
427396
allprojects {

buildSrc/build.gradle

+3-18
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ dependencies {
123123
compile 'com.perforce:p4java:2012.3.551082' // THIS IS SUPPOSED TO BE OPTIONAL IN THE FUTURE....
124124
compile 'org.apache.rat:apache-rat:0.11'
125125
compile "org.elasticsearch:jna:4.5.1"
126-
compile 'com.github.jengelman.gradle.plugins:shadow:2.0.4'
126+
compile 'com.github.jengelman.gradle.plugins:shadow:4.0.3'
127127
compile 'de.thetaphi:forbiddenapis:2.6'
128128
compile 'com.avast.gradle:gradle-docker-compose-plugin:0.8.12'
129129
testCompile "junit:junit:${props.getProperty('junit')}"
@@ -198,25 +198,14 @@ if (project != rootProject) {
198198
from configurations.distribution
199199
into localDownloads
200200
}
201-
202-
unitTest {
203-
// The test task is configured to runtimeJava version, but build-tools doesn't support all of them, so test
204-
// with compiler instead on the ones that are too old.
205-
if (project.runtimeJavaVersion <= JavaVersion.VERSION_1_10) {
206-
jvm = "${project.compilerJavaHome}/bin/java"
207-
}
208-
}
209-
210-
// This can't be an RandomizedTestingTask because we can't yet reference it
201+
211202
task integTest(type: Test) {
212203
// integration test requires the local testing repo for example plugin builds
213204
dependsOn project.rootProject.allprojects.collect {
214205
it.tasks.matching { it.name == 'publishNebulaPublicationToLocalTestRepository'}
215206
}
216207
dependsOn setupLocalDownloads
217208
exclude "**/*Tests.class"
218-
testClassesDirs = sourceSets.test.output.classesDirs
219-
classpath = sourceSets.test.runtimeClasspath
220209
inputs.dir(file("src/testKit"))
221210
// tell BuildExamplePluginsIT where to find the example plugins
222211
systemProperty (
@@ -232,11 +221,7 @@ if (project != rootProject) {
232221
if (isLuceneSnapshot) {
233222
systemProperty 'test.lucene-snapshot-revision', isLuceneSnapshot[0][1]
234223
}
235-
String defaultParallel = System.getProperty('tests.jvms', project.rootProject.ext.defaultParallel)
236-
if (defaultParallel == "auto") {
237-
defaultParallel = Math.max(Runtime.getRuntime().availableProcessors(), 4)
238-
}
239-
maxParallelForks defaultParallel as Integer
224+
maxParallelForks System.getProperty('tests.jvms', project.rootProject.ext.defaultParallel.toString()) as Integer
240225
}
241226
check.dependsOn(integTest)
242227

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

-53
This file was deleted.

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

-25
This file was deleted.

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

-60
This file was deleted.

0 commit comments

Comments
 (0)