Skip to content

Commit f999a77

Browse files
committed
Merge remote-tracking branch 'elastic/master' into cat-recovery-bytes
* elastic/master: (129 commits) Update ingest jdocs that a null return value will drop the current document. (elastic#40359) Remove -Xlint exclusions in the ingest-common module. (elastic#40505) Update docs for the DFR similarity (elastic#40579) Fix merging of search_as_you_type field mapper (elastic#40593) Support roles with application privileges against wildcard applications (elastic#40398) Remove obsolete security settings (elastic#40496) Remove Gradle deprecation warnings (elastic#40449) Run the build integ test in parallel (elastic#39788) Fix 3rd pary S3 tests (elastic#40588) lower bwc skip for search as you type (elastic#40599) Muting XContentParserTests#testSubParserArray Fixing typo in test error message (elastic#40611) Update max dims for vectors to 1024. (elastic#40597) Add start and stop time to cat recovery API (elastic#40378) [DOCS] Correct keystore commands for Email and Jira actions in Watcher (elastic#40417) [DOCS] Document common settings for snapshot repository plugins (elastic#40475) Remove with(out)-system-key tests (elastic#40547) Geo Point parse error fix (elastic#40447) Handle null retention leases in WaitForNoFollowersStep (elastic#40477) [DOCS] Adds anchors for ruby client (elastic#39867) ...
2 parents 782f093 + 963c9b8 commit f999a77

File tree

568 files changed

+19081
-6488
lines changed

Some content is hidden

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

568 files changed

+19081
-6488
lines changed

.ci/init.gradle

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
if (System.env.ELASTIC_ARTIFACTORY_USERNAME == null || System.env.ELASTIC_ARTIFACTORY_TOKEN == null) {
2+
throw new GradleException("Using init script without configuration")
3+
} else {
4+
logger.info("Using elastic artifactory repos")
5+
settingsEvaluated { settings ->
6+
settings.pluginManagement {
7+
repositories {
8+
maven {
9+
url "https://artifactory.elstc.co/artifactory/gradle-plugins"
10+
credentials {
11+
username System.env.ELASTIC_ARTIFACTORY_USERNAME
12+
password System.env.ELASTIC_ARTIFACTORY_TOKEN
13+
}
14+
}
15+
gradlePluginPortal()
16+
}
17+
}
18+
}
19+
projectsLoaded {
20+
allprojects {
21+
buildscript {
22+
repositories {
23+
maven {
24+
url "https://artifactory.elstc.co/artifactory/gradle-release/"
25+
credentials {
26+
username System.env.ELASTIC_ARTIFACTORY_USERNAME
27+
password System.env.ELASTIC_ARTIFACTORY_TOKEN
28+
}
29+
}
30+
}
31+
}
32+
repositories {
33+
maven {
34+
url "https://artifactory.elstc.co/artifactory/gradle-release/"
35+
credentials {
36+
username System.env.ELASTIC_ARTIFACTORY_USERNAME
37+
password System.env.ELASTIC_ARTIFACTORY_TOKEN
38+
}
39+
}
40+
}
41+
}
42+
}
43+
}

.ci/matrix-runtime-javas.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ ES_RUNTIME_JAVA:
99
- java8
1010
- java8fips
1111
- java11
12+
- java12
1213
- openjdk12
1314
- zulu8
1415
- zulu11
16+
- zulu12

.ci/packer_cache.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,5 @@ export JAVA_HOME="${HOME}"/.java/${ES_BUILD_JAVA}
2020
# We are caching BWC versions too, need these so we can build those
2121
export JAVA8_HOME="${HOME}"/.java/java8
2222
export JAVA11_HOME="${HOME}"/.java/java11
23-
export JAVA12_HOME="${HOME}"/.java/java12
23+
export JAVA12_HOME="${HOME}"/.java/openjdk12
2424
./gradlew --parallel clean --scan -Porg.elasticsearch.acceptScanTOS=true -s resolveAllDependencies

build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ plugins {
3232
id 'com.gradle.build-scan' version '2.0.2'
3333
id 'base'
3434
}
35-
if (properties.get("org.elasticsearch.acceptScanTOS", "false") == "true") {
35+
if (Boolean.valueOf(project.findProperty('org.elasticsearch.acceptScanTOS') ?: "false")) {
3636
buildScan {
3737
termsOfServiceUrl = 'https://gradle.com/terms-of-service'
3838
termsOfServiceAgree = 'yes'
@@ -162,8 +162,8 @@ task verifyVersions {
162162
* after the backport of the backcompat code is complete.
163163
*/
164164

165-
boolean bwc_tests_enabled = true
166-
final String bwc_tests_disabled_issue = "" /* place a PR link here when committing bwc changes */
165+
boolean bwc_tests_enabled = false
166+
final String bwc_tests_disabled_issue = "https://github.com/elastic/elasticsearch/pull/40319" /* place a PR link here when committing bwc changes */
167167
if (bwc_tests_enabled == false) {
168168
if (bwc_tests_disabled_issue.isEmpty()) {
169169
throw new GradleException("bwc_tests_disabled_issue must be set when bwc_tests_enabled == false")

buildSrc/build.gradle

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,11 @@ if (project != rootProject) {
232232
if (isLuceneSnapshot) {
233233
systemProperty 'test.lucene-snapshot-revision', isLuceneSnapshot[0][1]
234234
}
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
235240
}
236241
check.dependsOn(integTest)
237242

buildSrc/src/main/groovy/org/elasticsearch/gradle/plugin/PluginBuildPlugin.groovy

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ public class PluginBuildPlugin extends BuildPlugin {
4444
public void apply(Project project) {
4545
super.apply(project)
4646
configureDependencies(project)
47+
4748
// this afterEvaluate must happen before the afterEvaluate added by integTest creation,
4849
// so that the file name resolution for installing the plugin will be setup
4950
project.afterEvaluate {
@@ -69,7 +70,7 @@ public class PluginBuildPlugin extends BuildPlugin {
6970
if (isModule) {
7071
throw new RuntimeException("Testclusters does not support modules yet");
7172
} else {
72-
project.testClusters.integTestCluster.plugin(
73+
project.testClusters.integTest.plugin(
7374
project.file(project.tasks.bundlePlugin.archiveFile)
7475
)
7576
}

buildSrc/src/main/groovy/org/elasticsearch/gradle/test/ClusterFormationTasks.groovy

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -693,10 +693,10 @@ class ClusterFormationTasks {
693693
node.args.each { arg(value: it) }
694694
if (Os.isFamily(Os.FAMILY_WINDOWS)) {
695695
// Having no TMP on Windows defaults to C:\Windows and permission errors
696-
// Since we configure ant to run with a new environment above, we need to set this to a dir we have access to
697-
File tmpDir = new File(node.baseDir, "tmp")
698-
tmpDir.mkdirs()
699-
env(key: "TMP", value: tmpDir.absolutePath)
696+
// Since we configure ant to run with a new environment above, we need to explicitly pass this
697+
String tmp = System.getenv("TMP")
698+
assert tmp != null
699+
env(key: "TMP", value: tmp)
700700
}
701701
}
702702
}

buildSrc/src/main/groovy/org/elasticsearch/gradle/test/RestIntegTestTask.groovy

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,13 @@ public class RestIntegTestTask extends DefaultTask {
6262
clusterConfig = project.extensions.create("${name}Cluster", ClusterConfiguration.class, project)
6363
} else {
6464
project.testClusters {
65-
integTestCluster {
65+
"$name" {
6666
distribution = 'INTEG_TEST'
6767
version = project.version
6868
javaHome = project.file(project.ext.runtimeJavaHome)
6969
}
7070
}
71-
runner.useCluster project.testClusters.integTestCluster
71+
runner.useCluster project.testClusters."$name"
7272
}
7373

7474
// override/add more for rest tests
@@ -81,7 +81,7 @@ public class RestIntegTestTask extends DefaultTask {
8181
throw new IllegalArgumentException("tests.rest.cluster and tests.cluster must both be null or non-null")
8282
}
8383
if (usesTestclusters == true) {
84-
ElasticsearchNode node = project.testClusters.integTestCluster
84+
ElasticsearchNode node = project.testClusters."${name}"
8585
runner.systemProperty('tests.rest.cluster', {node.allHttpSocketURI.join(",") })
8686
runner.systemProperty('tests.config.dir', {node.getConfigDir()})
8787
runner.systemProperty('tests.cluster', {node.transportPortURI})
@@ -187,6 +187,10 @@ public class RestIntegTestTask extends DefaultTask {
187187
clusterInit.mustRunAfter(tasks)
188188
}
189189

190+
public void runner(Closure configure) {
191+
project.tasks.getByName("${name}Runner").configure(configure)
192+
}
193+
190194
/** Print out an excerpt of the log from the given node. */
191195
protected static void printLogExcerpt(NodeInfo nodeInfo) {
192196
File logFile = new File(nodeInfo.homeDir, "logs/${nodeInfo.clusterName}.log")

buildSrc/src/main/groovy/org/elasticsearch/gradle/vagrant/VagrantTestPlugin.groovy

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ class VagrantTestPlugin implements Plugin<Project> {
7878
private static final PACKAGING_TEST_CONFIGURATION = 'packagingTest'
7979
private static final BATS = 'bats'
8080
private static final String BATS_TEST_COMMAND ="cd \$PACKAGING_ARCHIVES && sudo bats --tap \$BATS_TESTS/*.$BATS"
81-
private static final String PLATFORM_TEST_COMMAND ="rm -rf ~/elasticsearch && rsync -r /elasticsearch/ ~/elasticsearch && cd ~/elasticsearch && ./gradlew test integTest"
8281

8382
/** Boxes that have been supplied and are available for testing **/
8483
List<String> availableBoxes = []
@@ -388,15 +387,6 @@ class VagrantTestPlugin implements Plugin<Project> {
388387
}
389388
}
390389

391-
private static void createPlatformTestTask(Project project) {
392-
project.tasks.create('platformTest') {
393-
group 'Verification'
394-
description "Test unit and integ tests on different platforms using vagrant. See TESTING.asciidoc for details. This test " +
395-
"is unmaintained."
396-
dependsOn 'vagrantCheckVersion'
397-
}
398-
}
399-
400390
private void createBoxListTasks(Project project) {
401391
project.tasks.create('listAllBoxes') {
402392
group 'Verification'
@@ -429,7 +419,6 @@ class VagrantTestPlugin implements Plugin<Project> {
429419
createSmokeTestTask(project)
430420
createPrepareVagrantTestEnvTask(project)
431421
createPackagingTestTask(project)
432-
createPlatformTestTask(project)
433422
createBoxListTasks(project)
434423
}
435424

@@ -454,9 +443,6 @@ class VagrantTestPlugin implements Plugin<Project> {
454443
assert project.tasks.packagingTest != null
455444
Task packagingTest = project.tasks.packagingTest
456445

457-
assert project.tasks.platformTest != null
458-
Task platformTest = project.tasks.platformTest
459-
460446
/*
461447
* We always use the main project.rootDir as Vagrant's current working directory (VAGRANT_CWD)
462448
* so that boxes are not duplicated for every Gradle project that use this VagrantTestPlugin.
@@ -610,31 +596,6 @@ class VagrantTestPlugin implements Plugin<Project> {
610596
packagingTest.dependsOn(javaPackagingTest)
611597
}
612598
}
613-
614-
/*
615-
* This test is unmaintained and was created to run on Linux. We won't allow it to run on Windows
616-
* until it's been brought back into maintenance
617-
*/
618-
if (LINUX_BOXES.contains(box)) {
619-
Task platform = project.tasks.create("vagrant${boxTask}#platformTest", VagrantCommandTask) {
620-
command 'ssh'
621-
boxName box
622-
environmentVars vagrantEnvVars
623-
dependsOn up
624-
finalizedBy halt
625-
args '--command', PLATFORM_TEST_COMMAND + " -Dtests.seed=${-> project.testSeed}"
626-
}
627-
TaskExecutionAdapter platformReproListener = createReproListener(project, platform.path)
628-
platform.doFirst {
629-
project.gradle.addListener(platformReproListener)
630-
}
631-
platform.doLast {
632-
project.gradle.removeListener(platformReproListener)
633-
}
634-
if (project.extensions.esvagrant.boxes.contains(box)) {
635-
platformTest.dependsOn(platform)
636-
}
637-
}
638599
}
639600
}
640601

buildSrc/src/main/java/org/elasticsearch/GradleServicesAdapter.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
import org.gradle.process.JavaExecSpec;
3131

3232
import java.io.File;
33+
import java.nio.file.Path;
3334

3435
/**
3536
* Bridge a gap until Gradle offers service injection for plugins.
@@ -76,4 +77,8 @@ public FileCollection fileTree(File dir) {
7677
public void loggedExec(Action<ExecSpec> action) {
7778
LoggedExec.exec(project, action);
7879
}
80+
81+
public void delete(Path path) {
82+
project.delete(path.toFile());
83+
}
7984
}

0 commit comments

Comments
 (0)