Skip to content

Commit 859a87f

Browse files
committed
Merge branch 'master' into build-docker-images
* master: (133 commits) SNAPSHOT: Increase Timeout to Stabilize Test (elastic#36294) Fix get certificates HLRC API (elastic#36198) Avoid shutting down the only master (elastic#36272) Fix typo in comment Fix total hits serialization of the search response (elastic#36290) Fix FullClusterRestartIT#testRollupIDSchemeAfterRestart Mute FullClusterRestartIT#testRollupIDSchemeAfterRestart as we await a fix. [Docs] Add Profile API limitations (elastic#36252) Make sure test don't use Math.random for reproducability (elastic#36241) Fix compilation ingest: support default pipeline through an alias (elastic#36231) Zen2: Rename tombstones to exclusions (elastic#36226) [Zen2] Hide not recovered state (elastic#36224) Test: mute testDataNodeRestartWithBusyMasterDuringSnapshot Test: mute testSnapshotAndRestoreWithNested Revert "Test: mute failing mtermvector rest test" Test: mute failing mtermvector rest test add version 6.5.3 (elastic#36268) Make hits.total an object in the search response (elastic#35849) [DOCS] Fixes broken link in execute watch ...
2 parents b20be22 + 98e66c6 commit 859a87f

File tree

990 files changed

+33793
-4935
lines changed

Some content is hidden

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

990 files changed

+33793
-4935
lines changed

benchmarks/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ dependencies {
3333
exclude group: 'net.sf.jopt-simple', module: 'jopt-simple'
3434
}
3535
compile "org.openjdk.jmh:jmh-core:$versions.jmh"
36-
compile "org.openjdk.jmh:jmh-generator-annprocess:$versions.jmh"
36+
annotationProcessor "org.openjdk.jmh:jmh-generator-annprocess:$versions.jmh"
3737
// Dependencies of JMH
3838
runtime 'net.sf.jopt-simple:jopt-simple:4.6'
3939
runtime 'org.apache.commons:commons-math3:3.2'

build.gradle

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,16 @@ import org.elasticsearch.gradle.Version
2424
import org.elasticsearch.gradle.VersionCollection
2525
import org.elasticsearch.gradle.VersionProperties
2626
import org.elasticsearch.gradle.plugin.PluginBuildPlugin
27+
import org.gradle.api.tasks.options.Option
28+
import org.gradle.util.GradleVersion
29+
import org.gradle.util.DistributionLocator
2730
import org.gradle.plugins.ide.eclipse.model.SourceFolder
2831
import com.carrotsearch.gradle.junit4.RandomizedTestingTask
2932

3033
import java.util.function.Predicate
3134

3235
plugins {
33-
id 'com.gradle.build-scan' version '1.13.2'
36+
id 'com.gradle.build-scan' version '2.0.2'
3437
id 'base'
3538
}
3639
if (properties.get("org.elasticsearch.acceptScanTOS", "false") == "true") {
@@ -527,7 +530,7 @@ allprojects {
527530
class Run extends DefaultTask {
528531
boolean debug = false
529532

530-
@org.gradle.api.internal.tasks.options.Option(
533+
@Option(
531534
option = "debug-jvm",
532535
description = "Enable debugging configuration, to allow attaching a debugger to elasticsearch."
533536
)

buildSrc/build.gradle

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -147,10 +147,8 @@ if (project == rootProject) {
147147
mavenLocal()
148148
}
149149
}
150-
test {
151-
include "**/*Tests.class"
152-
exclude "**/*IT.class"
153-
}
150+
// only run tests as build-tools
151+
test.enabled = false
154152
}
155153

156154
/*****************************************************************************
@@ -180,9 +178,17 @@ if (project != rootProject) {
180178
jarHell.enabled = false
181179
thirdPartyAudit.enabled = false
182180

183-
// tests can't be run with randomized test runner
184-
// it's fine as we run them as part of :buildSrc
185-
test.enabled = false
181+
test {
182+
include "**/*Tests.class"
183+
exclude "**/*IT.class"
184+
// The test task is configured to runtimeJava version, but build-tools doesn't support all of them, so test
185+
// with compiler instead on the ones that are too old.
186+
if (project.runtimeJavaVersion <= JavaVersion.VERSION_1_10) {
187+
jvm = "${project.compilerJavaHome}/bin/java"
188+
}
189+
}
190+
191+
// This can't be an RandomizedTestingTask because we can't yet reference it
186192
task integTest(type: Test) {
187193
// integration test requires the local testing repo for example plugin builds
188194
dependsOn project.rootProject.allprojects.collect {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ class TestProgressLogger implements AggregatedEventListener {
125125

126126
@Subscribe
127127
void onTestResult(AggregatedTestResultEvent e) throws IOException {
128-
final String statusMessage
128+
String statusMessage
129129
testsCompleted++
130130
switch (e.status) {
131131
case ERROR:

buildSrc/src/main/groovy/org/elasticsearch/gradle/BuildPlugin.groovy

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ class BuildPlugin implements Plugin<Project> {
6969
+ 'elasticsearch.standalone-rest-test, and elasticsearch.build '
7070
+ 'are mutually exclusive')
7171
}
72-
final String minimumGradleVersion
72+
String minimumGradleVersion = null
7373
InputStream is = getClass().getResourceAsStream("/minimumGradleVersion")
7474
try { minimumGradleVersion = IOUtils.toString(is, StandardCharsets.UTF_8.toString()) } finally { is.close() }
7575
if (GradleVersion.current() < GradleVersion.version(minimumGradleVersion.trim())) {
@@ -320,7 +320,7 @@ class BuildPlugin implements Plugin<Project> {
320320
}
321321

322322
private static String findCompilerJavaHome() {
323-
final String compilerJavaHome = System.getenv('JAVA_HOME')
323+
String compilerJavaHome = System.getenv('JAVA_HOME')
324324
final String compilerJavaProperty = System.getProperty('compiler.java')
325325
if (compilerJavaProperty != null) {
326326
compilerJavaHome = findJavaHome(compilerJavaProperty)
@@ -857,13 +857,26 @@ class BuildPlugin implements Plugin<Project> {
857857
}
858858

859859
static void applyCommonTestConfig(Project project) {
860-
project.tasks.withType(RandomizedTestingTask) {
860+
project.tasks.withType(RandomizedTestingTask) {task ->
861861
jvm "${project.runtimeJavaHome}/bin/java"
862862
parallelism System.getProperty('tests.jvms', project.rootProject.ext.defaultParallel)
863863
ifNoTests System.getProperty('tests.ifNoTests', 'fail')
864864
onNonEmptyWorkDirectory 'wipe'
865865
leaveTemporary true
866866

867+
// Make sure all test tasks are configured properly
868+
if (name != "test") {
869+
project.tasks.matching { it.name == "test"}.all { testTask ->
870+
task.testClassesDirs = testTask.testClassesDirs
871+
task.classpath = testTask.classpath
872+
task.shouldRunAfter testTask
873+
}
874+
}
875+
// no loose ends: check has to depend on all test tasks
876+
project.tasks.matching {it.name == "check"}.all {
877+
dependsOn(task)
878+
}
879+
867880
// TODO: why are we not passing maxmemory to junit4?
868881
jvmArg '-Xmx' + System.getProperty('tests.heap.size', '512m')
869882
jvmArg '-Xms' + System.getProperty('tests.heap.size', '512m')

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,6 @@ public class PluginBuildPlugin extends BuildPlugin {
129129
RestIntegTestTask integTest = project.tasks.create('integTest', RestIntegTestTask.class)
130130
integTest.mustRunAfter(project.precommit, project.test)
131131
project.integTestCluster.distribution = System.getProperty('tests.distribution', 'integ-test-zip')
132-
project.check.dependsOn(integTest)
133132
}
134133

135134
/**

buildSrc/src/main/groovy/org/elasticsearch/gradle/precommit/PrecommitTasks.groovy

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -190,8 +190,7 @@ class PrecommitTasks {
190190
Task checkstyleTask = project.tasks.create('checkstyle')
191191
// Apply the checkstyle plugin to create `checkstyleMain` and `checkstyleTest`. It only
192192
// creates them if there is main or test code to check and it makes `check` depend
193-
// on them. But we want `precommit` to depend on `checkstyle` which depends on them so
194-
// we have to swap them.
193+
// on them. We also want `precommit` to depend on `checkstyle`.
195194
project.pluginManager.apply('checkstyle')
196195
project.checkstyle {
197196
config = project.resources.text.fromFile(checkstyleConf, 'UTF-8')
@@ -202,7 +201,6 @@ class PrecommitTasks {
202201
}
203202

204203
project.tasks.withType(Checkstyle) { task ->
205-
project.tasks[JavaBasePlugin.CHECK_TASK_NAME].dependsOn.remove(task)
206204
checkstyleTask.dependsOn(task)
207205
task.dependsOn(copyCheckstyleConf)
208206
task.inputs.file(checkstyleSuppressions)

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@ class ClusterFormationTasks {
111111
for (int i = 0; i < config.numNodes; i++) {
112112
// we start N nodes and out of these N nodes there might be M bwc nodes.
113113
// for each of those nodes we might have a different configuration
114-
final Configuration distro
115-
final String elasticsearchVersion
114+
Configuration distro
115+
String elasticsearchVersion
116116
if (i < config.numBwcNodes) {
117117
elasticsearchVersion = config.bwcVersion.toString()
118118
if (project.bwcVersions.unreleased.contains(config.bwcVersion)) {
@@ -595,7 +595,7 @@ class ClusterFormationTasks {
595595
}
596596

597597
static Task configureInstallPluginTask(String name, Project project, Task setup, NodeInfo node, String pluginName, String prefix) {
598-
final FileCollection pluginZip;
598+
FileCollection pluginZip;
599599
if (node.nodeVersion != Version.fromString(VersionProperties.elasticsearch)) {
600600
pluginZip = project.configurations.getByName(pluginBwcConfigurationName(prefix, pluginName))
601601
} else {

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ import org.gradle.api.DefaultTask
2525
import org.gradle.api.Project
2626
import org.gradle.api.Task
2727
import org.gradle.api.execution.TaskExecutionAdapter
28-
import org.gradle.api.internal.tasks.options.Option
2928
import org.gradle.api.provider.Property
3029
import org.gradle.api.provider.Provider
3130
import org.gradle.api.tasks.Copy
3231
import org.gradle.api.tasks.Input
3332
import org.gradle.api.tasks.TaskState
33+
import org.gradle.api.tasks.options.Option
3434
import org.gradle.plugins.ide.idea.IdeaPlugin
3535

3636
import java.nio.charset.StandardCharsets
@@ -53,7 +53,7 @@ public class RestIntegTestTask extends DefaultTask {
5353

5454
/** Flag indicating whether the rest tests in the rest spec should be run. */
5555
@Input
56-
Property<Boolean> includePackaged = project.objects.property(Boolean)
56+
Boolean includePackaged = false
5757

5858
public RestIntegTestTask() {
5959
runner = project.tasks.create("${name}Runner", RandomizedTestingTask.class)
@@ -109,7 +109,7 @@ public class RestIntegTestTask extends DefaultTask {
109109
}
110110

111111
// copy the rest spec/tests into the test resources
112-
Task copyRestSpec = createCopyRestSpecTask(project, includePackaged)
112+
Task copyRestSpec = createCopyRestSpecTask()
113113
runner.dependsOn(copyRestSpec)
114114

115115
// this must run after all projects have been configured, so we know any project
@@ -130,7 +130,7 @@ public class RestIntegTestTask extends DefaultTask {
130130

131131
/** Sets the includePackaged property */
132132
public void includePackaged(boolean include) {
133-
includePackaged.set(include)
133+
includePackaged = include
134134
}
135135

136136
@Option(
@@ -215,7 +215,7 @@ public class RestIntegTestTask extends DefaultTask {
215215
* @param project The project to add the copy task to
216216
* @param includePackagedTests true if the packaged tests should be copied, false otherwise
217217
*/
218-
static Task createCopyRestSpecTask(Project project, Provider<Boolean> includePackagedTests) {
218+
Task createCopyRestSpecTask() {
219219
project.configurations {
220220
restSpec
221221
}
@@ -237,7 +237,7 @@ public class RestIntegTestTask extends DefaultTask {
237237
project.afterEvaluate {
238238
copyRestSpec.from({ project.zipTree(project.configurations.restSpec.singleFile) }) {
239239
include 'rest-api-spec/api/**'
240-
if (includePackagedTests.get()) {
240+
if (includePackaged) {
241241
include 'rest-api-spec/test/**'
242242
}
243243
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package org.elasticsearch.gradle.test
22

33
import org.gradle.api.DefaultTask
44
import org.gradle.api.Task
5-
import org.gradle.api.internal.tasks.options.Option
5+
import org.gradle.api.tasks.options.Option
66
import org.gradle.util.ConfigureUtil
77

88
public class RunTask extends DefaultTask {

0 commit comments

Comments
 (0)