diff --git a/build.gradle b/build.gradle index e02d79a286830..6506ada282791 100644 --- a/build.gradle +++ b/build.gradle @@ -295,22 +295,16 @@ gradle.projectsEvaluated { // :test:framework:test cannot run before and after :server:test return } - if (tasks.findByPath('test') != null && tasks.findByPath('integTest') != null) { - integTest.mustRunAfter test + tasks.matching { it.name.equals('integTest')}.configureEach {integTestTask -> + integTestTask.mustRunAfter tasks.matching { it.name.equals("test") } } configurations.matching { it.canBeResolved }.all { Configuration configuration -> dependencies.matching { it instanceof ProjectDependency }.all { ProjectDependency dep -> Project upstreamProject = dep.dependencyProject - if (upstreamProject != null) { - if (project.path == upstreamProject.path) { - // TODO: distribution integ tests depend on themselves (!), fix that - return - } + if (project.path != upstreamProject?.path) { for (String taskName : ['test', 'integTest']) { - Task task = project.tasks.findByName(taskName) - Task upstreamTask = upstreamProject.tasks.findByName(taskName) - if (task != null && upstreamTask != null) { - task.shouldRunAfter(upstreamTask) + project.tasks.matching { it.name == taskName }.configureEach {task -> + task.shouldRunAfter(upstreamProject.tasks.matching { upStreamTask -> upStreamTask.name == taskName }) } } } @@ -491,7 +485,7 @@ allprojects { subprojects { project.ext.disableTasks = { String... tasknames -> for (String taskname : tasknames) { - project.tasks.named(taskname).configure { onlyIf { false } } + project.tasks.named(taskname).configure { enabled = false } } } } diff --git a/buildSrc/reaper/build.gradle b/buildSrc/reaper/build.gradle index ed810b362c389..5a1da72c42082 100644 --- a/buildSrc/reaper/build.gradle +++ b/buildSrc/reaper/build.gradle @@ -1,6 +1,6 @@ apply plugin: 'java' -jar { +tasks.named("jar").configure { archiveFileName = "${project.name}.jar" manifest { attributes 'Main-Class': 'org.elasticsearch.gradle.reaper.Reaper' diff --git a/buildSrc/src/main/groovy/org/elasticsearch/gradle/doc/DocsTestPlugin.groovy b/buildSrc/src/main/groovy/org/elasticsearch/gradle/doc/DocsTestPlugin.groovy index ab57ccf5c4722..60b667a0fd6cc 100644 --- a/buildSrc/src/main/groovy/org/elasticsearch/gradle/doc/DocsTestPlugin.groovy +++ b/buildSrc/src/main/groovy/org/elasticsearch/gradle/doc/DocsTestPlugin.groovy @@ -23,7 +23,9 @@ import org.elasticsearch.gradle.Version import org.elasticsearch.gradle.VersionProperties import org.gradle.api.Plugin import org.gradle.api.Project -import org.gradle.api.Task +import org.gradle.api.file.Directory +import org.gradle.api.file.DirectoryProperty +import org.gradle.api.provider.Provider import org.gradle.api.tasks.TaskProvider /** @@ -72,8 +74,13 @@ class DocsTestPlugin implements Plugin { } } - project.tasks.register('buildRestTests', RestTestsFromSnippetsTask) { + Provider restRootDir = project.getLayout().buildDirectory.dir("rest") + TaskProvider buildRestTests = project.tasks.register('buildRestTests', RestTestsFromSnippetsTask) { defaultSubstitutions = commonDefaultSubstitutions + testRoot.convention(restRootDir) } + + // TODO: This effectively makes testRoot not customizable, which we don't do anyway atm + project.sourceSets.test.output.dir(restRootDir, builtBy: buildRestTests) } } diff --git a/buildSrc/src/main/groovy/org/elasticsearch/gradle/doc/RestTestsFromSnippetsTask.groovy b/buildSrc/src/main/groovy/org/elasticsearch/gradle/doc/RestTestsFromSnippetsTask.groovy index c71133e673b1e..23a2dacff08aa 100644 --- a/buildSrc/src/main/groovy/org/elasticsearch/gradle/doc/RestTestsFromSnippetsTask.groovy +++ b/buildSrc/src/main/groovy/org/elasticsearch/gradle/doc/RestTestsFromSnippetsTask.groovy @@ -22,10 +22,13 @@ package org.elasticsearch.gradle.doc import groovy.transform.PackageScope import org.elasticsearch.gradle.doc.SnippetsTask.Snippet import org.gradle.api.InvalidUserDataException +import org.gradle.api.file.DirectoryProperty import org.gradle.api.tasks.Input import org.gradle.api.tasks.Internal import org.gradle.api.tasks.OutputDirectory +import org.gradle.api.model.ObjectFactory +import javax.inject.Inject; import java.nio.file.Files import java.nio.file.Path @@ -54,19 +57,16 @@ class RestTestsFromSnippetsTask extends SnippetsTask { /** * Root directory of the tests being generated. To make rest tests happy - * we generate them in a testRoot() which is contained in this directory. + * we generate them in a testRoot which is contained in this directory. */ - @OutputDirectory - File testRoot = project.file('build/rest') + private DirectoryProperty testRoot @Internal Set names = new HashSet<>() - RestTestsFromSnippetsTask() { - project.afterEvaluate { - // Wait to set this so testRoot can be customized - project.sourceSets.test.output.dir(testRoot, builtBy: this) - } + @Inject + RestTestsFromSnippetsTask(ObjectFactory objectFactory) { + testRoot = objectFactory.directoryProperty() TestBuilder builder = new TestBuilder() doFirst { outputRoot().delete() } perSnippet builder.&handleSnippet @@ -79,10 +79,14 @@ class RestTestsFromSnippetsTask extends SnippetsTask { * contained within testRoot. */ File outputRoot() { - return new File(testRoot, '/rest-api-spec/test') + return new File(testRoot.get().asFile, '/rest-api-spec/test') } - /** + @OutputDirectory + DirectoryProperty getTestRoot() { + return testRoot + } +/** * Is this snippet a candidate for conversion to `// CONSOLE`? */ static isConsoleCandidate(Snippet snippet) { diff --git a/buildSrc/src/main/java/org/elasticsearch/gradle/util/GradleUtils.java b/buildSrc/src/main/java/org/elasticsearch/gradle/util/GradleUtils.java index 48619a5ed42e1..0efd6515c0481 100644 --- a/buildSrc/src/main/java/org/elasticsearch/gradle/util/GradleUtils.java +++ b/buildSrc/src/main/java/org/elasticsearch/gradle/util/GradleUtils.java @@ -32,6 +32,7 @@ import org.gradle.api.services.BuildService; import org.gradle.api.services.BuildServiceRegistration; import org.gradle.api.services.BuildServiceRegistry; +import org.gradle.api.specs.Spec; import org.gradle.api.tasks.SourceSet; import org.gradle.api.tasks.SourceSetContainer; import org.gradle.api.tasks.TaskContainer; @@ -82,11 +83,7 @@ public static void maybeConfigure( Class type, Action config ) { - tasks.withType(type).configureEach(task -> { - if (task.getName().equals(name)) { - config.execute(task); - } - }); + tasks.withType(type).matching((Spec) t -> t.getName().equals(name)).configureEach(task -> { config.execute(task); }); } public static TaskProvider findByName(TaskContainer tasks, String name) { diff --git a/client/rest-high-level/build.gradle b/client/rest-high-level/build.gradle index e69f9715b25d1..3090e79bb58cb 100644 --- a/client/rest-high-level/build.gradle +++ b/client/rest-high-level/build.gradle @@ -76,7 +76,7 @@ tasks.named("integTest").configure { } // Requires https://github.com/elastic/elasticsearch/pull/64403 to have this moved to task avoidance api. -RestIntegTestTask asyncIntegTest = tasks.create("asyncIntegTest", RestIntegTestTask) { +TaskProvider asyncIntegTest = tasks.register("asyncIntegTest", RestIntegTestTask) { systemProperty 'tests.rest.async', 'true' systemProperty 'tests.rest.cluster.username', System.getProperty('tests.rest.cluster.username', 'test_user') systemProperty 'tests.rest.cluster.password', System.getProperty('tests.rest.cluster.password', 'test-password') diff --git a/client/test/build.gradle b/client/test/build.gradle index ba16ab47a1c3a..b29f6628977ce 100644 --- a/client/test/build.gradle +++ b/client/test/build.gradle @@ -45,7 +45,7 @@ tasks.named('forbiddenApisTest').configure { // JarHell is part of es server, which we don't want to pull in // TODO: Not anymore. Now in :libs:elasticsearch-core -jarHell.enabled = false +tasks.named("jarHell").configure { enabled = false } // TODO: should we have licenses for our test deps? tasks.named("dependencyLicenses").configure { enabled = false } diff --git a/distribution/packages/build.gradle b/distribution/packages/build.gradle index a759e47cb1406..db5902e0d99cb 100644 --- a/distribution/packages/build.gradle +++ b/distribution/packages/build.gradle @@ -494,7 +494,7 @@ subprojects { tasks.register("checkLicense") { dependsOn buildDist, "checkExtraction" } - check.dependsOn "checkLicense" + tasks.named("check").configure { dependsOn "checkLicense" } if (project.name.contains('deb')) { tasks.named("checkLicense").configure { onlyIf dpkgExists diff --git a/docs/build.gradle b/docs/build.gradle index a2e30f46774c1..f547f5194a60c 100644 --- a/docs/build.gradle +++ b/docs/build.gradle @@ -25,22 +25,24 @@ apply plugin: 'elasticsearch.docs-test' apply plugin: 'elasticsearch.rest-resources' /* List of files that have snippets that will not work until platinum tests can occur ... */ -buildRestTests.expectedUnconvertedCandidates = [ - 'reference/ml/anomaly-detection/ml-configuring-transform.asciidoc', - 'reference/ml/anomaly-detection/apis/delete-calendar-event.asciidoc', - 'reference/ml/anomaly-detection/apis/get-bucket.asciidoc', - 'reference/ml/anomaly-detection/apis/get-category.asciidoc', - 'reference/ml/anomaly-detection/apis/get-influencer.asciidoc', - 'reference/ml/anomaly-detection/apis/get-job-stats.asciidoc', - 'reference/ml/anomaly-detection/apis/get-job.asciidoc', - 'reference/ml/anomaly-detection/apis/get-overall-buckets.asciidoc', - 'reference/ml/anomaly-detection/apis/get-record.asciidoc', - 'reference/ml/anomaly-detection/apis/get-snapshot.asciidoc', - 'reference/ml/anomaly-detection/apis/post-data.asciidoc', - 'reference/ml/anomaly-detection/apis/revert-snapshot.asciidoc', - 'reference/ml/anomaly-detection/apis/update-snapshot.asciidoc', - 'reference/ml/anomaly-detection/apis/update-job.asciidoc' -] +tasks.named("buildRestTests").configure { + expectedUnconvertedCandidates = [ + 'reference/ml/anomaly-detection/ml-configuring-transform.asciidoc', + 'reference/ml/anomaly-detection/apis/delete-calendar-event.asciidoc', + 'reference/ml/anomaly-detection/apis/get-bucket.asciidoc', + 'reference/ml/anomaly-detection/apis/get-category.asciidoc', + 'reference/ml/anomaly-detection/apis/get-influencer.asciidoc', + 'reference/ml/anomaly-detection/apis/get-job-stats.asciidoc', + 'reference/ml/anomaly-detection/apis/get-job.asciidoc', + 'reference/ml/anomaly-detection/apis/get-overall-buckets.asciidoc', + 'reference/ml/anomaly-detection/apis/get-record.asciidoc', + 'reference/ml/anomaly-detection/apis/get-snapshot.asciidoc', + 'reference/ml/anomaly-detection/apis/post-data.asciidoc', + 'reference/ml/anomaly-detection/apis/revert-snapshot.asciidoc', + 'reference/ml/anomaly-detection/apis/update-snapshot.asciidoc', + 'reference/ml/anomaly-detection/apis/update-job.asciidoc' + ] +} restResources { restApi { @@ -97,7 +99,7 @@ project.rootProject.subprojects.findAll { it.parent.path == ':plugins' }.each { testClusters.integTest.plugin subproj.path } -buildRestTests.docs = fileTree(projectDir) { +ext.docsFileTree = fileTree(projectDir) { // No snippets in here! exclude 'build.gradle' // That is where the snippets go, not where they come from! @@ -114,10 +116,21 @@ buildRestTests.docs = fileTree(projectDir) { } } -listSnippets.docs = buildRestTests.docs +tasks.named("buildRestTests").configure { + docs = docsFileTree +} + +tasks.named("listSnippets").configure { + docs = docsFileTree +} + +tasks.named("listConsoleCandidates").configure { + docs = docsFileTree +} Closure setupMyIndex = { String name, int count -> - buildRestTests.setups[name] = ''' + tasks.named("buildRestTests").configure { buildRestTests -> + buildRestTests.setups[name] = ''' - do: indices.create: index: my-index-000001 @@ -147,24 +160,27 @@ Closure setupMyIndex = { String name, int count -> index: my-index-000001 refresh: true body: |''' - for (int i = 0; i < count; i++) { - String ip, user_id - if (i == 0) { - ip = '127.0.0.1' - user_id = 'kimchy' - } else { - ip = '10.42.42.42' - user_id= 'elkbee' - } - buildRestTests.setups[name] += """ + for (int i = 0; i < count; i++) { + String ip, user_id + if (i == 0) { + ip = '127.0.0.1' + user_id = 'kimchy' + } else { + ip = '10.42.42.42' + user_id = 'elkbee' + } + buildRestTests.setups[name] += """ { "index":{"_id": "$i"} } { "@timestamp": "2099-11-15T14:12:12", "http": { "request": { "method": "get" }, "response": { "bytes": 1070000, "status_code": 200 }, "version": "1.1" }, "message": "GET /search HTTP/1.1 200 1070000", "source": { "ip": "$ip" }, "user": { "id": "$user_id" } }""" + } } } setupMyIndex('my_index', 5) setupMyIndex('my_index_big', 120) setupMyIndex('my_index_huge', 1200) +tasks.named("buildRestTests").configure {buildRestTests -> + // Used for several full-text search and agg examples buildRestTests.setups['messages'] = ''' - do: @@ -1233,7 +1249,7 @@ buildRestTests.setups['calendar_outages_addjob'] = buildRestTests.setups['server "job_ids": ["total-requests"] } ''' -buildRestTests.setups['calendar_outages_addevent'] = buildRestTests.setups['calendar_outages_addjob'] + ''' +setups['calendar_outages_addevent'] = setups['calendar_outages_addjob'] + ''' - do: ml.post_calendar_events: calendar_id: "planned-outages" @@ -1246,7 +1262,7 @@ buildRestTests.setups['calendar_outages_addevent'] = buildRestTests.setups['cale ''' // used by median absolute deviation aggregation -buildRestTests.setups['reviews'] = ''' +setups['reviews'] = ''' - do: indices.create: index: reviews @@ -1270,7 +1286,7 @@ buildRestTests.setups['reviews'] = ''' {"index": {"_id": "2"}} {"product": "widget-foo", "rating": 5} ''' -buildRestTests.setups['remote_cluster'] = buildRestTests.setups['host'] + ''' +setups['remote_cluster'] = setups['host'] + ''' - do: cluster.put_settings: body: @@ -1278,7 +1294,8 @@ buildRestTests.setups['remote_cluster'] = buildRestTests.setups['host'] + ''' cluster.remote.remote_cluster.seeds: $transport_host ''' -buildRestTests.setups['remote_cluster_and_leader_index'] = buildRestTests.setups['remote_cluster'] + ''' + +setups['remote_cluster_and_leader_index'] = setups['remote_cluster'] + ''' - do: indices.create: index: leader_index @@ -1289,7 +1306,7 @@ buildRestTests.setups['remote_cluster_and_leader_index'] = buildRestTests.setups index.soft_deletes.enabled: true ''' -buildRestTests.setups['seats'] = ''' +setups['seats'] = ''' - do: indices.create: index: seats @@ -1322,7 +1339,7 @@ buildRestTests.setups['seats'] = ''' {"theatre": "Graye", "cost": 33, "row": 2, "number": 6, "sold": false} {"index":{"_id": "4"}} {"theatre": "Skyline", "cost": 20, "row": 5, "number": 2, "sold": false}''' -buildRestTests.setups['kibana_sample_data_ecommerce'] = ''' +setups['kibana_sample_data_ecommerce'] = ''' - do: indices.create: index: kibana_sample_data_ecommerce @@ -1331,7 +1348,7 @@ buildRestTests.setups['kibana_sample_data_ecommerce'] = ''' number_of_shards: 1 number_of_replicas: 0 ''' -buildRestTests.setups['add_timestamp_pipeline'] = ''' +setups['add_timestamp_pipeline'] = ''' - do: ingest.put_pipeline: id: "add_timestamp_pipeline" @@ -1347,7 +1364,7 @@ buildRestTests.setups['add_timestamp_pipeline'] = ''' ] } ''' -buildRestTests.setups['simple_kibana_continuous_pivot'] = buildRestTests.setups['kibana_sample_data_ecommerce'] + buildRestTests.setups['add_timestamp_pipeline'] + ''' +setups['simple_kibana_continuous_pivot'] = setups['kibana_sample_data_ecommerce'] + setups['add_timestamp_pipeline'] + ''' - do: raw: method: PUT @@ -1394,7 +1411,7 @@ buildRestTests.setups['simple_kibana_continuous_pivot'] = buildRestTests.setups[ } } ''' -buildRestTests.setups['setup_logdata'] = ''' +setups['setup_logdata'] = ''' - do: indices.create: index: logdata @@ -1416,7 +1433,7 @@ buildRestTests.setups['setup_logdata'] = ''' {"index":{}} {"grade": 50, "weight": 3} ''' -buildRestTests.setups['logdata_job'] = buildRestTests.setups['setup_logdata'] + ''' +setups['logdata_job'] = setups['setup_logdata'] + ''' - do: ml.put_data_frame_analytics: id: "loganalytics" @@ -1434,7 +1451,7 @@ buildRestTests.setups['logdata_job'] = buildRestTests.setups['setup_logdata'] + } ''' // Used by snapshot lifecycle management docs -buildRestTests.setups['setup-repository'] = ''' +setups['setup-repository'] = ''' - do: snapshot.create_repository: repository: my_repository @@ -1445,7 +1462,7 @@ buildRestTests.setups['setup-repository'] = ''' ''' // Fake sec logs data used by EQL search -buildRestTests.setups['atomic_red_regsvr32'] = ''' + setups['atomic_red_regsvr32'] = ''' - do: indices.create: index: my-index-000001 @@ -1460,13 +1477,15 @@ buildRestTests.setups['atomic_red_regsvr32'] = ''' body: | #atomic_red_data# ''' -/* Load the actual events only if we're going to use them. */ -File atomicRedRegsvr32File = new File("$projectDir/src/test/resources/normalized-T1117-AtomicRed-regsvr32.json") -buildRestTests.inputs.file(atomicRedRegsvr32File) -buildRestTests.doFirst { - String events = atomicRedRegsvr32File.getText('UTF-8') - // Indent like a yaml test needs - events = events.replaceAll('(?m)^', ' ') - buildRestTests.setups['atomic_red_regsvr32'] = - buildRestTests.setups['atomic_red_regsvr32'].replace('#atomic_red_data#', events) + /* Load the actual events only if we're going to use them. */ + File atomicRedRegsvr32File = new File("$projectDir/src/test/resources/normalized-T1117-AtomicRed-regsvr32.json") + inputs.file(atomicRedRegsvr32File) + + doFirst { + String events = atomicRedRegsvr32File.getText('UTF-8') + // Indent like a yaml test needs + events = events.replaceAll('(?m)^', ' ') + setups['atomic_red_regsvr32'] = + setups['atomic_red_regsvr32'].replace('#atomic_red_data#', events) + } } diff --git a/libs/cli/build.gradle b/libs/cli/build.gradle index 27e799362e65b..d38a1e127437d 100644 --- a/libs/cli/build.gradle +++ b/libs/cli/build.gradle @@ -25,9 +25,9 @@ dependencies { api project(':libs:elasticsearch-core') } -test.enabled = false +tasks.named("test").configure { enabled = false } // Since CLI does not depend on :server, it cannot run the jarHell task -jarHell.enabled = false +tasks.named("jarHell").configure { enabled = false } tasks.named('forbiddenApisMain').configure { replaceSignatureFiles 'jdk-signatures' diff --git a/libs/plugin-classloader/build.gradle b/libs/plugin-classloader/build.gradle index 94f5cbcde4e1d..433d522d59ea6 100644 --- a/libs/plugin-classloader/build.gradle +++ b/libs/plugin-classloader/build.gradle @@ -17,8 +17,8 @@ * under the License. */ -test.enabled = false +tasks.named("test").configure { enabled = false } // test depend on ES core... disableTasks('forbiddenApisMain') -jarHell.enabled = false +tasks.named("jarHell").configure { enabled = false } diff --git a/libs/secure-sm/build.gradle b/libs/secure-sm/build.gradle index 39414fd3afc6e..27b7d0e982b87 100644 --- a/libs/secure-sm/build.gradle +++ b/libs/secure-sm/build.gradle @@ -35,7 +35,7 @@ tasks.named('forbiddenApisMain').configure { } // JAR hell is part of core which we do not want to add as a dependency -jarHell.enabled = false +tasks.named("jarHell").configure { enabled = false } testingConventions { naming.clear() diff --git a/libs/ssl-config/build.gradle b/libs/ssl-config/build.gradle index b6c637a9db5f5..a58162284eee7 100644 --- a/libs/ssl-config/build.gradle +++ b/libs/ssl-config/build.gradle @@ -35,7 +35,7 @@ tasks.named('forbiddenApisMain').configure { replaceSignatureFiles 'jdk-signatures' } -forbiddenPatterns { +tasks.named("forbiddenPatterns").configure { exclude '**/*.key' exclude '**/*.pem' exclude '**/*.p12' diff --git a/libs/x-content/build.gradle b/libs/x-content/build.gradle index 1f476f80cafbc..ee4df9bb77f4c 100644 --- a/libs/x-content/build.gradle +++ b/libs/x-content/build.gradle @@ -57,4 +57,4 @@ tasks.named("dependencyLicenses").configure { mapping from: /jackson-.*/, to: 'jackson' } -jarHell.enabled = false +tasks.named("jarHell").configure { enabled = false } diff --git a/modules/geo/build.gradle b/modules/geo/build.gradle index 5381d0e4a0451..6842575365a2d 100644 --- a/modules/geo/build.gradle +++ b/modules/geo/build.gradle @@ -31,4 +31,4 @@ restResources { artifacts { restTests(project.file('src/yamlRestTest/resources/rest-api-spec/test')) } -test.enabled = false +tasks.named("test").configure { enabled = false } diff --git a/modules/lang-painless/spi/build.gradle b/modules/lang-painless/spi/build.gradle index d0bf8639045af..83ea18ec55df5 100644 --- a/modules/lang-painless/spi/build.gradle +++ b/modules/lang-painless/spi/build.gradle @@ -28,4 +28,4 @@ dependencies { } // no tests...yet? -test.enabled = false +tasks.named("test").configure { enabled = false } diff --git a/modules/repository-url/build.gradle b/modules/repository-url/build.gradle index 646b732557f0d..4500bec0097d8 100644 --- a/modules/repository-url/build.gradle +++ b/modules/repository-url/build.gradle @@ -40,8 +40,8 @@ restResources { File repositoryDir = new File(project.buildDir, "shared-repository") /** A task to start the URLFixture which exposes the repositoryDir over HTTP **/ -task urlFixture(type: AntFixture) { - dependsOn testClasses +def urlFixtureTaskProvider = tasks.register("urlFixture", AntFixture) { + dependsOn "testClasses" doFirst { repositoryDir.mkdirs() } @@ -50,11 +50,11 @@ task urlFixture(type: AntFixture) { args 'org.elasticsearch.repositories.url.URLFixture', baseDir, "${repositoryDir.absolutePath}" } tasks.named("yamlRestTest").configure { - dependsOn urlFixture + dependsOn urlFixtureTaskProvider } tasks.named("internalClusterTest").configure { - dependsOn urlFixture + dependsOn urlFixtureTaskProvider } testClusters.all { @@ -65,4 +65,3 @@ testClusters.all { "http://snapshot.test*,http://${urlFixture.addressAndPort}" }, PropertyNormalization.IGNORE_VALUE } - diff --git a/plugins/analysis-icu/build.gradle b/plugins/analysis-icu/build.gradle index 734ad74be7cb5..f165ed23023a1 100644 --- a/plugins/analysis-icu/build.gradle +++ b/plugins/analysis-icu/build.gradle @@ -27,7 +27,7 @@ esplugin { hasClientJar = true } -forbiddenApisMain { +tasks.named("forbiddenApisMain").configure { signatures += [ "com.ibm.icu.text.Collator#getInstance() @ Don't use default locale, use getInstance(ULocale) instead" ] diff --git a/plugins/discovery-ec2/qa/amazon-ec2/build.gradle b/plugins/discovery-ec2/qa/amazon-ec2/build.gradle index 800b4ab32bb5f..a454b3555d974 100644 --- a/plugins/discovery-ec2/qa/amazon-ec2/build.gradle +++ b/plugins/discovery-ec2/qa/amazon-ec2/build.gradle @@ -50,7 +50,7 @@ processYamlRestTestResources { } // disable default yamlRestTest task, use spezialized ones below -yamlRestTest.enabled = false +tasks.named("yamlRestTest").configure { enabled = false } /* * Test using various credential providers (see also https://docs.aws.amazon.com/sdk-for-java/v2/developer-guide/credentials.html): diff --git a/plugins/examples/custom-suggester/build.gradle b/plugins/examples/custom-suggester/build.gradle index 0646b1f24f2f0..91acc0e5059b2 100644 --- a/plugins/examples/custom-suggester/build.gradle +++ b/plugins/examples/custom-suggester/build.gradle @@ -32,4 +32,4 @@ testClusters.all { } // this plugin has no unit tests, only rest tests -tasks.test.enabled = false +tasks.named("test").configure { enabled = false } diff --git a/plugins/examples/painless-whitelist/build.gradle b/plugins/examples/painless-whitelist/build.gradle index 7d937d18e88b9..5cdc6c6f7cab0 100644 --- a/plugins/examples/painless-whitelist/build.gradle +++ b/plugins/examples/painless-whitelist/build.gradle @@ -36,4 +36,4 @@ testClusters.all { testDistribution = 'oss' } -test.enabled = false +tasks.named("test").configure { enabled = false } diff --git a/plugins/examples/script-expert-scoring/build.gradle b/plugins/examples/script-expert-scoring/build.gradle index 324b136b3ebfe..ce99177387c78 100644 --- a/plugins/examples/script-expert-scoring/build.gradle +++ b/plugins/examples/script-expert-scoring/build.gradle @@ -27,5 +27,5 @@ esplugin { noticeFile rootProject.file('NOTICE.txt') } -test.enabled = false +tasks.named("test").configure { enabled = false } diff --git a/plugins/examples/security-authorization-engine/build.gradle b/plugins/examples/security-authorization-engine/build.gradle index b75871b177161..0e900cf093baf 100644 --- a/plugins/examples/security-authorization-engine/build.gradle +++ b/plugins/examples/security-authorization-engine/build.gradle @@ -19,12 +19,12 @@ dependencies { } //no unit tests tasks.named("test").configure { enabled = false } -javaRestTest { +tasks.named("javaRestTest").configure { dependsOn "buildZip" systemProperty 'tests.security.manager', 'false' } -testClusters.javaRestTest { +testClusters.matching { it.name == "javaRestTest" }.configureEach { setting 'xpack.security.enabled', 'true' setting 'xpack.ml.enabled', 'false' setting 'xpack.license.self_generated.type', 'trial' diff --git a/plugins/ingest-attachment/build.gradle b/plugins/ingest-attachment/build.gradle index df22d03b03e90..8a46d48a5babf 100644 --- a/plugins/ingest-attachment/build.gradle +++ b/plugins/ingest-attachment/build.gradle @@ -87,7 +87,7 @@ tasks.named("dependencyLicenses").configure { mapping from: /apache-mime4j-.*/, to: 'apache-mime4j' } -forbiddenPatterns { +tasks.named("forbiddenPatterns").configure { exclude '**/*.doc' exclude '**/*.docx' exclude '**/*.pdf' @@ -95,15 +95,15 @@ forbiddenPatterns { exclude '**/*.vsdx' } -thirdPartyAudit { +tasks.named("thirdPartyAudit").configure { ignoreMissingClasses() } if (BuildParams.inFipsJvm) { // FIPS JVM includes many classes from bouncycastle which count as jar hell for the third party audit, // rather than provide a long list of exclusions, disable the check on FIPS. - jarHell.enabled = false - test.enabled = false - yamlRestTest.enabled = false; - testingConventions.enabled = false; + tasks.named("jarHell").configure { enabled = false } + tasks.named("test").configure { enabled = false } + tasks.named("yamlRestTest").configure { enabled = false }; + tasks.named("testingConventions").configure { enabled = false }; } diff --git a/plugins/mapper-size/build.gradle b/plugins/mapper-size/build.gradle index 3f383179ad187..cf46c451dd29d 100644 --- a/plugins/mapper-size/build.gradle +++ b/plugins/mapper-size/build.gradle @@ -30,4 +30,4 @@ restResources { } } // no unit tests -test.enabled = false +tasks.named("test").configure { enabled = false } diff --git a/plugins/repository-s3/build.gradle b/plugins/repository-s3/build.gradle index 88051d7b7a0ed..ad2d0abb1a48d 100644 --- a/plugins/repository-s3/build.gradle +++ b/plugins/repository-s3/build.gradle @@ -172,12 +172,12 @@ tasks.named("processYamlRestTestResources").configure { MavenFilteringHack.filter(it, expansions) } -internalClusterTest { +tasks.named("internalClusterTest").configure { // this is tested explicitly in a separate test task exclude '**/S3RepositoryThirdPartyTests.class' } -yamlRestTest { +tasks.named("yamlRestTest").configure { systemProperty 'tests.rest.blacklist', ( useFixture ? ['repository_s3/50_repository_ecs_credentials/*'] @@ -190,7 +190,20 @@ yamlRestTest { ).join(",") } -testClusters.yamlRestTest { +if (useFixture) { + testFixtures.useFixture(':test:fixtures:s3-fixture', 's3-fixture') + testFixtures.useFixture(':test:fixtures:s3-fixture', 's3-fixture-with-session-token') + testFixtures.useFixture(':test:fixtures:s3-fixture', 's3-fixture-with-ec2') + + normalization { + runtimeClasspath { + // ignore generated address file for the purposes of build avoidance + ignore 's3Fixture.address' + } + } +} + +testClusters.matching { it.name == "yamlRestTest" }.configureEach { keystore 's3.client.integration_test_permanent.access_key', s3PermanentAccessKey keystore 's3.client.integration_test_permanent.secret_key', s3PermanentSecretKey @@ -199,17 +212,6 @@ testClusters.yamlRestTest { keystore 's3.client.integration_test_temporary.session_token', s3TemporarySessionToken if (useFixture) { - testFixtures.useFixture(':test:fixtures:s3-fixture', 's3-fixture') - testFixtures.useFixture(':test:fixtures:s3-fixture', 's3-fixture-with-session-token') - testFixtures.useFixture(':test:fixtures:s3-fixture', 's3-fixture-with-ec2') - - normalization { - runtimeClasspath { - // ignore generated address file for the purposes of build avoidance - ignore 's3Fixture.address' - } - } - setting 's3.client.integration_test_permanent.endpoint', { "${-> fixtureAddress('s3-fixture', 's3-fixture', '80')}" }, IGNORE_VALUE setting 's3.client.integration_test_temporary.endpoint', { "${-> fixtureAddress('s3-fixture', 's3-fixture-with-session-token', '80')}" }, IGNORE_VALUE setting 's3.client.integration_test_ec2.endpoint', { "${-> fixtureAddress('s3-fixture', 's3-fixture-with-ec2', '80')}" }, IGNORE_VALUE @@ -225,7 +227,7 @@ testClusters.yamlRestTest { if (useFixture) { testFixtures.useFixture(':test:fixtures:minio-fixture', 'minio-fixture') - task yamlRestTestMinio(type: RestIntegTestTask) { + tasks.register("yamlRestTestMinio", RestIntegTestTask) { description = "Runs REST tests using the Minio repository." dependsOn tasks.named("bundlePlugin") SourceSetContainer sourceSets = project.getExtensions().getByType(SourceSetContainer.class); @@ -240,9 +242,9 @@ if (useFixture) { 'repository_s3/50_repository_ecs_credentials/*' ].join(",") } - tasks.named("check").configure { dependsOn(yamlRestTestMinio) } + tasks.named("check").configure { dependsOn("yamlRestTestMinio") } - testClusters.yamlRestTestMinio { + testClusters.matching { it.name == "yamlRestTestMinio" }.configureEach { keystore 's3.client.integration_test_permanent.access_key', s3PermanentAccessKey keystore 's3.client.integration_test_permanent.secret_key', s3PermanentSecretKey setting 's3.client.integration_test_permanent.endpoint', { "${-> fixtureAddress('minio-fixture', 'minio-fixture', '9000')}" }, IGNORE_VALUE @@ -253,7 +255,7 @@ if (useFixture) { // ECS if (useFixture) { testFixtures.useFixture(':test:fixtures:s3-fixture', 's3-fixture-with-ecs') - task yamlRestTestECS(type: RestIntegTestTask.class) { + tasks.register("yamlRestTestECS", RestIntegTestTask.class) { description = "Runs tests using the ECS repository." dependsOn('bundlePlugin') SourceSetContainer sourceSets = project.getExtensions().getByType(SourceSetContainer.class); @@ -267,9 +269,9 @@ if (useFixture) { 'repository_s3/40_repository_ec2_credentials/*' ].join(",") } - tasks.named("check").configure { dependsOn(yamlRestTestECS) } + tasks.named("check").configure { dependsOn("yamlRestTestECS") } - testClusters.yamlRestTestECS { + testClusters.matching { it.name == "yamlRestTestECS" }.configureEach { setting 's3.client.integration_test_ecs.endpoint', { "${-> fixtureAddress('s3-fixture', 's3-fixture-with-ecs', '80')}" }, IGNORE_VALUE plugin tasks.bundlePlugin.archiveFile environment 'AWS_CONTAINER_CREDENTIALS_FULL_URI', { "${-> fixtureAddress('s3-fixture', 's3-fixture-with-ecs', '80')}/ecs_credentials_endpoint" }, IGNORE_VALUE diff --git a/plugins/transport-nio/build.gradle b/plugins/transport-nio/build.gradle index 744a240f60f25..203d18f4d6985 100644 --- a/plugins/transport-nio/build.gradle +++ b/plugins/transport-nio/build.gradle @@ -44,7 +44,7 @@ tasks.named("dependencyLicenses").configure { mapping from: /netty-.*/, to: 'netty' } -thirdPartyAudit { +tasks.named("thirdPartyAudit").configure { ignoreMissingClasses( // from io.netty.handler.codec.protobuf.ProtobufDecoder (netty) 'com.google.protobuf.ExtensionRegistry', diff --git a/qa/build.gradle b/qa/build.gradle index 2fe2d10260171..9012a1e6d4d6c 100644 --- a/qa/build.gradle +++ b/qa/build.gradle @@ -2,7 +2,7 @@ import org.elasticsearch.gradle.test.RestIntegTestTask import org.elasticsearch.gradle.testclusters.TestClustersPlugin subprojects { Project subproj -> - subproj.tasks.withType(RestIntegTestTask) { + subproj.tasks.withType(RestIntegTestTask).configureEach { if (subproj.extensions.findByName("${it.name}Cluster")) { subproj.extensions.configure("${it.name}Cluster") { cluster -> cluster.distribution = System.getProperty('tests.distribution', 'oss') diff --git a/qa/die-with-dignity/build.gradle b/qa/die-with-dignity/build.gradle index 7a612e4553ad8..7818c2935dce3 100644 --- a/qa/die-with-dignity/build.gradle +++ b/qa/die-with-dignity/build.gradle @@ -19,7 +19,7 @@ javaRestTest { systemProperty 'runtime.java.home', BuildParams.runtimeJavaHome } -testClusters.javaRestTest { +testClusters.matching { it.name == "javaRestTest" }.configureEach { systemProperty "die.with.dignity.test", "whatever" } diff --git a/qa/logging-config/build.gradle b/qa/logging-config/build.gradle index 81b4c7fcbd454..0b26ce339ce91 100644 --- a/qa/logging-config/build.gradle +++ b/qa/logging-config/build.gradle @@ -30,11 +30,11 @@ testClusters.integTest { extraConfigFile 'log4j2.properties', file('custom-log4j2.properties') } -integTest { +tasks.named("integTest").configure { nonInputProperties.systemProperty 'tests.logfile', "${-> testClusters.integTest.singleNode().getServerLog().absolutePath.replaceAll(".json", ".log")}" } -test { +tasks.named("test").configure { systemProperty 'tests.security.manager', 'false' } diff --git a/qa/multi-cluster-search/build.gradle b/qa/multi-cluster-search/build.gradle index a0c9a3fd6dec5..e512568c58821 100644 --- a/qa/multi-cluster-search/build.gradle +++ b/qa/multi-cluster-search/build.gradle @@ -27,23 +27,25 @@ dependencies { testImplementation project(":client:rest-high-level") } -task 'remote-cluster'(type: RestIntegTestTask) { +tasks.register('remote-cluster', RestIntegTestTask) { mustRunAfter("precommit") systemProperty 'tests.rest.suite', 'remote_cluster' } -testClusters.'remote-cluster' { - numberOfNodes = 2 - setting 'node.roles', '[data,ingest,master]' +testClusters { + 'remote-cluster' { + numberOfNodes = 2 + setting 'node.roles', '[data,ingest,master]' + } } -task mixedClusterTest(type: RestIntegTestTask) { +tasks.register("mixedClusterTest", RestIntegTestTask) { useCluster testClusters.'remote-cluster' dependsOn 'remote-cluster' systemProperty 'tests.rest.suite', 'multi_cluster' } -testClusters.mixedClusterTest { +testClusters.matching { it.name == "mixedClusterTest"}.configureEach { setting 'cluster.remote.my_remote_cluster.seeds', { "\"${testClusters.'remote-cluster'.getAllTransportPortURI().get(0)}\"" } setting 'cluster.remote.connections_per_cluster', '1' diff --git a/qa/remote-clusters/build.gradle b/qa/remote-clusters/build.gradle index b9fa5f83507ed..010879b79ac6e 100644 --- a/qa/remote-clusters/build.gradle +++ b/qa/remote-clusters/build.gradle @@ -51,7 +51,7 @@ elasticsearch_distributions { } } -preProcessFixture { +tasks.named("preProcessFixture").configure { dependsOn "copyKeystore", elasticsearch_distributions.docker doLast { // tests expect to have an empty repo diff --git a/qa/smoke-test-ingest-with-all-dependencies/build.gradle b/qa/smoke-test-ingest-with-all-dependencies/build.gradle index 234f1aa76fa01..a5f300fa1611f 100644 --- a/qa/smoke-test-ingest-with-all-dependencies/build.gradle +++ b/qa/smoke-test-ingest-with-all-dependencies/build.gradle @@ -30,7 +30,7 @@ dependencies { testImplementation project(':modules:reindex') } -testingConventions { +tasks.named("testingConventions").configure { naming { IT { baseClass 'org.elasticsearch.ingest.AbstractScriptTestCase' diff --git a/qa/smoke-test-plugins/build.gradle b/qa/smoke-test-plugins/build.gradle index 8c3fbe0e7d7bf..c23223fc54287 100644 --- a/qa/smoke-test-plugins/build.gradle +++ b/qa/smoke-test-plugins/build.gradle @@ -25,25 +25,27 @@ apply plugin: 'elasticsearch.standalone-rest-test' apply plugin: 'elasticsearch.rest-test' apply plugin: 'elasticsearch.rest-resources' -int pluginsCount = 0 +ext.pluginPaths = [] +project(':plugins').getChildProjects().each { pluginName, pluginProject -> + if (BuildParams.inFipsJvm && pluginName == "ingest-attachment") { + // Do not attempt to install ingest-attachment in FIPS 140 as it is not supported (it depends on non-FIPS BouncyCastle) + return + } + pluginPaths << pluginProject.path +} -testClusters.integTest { - project(':plugins').getChildProjects().each { pluginName, pluginProject -> - if (BuildParams.inFipsJvm && pluginName == "ingest-attachment"){ - //Do not attempt to install ingest-attachment in FIPS 140 as it is not supported (it depends on non-FIPS BouncyCastle - return - } - plugin pluginProject.path - pluginsCount += 1 +testClusters.matching { it.name == "integTest" }.configureEach { + pluginPaths.each { pluginPath -> + plugin pluginPath } } -assert pluginsCount > 0 ext.expansions = [ - 'expected.plugins.count': pluginsCount + 'expected.plugins.count': pluginPaths.size() ] -processTestResources { +tasks.named("processTestResources").configure { + assert pluginPaths.size() > 0 inputs.properties(expansions) MavenFilteringHack.filter(it, expansions) } diff --git a/test/fixtures/azure-fixture/build.gradle b/test/fixtures/azure-fixture/build.gradle index 8417cc65eda97..97dc75a7cd422 100644 --- a/test/fixtures/azure-fixture/build.gradle +++ b/test/fixtures/azure-fixture/build.gradle @@ -20,14 +20,14 @@ apply plugin: 'elasticsearch.java' apply plugin: 'elasticsearch.test.fixtures' description = 'Fixture for Azure external service' -test.enabled = false +tasks.named("test").configure { enabled = false } dependencies { api project(':server') } -preProcessFixture { - dependsOn jar, configurations.runtimeClasspath +tasks.named("preProcessFixture").configure { + dependsOn "jar", configurations.runtimeClasspath doLast { file("${testFixturesDir}/shared").mkdirs() project.copy { diff --git a/test/fixtures/gcs-fixture/build.gradle b/test/fixtures/gcs-fixture/build.gradle index 80cbed98a060d..24feeb915e203 100644 --- a/test/fixtures/gcs-fixture/build.gradle +++ b/test/fixtures/gcs-fixture/build.gradle @@ -20,7 +20,7 @@ apply plugin: 'elasticsearch.java' apply plugin: 'elasticsearch.test.fixtures' description = 'Fixture for Google Cloud Storage service' -test.enabled = false +tasks.named("test").configure { enabled = false } dependencies { api project(':server') diff --git a/test/fixtures/krb5kdc-fixture/build.gradle b/test/fixtures/krb5kdc-fixture/build.gradle index 6df66da877bd8..eef608e91b330 100644 --- a/test/fixtures/krb5kdc-fixture/build.gradle +++ b/test/fixtures/krb5kdc-fixture/build.gradle @@ -20,13 +20,15 @@ apply plugin: 'elasticsearch.test.fixtures' List services = ["peppa", "hdfs"] -preProcessFixture.doLast { - // We need to create these up-front because if docker creates them they will be owned by root and we won't be - // able to clean them up - services.each { file("${testFixturesDir}/shared/${it}").mkdirs() } +tasks.named("preProcessFixture").configure { + doLast { + // We need to create these up-front because if docker creates them they will be owned by root and we won't be + // able to clean them up + services.each { file("${testFixturesDir}/shared/${it}").mkdirs() } + } } -postProcessFixture { +tasks.named("postProcessFixture").configure { inputs.dir("${testFixturesDir}/shared") services.each { service -> File confTemplate = file("${testFixturesDir}/shared/${service}/krb5.conf.template") diff --git a/test/fixtures/old-elasticsearch/build.gradle b/test/fixtures/old-elasticsearch/build.gradle index 609786ec05eae..fcde8f40b2fc5 100644 --- a/test/fixtures/old-elasticsearch/build.gradle +++ b/test/fixtures/old-elasticsearch/build.gradle @@ -24,7 +24,7 @@ a "ports" file with the port on which Elasticsearch is running. """ apply plugin: 'elasticsearch.java' -test.enabled = false +tasks.named("test").configure { enabled = false } dependencies { // Just for the constants.... diff --git a/test/fixtures/s3-fixture/build.gradle b/test/fixtures/s3-fixture/build.gradle index 953b30dfb419b..5ce4a935833e3 100644 --- a/test/fixtures/s3-fixture/build.gradle +++ b/test/fixtures/s3-fixture/build.gradle @@ -20,14 +20,14 @@ apply plugin: 'elasticsearch.java' apply plugin: 'elasticsearch.test.fixtures' description = 'Fixture for S3 Storage service' -test.enabled = false +tasks.named("test").configure { enabled = false } dependencies { api project(':server') } -preProcessFixture { - dependsOn jar, configurations.runtimeClasspath +tasks.named("preProcessFixture").configure { + dependsOn "jar", configurations.runtimeClasspath doLast { file("${testFixturesDir}/shared").mkdirs() project.copy { diff --git a/x-pack/docs/build.gradle b/x-pack/docs/build.gradle index b23208a21d3bb..26b089c56628e 100644 --- a/x-pack/docs/build.gradle +++ b/x-pack/docs/build.gradle @@ -66,19 +66,20 @@ testClusters.integTest { user username: 'test_admin' } +tasks.named("buildRestTests").configure { buildRestTests -> -buildRestTests.docs = fileTree(projectDir) { - // No snippets in here! - exclude 'build.gradle' - // That is where the snippets go, not where they come from! - exclude 'build' - // These file simply doesn't pass yet. We should figure out how to fix them. - exclude 'en/watcher/reference/actions.asciidoc' - exclude 'en/rest-api/security/ssl.asciidoc' -} + buildRestTests.docs = fileTree(projectDir) { + // No snippets in here! + exclude 'build.gradle' + // That is where the snippets go, not where they come from! + exclude 'build' + // These file simply doesn't pass yet. We should figure out how to fix them. + exclude 'en/watcher/reference/actions.asciidoc' + exclude 'en/rest-api/security/ssl.asciidoc' + } -Map setups = buildRestTests.setups -setups['my_inactive_watch'] = ''' + Map setups = buildRestTests.setups + setups['my_inactive_watch'] = ''' - do: watcher.put_watch: id: "my_watch" @@ -112,11 +113,11 @@ setups['my_inactive_watch'] = ''' } - match: { _id: "my_watch" } ''' -setups['my_active_watch'] = setups['my_inactive_watch'].replace( - 'active: false', 'active: true') + setups['my_active_watch'] = setups['my_inactive_watch'].replace( + 'active: false', 'active: true') // Used by SQL because it looks SQL-ish -setups['library'] = ''' + setups['library'] = ''' - do: indices.create: index: library @@ -197,7 +198,7 @@ setups['library'] = ''' {"name": "The Moon is a Harsh Mistress", "author": "Robert A. Heinlein", "release_date": "1966-04-01", "page_count": 288} ''' -setups['sample_job'] = ''' + setups['sample_job'] = ''' - do: ml.put_job: job_id: "sample_job" @@ -217,7 +218,7 @@ setups['sample_job'] = ''' } } ''' -setups['farequote_index'] = ''' + setups['farequote_index'] = ''' - do: indices.create: index: farequote @@ -237,7 +238,7 @@ setups['farequote_index'] = ''' doc_count: type: integer ''' -setups['farequote_data'] = setups['farequote_index'] + ''' + setups['farequote_data'] = setups['farequote_index'] + ''' - do: bulk: index: farequote @@ -251,7 +252,7 @@ setups['farequote_data'] = setups['farequote_index'] + ''' {"index": {"_id":"3"}} {"airline":"KLM","responsetime":1355.4812,"time":"2016-02-07T00:00:00+0000", "doc_count": 42} ''' -setups['farequote_job'] = setups['farequote_data'] + ''' + setups['farequote_job'] = setups['farequote_data'] + ''' - do: ml.put_job: job_id: "farequote" @@ -271,7 +272,7 @@ setups['farequote_job'] = setups['farequote_data'] + ''' } } ''' -setups['farequote_datafeed'] = setups['farequote_job'] + ''' + setups['farequote_datafeed'] = setups['farequote_job'] + ''' - do: ml.put_datafeed: datafeed_id: "datafeed-farequote" @@ -281,7 +282,7 @@ setups['farequote_datafeed'] = setups['farequote_job'] + ''' "indexes":"farequote" } ''' -setups['ml_filter_safe_domains'] = ''' + setups['ml_filter_safe_domains'] = ''' - do: ml.put_filter: filter_id: "safe_domains" @@ -291,7 +292,7 @@ setups['ml_filter_safe_domains'] = ''' "items": ["*.google.com", "wikipedia.org"] } ''' -setups['server_metrics_index'] = ''' + setups['server_metrics_index'] = ''' - do: indices.create: index: server-metrics @@ -307,7 +308,7 @@ setups['server_metrics_index'] = ''' total: type: long ''' -setups['server_metrics_data'] = setups['server_metrics_index'] + ''' + setups['server_metrics_data'] = setups['server_metrics_index'] + ''' - do: bulk: index: server-metrics @@ -345,7 +346,7 @@ setups['server_metrics_data'] = setups['server_metrics_index'] + ''' {"index": {"_id":"1191"}} {"timestamp":"2017-03-23T13:00:00","total":31659} ''' -setups['server_metrics_job'] = setups['server_metrics_data'] + ''' + setups['server_metrics_job'] = setups['server_metrics_data'] + ''' - do: ml.put_job: job_id: "total-requests" @@ -367,7 +368,7 @@ setups['server_metrics_job'] = setups['server_metrics_data'] + ''' } } ''' -setups['server_metrics_datafeed'] = setups['server_metrics_job'] + ''' + setups['server_metrics_datafeed'] = setups['server_metrics_job'] + ''' - do: ml.put_datafeed: datafeed_id: "datafeed-total-requests" @@ -377,22 +378,22 @@ setups['server_metrics_datafeed'] = setups['server_metrics_job'] + ''' "indexes":"server-metrics" } ''' -setups['server_metrics_openjob'] = setups['server_metrics_datafeed'] + ''' + setups['server_metrics_openjob'] = setups['server_metrics_datafeed'] + ''' - do: ml.open_job: job_id: "total-requests" ''' -setups['server_metrics_startdf'] = setups['server_metrics_openjob'] + ''' + setups['server_metrics_startdf'] = setups['server_metrics_openjob'] + ''' - do: ml.start_datafeed: datafeed_id: "datafeed-total-requests" ''' -setups['calendar_outages'] = ''' + setups['calendar_outages'] = ''' - do: ml.put_calendar: calendar_id: "planned-outages" ''' -setups['calendar_outages_addevent'] = setups['calendar_outages'] + ''' + setups['calendar_outages_addevent'] = setups['calendar_outages'] + ''' - do: ml.post_calendar_events: calendar_id: "planned-outages" @@ -401,12 +402,12 @@ setups['calendar_outages_addevent'] = setups['calendar_outages'] + ''' ''' -setups['calendar_outages_openjob'] = setups['server_metrics_openjob'] + ''' + setups['calendar_outages_openjob'] = setups['server_metrics_openjob'] + ''' - do: ml.put_calendar: calendar_id: "planned-outages" ''' -setups['calendar_outages_addjob'] = setups['server_metrics_openjob'] + ''' + setups['calendar_outages_addjob'] = setups['server_metrics_openjob'] + ''' - do: ml.put_calendar: calendar_id: "planned-outages" @@ -415,7 +416,7 @@ setups['calendar_outages_addjob'] = setups['server_metrics_openjob'] + ''' "job_ids": ["total-requests"] } ''' -setups['calendar_outages_addevent'] = setups['calendar_outages_addjob'] + ''' + setups['calendar_outages_addevent'] = setups['calendar_outages_addjob'] + ''' - do: ml.post_calendar_events: calendar_id: "planned-outages" @@ -426,7 +427,7 @@ setups['calendar_outages_addevent'] = setups['calendar_outages_addjob'] + ''' { "description": "event 3", "start_time": "1514160000000", "end_time": "1514246400000"} ]} ''' -setups['role_mapping'] = ''' + setups['role_mapping'] = ''' - do: security.put_role_mapping: name: "mapping1" @@ -437,7 +438,7 @@ setups['role_mapping'] = ''' "rules": { "field": { "username": "*" } } } ''' -setups['sensor_rollup_job'] = ''' + setups['sensor_rollup_job'] = ''' - do: indices.create: index: sensor-1 @@ -486,7 +487,7 @@ setups['sensor_rollup_job'] = ''' ] } ''' -setups['sensor_started_rollup_job'] = ''' + setups['sensor_started_rollup_job'] = ''' - do: indices.create: index: sensor-1 @@ -558,7 +559,7 @@ setups['sensor_started_rollup_job'] = ''' id: "sensor" ''' -setups['sensor_index'] = ''' + setups['sensor_index'] = ''' - do: indices.create: index: sensor-1 @@ -588,7 +589,7 @@ setups['sensor_index'] = ''' type: keyword ''' -setups['sensor_prefab_data'] = ''' + setups['sensor_prefab_data'] = ''' - do: indices.create: index: sensor-1 @@ -685,7 +686,7 @@ setups['sensor_prefab_data'] = ''' {"node.terms.value":"c","temperature.sum.value":202.0,"temperature.max.value":202.0,"timestamp.date_histogram.time_zone":"UTC","temperature.min.value":202.0,"timestamp.date_histogram._count":1,"timestamp.date_histogram.interval":"1h","_rollup.computed":["temperature.sum","temperature.min","voltage.avg","temperature.max","node.terms","timestamp.date_histogram"],"voltage.avg.value":4.0,"node.terms._count":1,"_rollup.version":1,"timestamp.date_histogram.timestamp":1516294800000,"voltage.avg._count":1.0,"_rollup.id":"sensor"} ''' -setups['admin_role'] = ''' + setups['admin_role'] = ''' - do: security.put_role: name: "my_admin_role" @@ -699,7 +700,7 @@ setups['admin_role'] = ''' "metadata" : {"version": 1} } ''' -setups['jacknich_user'] = ''' + setups['jacknich_user'] = ''' - do: security.put_user: username: "jacknich" @@ -712,7 +713,7 @@ setups['jacknich_user'] = ''' "metadata" : { "intelligence" : 7 } } ''' -setups['app0102_privileges'] = ''' + setups['app0102_privileges'] = ''' - do: security.put_privileges: body: > @@ -731,3 +732,4 @@ setups['app0102_privileges'] = ''' } } ''' +} \ No newline at end of file diff --git a/x-pack/license-tools/build.gradle b/x-pack/license-tools/build.gradle index 0270db3eacc44..ccbab7dd7d132 100644 --- a/x-pack/license-tools/build.gradle +++ b/x-pack/license-tools/build.gradle @@ -6,7 +6,7 @@ dependencies { testImplementation project(':test:framework') } -project.forbiddenPatterns { +tasks.named("forbiddenPatterns").configure { exclude '**/*.key' } diff --git a/x-pack/plugin/analytics/build.gradle b/x-pack/plugin/analytics/build.gradle index d0998aa12d757..2789cb206336c 100644 --- a/x-pack/plugin/analytics/build.gradle +++ b/x-pack/plugin/analytics/build.gradle @@ -7,9 +7,9 @@ esplugin { } archivesBaseName = 'x-pack-analytics' -compileJava.options.compilerArgs << "-Xlint:-rawtypes" -compileTestJava.options.compilerArgs << "-Xlint:-rawtypes" - +tasks.withType(JavaCompile).configureEach { + options.compilerArgs << "-Xlint:-rawtypes" +} dependencies { compileOnly project(":server") diff --git a/x-pack/plugin/async-search/build.gradle b/x-pack/plugin/async-search/build.gradle index db2e986a7f46a..f1199a0a1227a 100644 --- a/x-pack/plugin/async-search/build.gradle +++ b/x-pack/plugin/async-search/build.gradle @@ -8,8 +8,9 @@ esplugin { } archivesBaseName = 'x-pack-async-search' -compileJava.options.compilerArgs << "-Xlint:-rawtypes" -compileTestJava.options.compilerArgs << "-Xlint:-rawtypes" +tasks.withType(JavaCompile).configureEach { + options.compilerArgs << "-Xlint:-rawtypes" +} addQaCheckDependencies() diff --git a/x-pack/plugin/async-search/qa/build.gradle b/x-pack/plugin/async-search/qa/build.gradle index 75d524cc11500..c4a938d61ebe4 100644 --- a/x-pack/plugin/async-search/qa/build.gradle +++ b/x-pack/plugin/async-search/qa/build.gradle @@ -1,7 +1,7 @@ import org.elasticsearch.gradle.test.RestIntegTestTask apply plugin: 'elasticsearch.build' -test.enabled = false +tasks.named("test").configure { enabled = false } dependencies { api project(':test:framework') diff --git a/x-pack/plugin/async-search/qa/rest/build.gradle b/x-pack/plugin/async-search/qa/rest/build.gradle index 07a5e26cdaf9b..5aa480c0e1b43 100644 --- a/x-pack/plugin/async-search/qa/rest/build.gradle +++ b/x-pack/plugin/async-search/qa/rest/build.gradle @@ -19,4 +19,4 @@ testClusters.all { setting 'xpack.security.enabled', 'false' } -test.enabled = false +tasks.named("test").configure { enabled = false } diff --git a/x-pack/plugin/autoscaling/qa/build.gradle b/x-pack/plugin/autoscaling/qa/build.gradle index 53a1915bb2a07..72cd4bba91169 100644 --- a/x-pack/plugin/autoscaling/qa/build.gradle +++ b/x-pack/plugin/autoscaling/qa/build.gradle @@ -1,5 +1,5 @@ apply plugin: 'elasticsearch.build' -test.enabled = false +tasks.named("test").configure { enabled = false } dependencies { api project(':test:framework') diff --git a/x-pack/plugin/build.gradle b/x-pack/plugin/build.gradle index 32331e637da12..7d5ffca692829 100644 --- a/x-pack/plugin/build.gradle +++ b/x-pack/plugin/build.gradle @@ -129,7 +129,7 @@ tasks.named("processJavaRestTestResources").configure { dependsOn("copyKeyCerts") } -yamlRestTest { +tasks.named("yamlRestTest").configure { /* * We have to disable setting the number of available processors as tests in the same JVM randomize processors and will step on each * other if we allow them to set the number of available processors as it's set-once in Netty. diff --git a/x-pack/plugin/ccr/qa/build.gradle b/x-pack/plugin/ccr/qa/build.gradle index 53a1915bb2a07..72cd4bba91169 100644 --- a/x-pack/plugin/ccr/qa/build.gradle +++ b/x-pack/plugin/ccr/qa/build.gradle @@ -1,5 +1,5 @@ apply plugin: 'elasticsearch.build' -test.enabled = false +tasks.named("test").configure { enabled = false } dependencies { api project(':test:framework') diff --git a/x-pack/plugin/ccr/qa/multi-cluster/build.gradle b/x-pack/plugin/ccr/qa/multi-cluster/build.gradle index 0e24997a4b872..43c66652070f5 100644 --- a/x-pack/plugin/ccr/qa/multi-cluster/build.gradle +++ b/x-pack/plugin/ccr/qa/multi-cluster/build.gradle @@ -56,4 +56,4 @@ testClusters."follow-cluster" { } check.dependsOn "follow-cluster" -test.enabled = false // no unit tests for multi-cluster-search, only the rest integration test +tasks.named("test").configure { enabled = false } // no unit tests for multi-cluster-search, only the rest integration test diff --git a/x-pack/plugin/ccr/qa/restart/build.gradle b/x-pack/plugin/ccr/qa/restart/build.gradle index 9d214aeac6c86..7135b8f1ddd0e 100644 --- a/x-pack/plugin/ccr/qa/restart/build.gradle +++ b/x-pack/plugin/ccr/qa/restart/build.gradle @@ -48,4 +48,4 @@ task followClusterRestartTest(type: StandaloneRestIntegTestTask) { } check.dependsOn followClusterRestartTest -test.enabled = false +tasks.named("test").configure { enabled = false } diff --git a/x-pack/plugin/data-streams/qa/multi-node/build.gradle b/x-pack/plugin/data-streams/qa/multi-node/build.gradle index 356b8b3043306..7fe5f9b4961f1 100644 --- a/x-pack/plugin/data-streams/qa/multi-node/build.gradle +++ b/x-pack/plugin/data-streams/qa/multi-node/build.gradle @@ -2,12 +2,12 @@ apply plugin: 'elasticsearch.java-rest-test' File repoDir = file("$buildDir/testclusters/repo") -javaRestTest { +tasks.named("javaRestTest").configure { /* To support taking index snapshots, we have to set path.repo setting */ systemProperty 'tests.path.repo', repoDir } -testClusters.javaRestTest { +testClusters.matching { it.name == "javaRestTest" }.configureEach { testDistribution = 'DEFAULT' numberOfNodes = 4 diff --git a/x-pack/plugin/enrich/qa/build.gradle b/x-pack/plugin/enrich/qa/build.gradle index 75d524cc11500..c4a938d61ebe4 100644 --- a/x-pack/plugin/enrich/qa/build.gradle +++ b/x-pack/plugin/enrich/qa/build.gradle @@ -1,7 +1,7 @@ import org.elasticsearch.gradle.test.RestIntegTestTask apply plugin: 'elasticsearch.build' -test.enabled = false +tasks.named("test").configure { enabled = false } dependencies { api project(':test:framework') diff --git a/x-pack/plugin/enrich/qa/common/build.gradle b/x-pack/plugin/enrich/qa/common/build.gradle index 53a1915bb2a07..72cd4bba91169 100644 --- a/x-pack/plugin/enrich/qa/common/build.gradle +++ b/x-pack/plugin/enrich/qa/common/build.gradle @@ -1,5 +1,5 @@ apply plugin: 'elasticsearch.build' -test.enabled = false +tasks.named("test").configure { enabled = false } dependencies { api project(':test:framework') diff --git a/x-pack/plugin/eql/qa/build.gradle b/x-pack/plugin/eql/qa/build.gradle index 75d524cc11500..c4a938d61ebe4 100644 --- a/x-pack/plugin/eql/qa/build.gradle +++ b/x-pack/plugin/eql/qa/build.gradle @@ -1,7 +1,7 @@ import org.elasticsearch.gradle.test.RestIntegTestTask apply plugin: 'elasticsearch.build' -test.enabled = false +tasks.named("test").configure { enabled = false } dependencies { api project(':test:framework') diff --git a/x-pack/plugin/eql/qa/common/build.gradle b/x-pack/plugin/eql/qa/common/build.gradle index a51efd3db8869..7d9baf42b3198 100644 --- a/x-pack/plugin/eql/qa/common/build.gradle +++ b/x-pack/plugin/eql/qa/common/build.gradle @@ -1,5 +1,5 @@ apply plugin: 'elasticsearch.build' -test.enabled = false +tasks.named("test").configure { enabled = false } dependencies { api project(':test:framework') diff --git a/x-pack/plugin/eql/qa/correctness/build.gradle b/x-pack/plugin/eql/qa/correctness/build.gradle index 9989b41a70dd5..e618265b2638b 100644 --- a/x-pack/plugin/eql/qa/correctness/build.gradle +++ b/x-pack/plugin/eql/qa/correctness/build.gradle @@ -1,7 +1,7 @@ apply plugin: 'elasticsearch.java-rest-test' apply plugin: 'elasticsearch.build' apply plugin: 'elasticsearch.testclusters' -test.enabled = false +tasks.named("test").configure { enabled = false } import org.elasticsearch.gradle.testclusters.RunTask diff --git a/x-pack/plugin/ilm/qa/multi-node/build.gradle b/x-pack/plugin/ilm/qa/multi-node/build.gradle index 50b2fed425949..b70f334d62cbe 100644 --- a/x-pack/plugin/ilm/qa/multi-node/build.gradle +++ b/x-pack/plugin/ilm/qa/multi-node/build.gradle @@ -12,7 +12,7 @@ GradleUtils.extendSourceSet(project, "main", "javaRestTest", javaRestTest) File repoDir = file("$buildDir/testclusters/repo") -javaRestTest { +tasks.named("javaRestTest").configure { /* To support taking index snapshots, we have to set path.repo setting */ systemProperty 'tests.path.repo', repoDir } diff --git a/x-pack/plugin/ilm/qa/with-security/build.gradle b/x-pack/plugin/ilm/qa/with-security/build.gradle index 21878cff4a070..aac8e9c7428d1 100644 --- a/x-pack/plugin/ilm/qa/with-security/build.gradle +++ b/x-pack/plugin/ilm/qa/with-security/build.gradle @@ -9,7 +9,7 @@ dependencies { def clusterCredentials = [username: System.getProperty('tests.rest.cluster.username', 'test_admin'), password: System.getProperty('tests.rest.cluster.password', 'x-pack-test-password')] -javaRestTest { +tasks.named("javaRestTest").configure { systemProperty 'tests.rest.cluster.username', clusterCredentials.username systemProperty 'tests.rest.cluster.password', clusterCredentials.password } diff --git a/x-pack/plugin/ingest/build.gradle b/x-pack/plugin/ingest/build.gradle index a6eae042e1a49..0c8203f9c27fa 100644 --- a/x-pack/plugin/ingest/build.gradle +++ b/x-pack/plugin/ingest/build.gradle @@ -39,4 +39,4 @@ dependencies { addQaCheckDependencies() -testingConventions.enabled = false +tasks.named("testingConventions").configure { enabled = false } diff --git a/x-pack/plugin/ml/build.gradle b/x-pack/plugin/ml/build.gradle index f49382ce0c000..ce6378d420337 100644 --- a/x-pack/plugin/ml/build.gradle +++ b/x-pack/plugin/ml/build.gradle @@ -34,7 +34,7 @@ configurations { } } -bundlePlugin { +tasks.named("bundlePlugin").configure { dependsOn configurations.nativeBundle from { project.zipTree(configurations.nativeBundle.singleFile) diff --git a/x-pack/plugin/ml/qa/ml-with-security/build.gradle b/x-pack/plugin/ml/qa/ml-with-security/build.gradle index 09148f6da5459..536139110b51a 100644 --- a/x-pack/plugin/ml/qa/ml-with-security/build.gradle +++ b/x-pack/plugin/ml/qa/ml-with-security/build.gradle @@ -17,7 +17,7 @@ restResources { } } -yamlRestTest { +tasks.named("yamlRestTest").configure { systemProperty 'tests.rest.blacklist', [ // Remove this test because it doesn't call an ML endpoint and we don't want // to grant extra permissions to the users used in this test suite diff --git a/x-pack/plugin/ml/qa/native-multi-node-tests/build.gradle b/x-pack/plugin/ml/qa/native-multi-node-tests/build.gradle index f8c92b852799f..b20cbfed485a2 100644 --- a/x-pack/plugin/ml/qa/native-multi-node-tests/build.gradle +++ b/x-pack/plugin/ml/qa/native-multi-node-tests/build.gradle @@ -25,7 +25,7 @@ tasks.register("copyKeyCerts", Copy) { sourceSets.javaRestTest.resources.srcDir(keystoreDir) tasks.named("processJavaRestTestResources").configure { dependsOn("copyKeyCerts") } -javaRestTest { +tasks.named("javaRestTest").configure { dependsOn "copyKeyCerts" /* * We have to disable setting the number of available processors as tests in the same JVM randomize processors and will step on each diff --git a/x-pack/plugin/ql/test/build.gradle b/x-pack/plugin/ql/test/build.gradle index c5bc274c7f649..fa33110bc892c 100644 --- a/x-pack/plugin/ql/test/build.gradle +++ b/x-pack/plugin/ql/test/build.gradle @@ -11,4 +11,4 @@ dependencies { api project(':test:framework') } -test.enabled = false +tasks.named("test").configure { enabled = false } diff --git a/x-pack/plugin/repositories-metering-api/qa/azure/build.gradle b/x-pack/plugin/repositories-metering-api/qa/azure/build.gradle index 560d6fad19364..baa578fe3c693 100644 --- a/x-pack/plugin/repositories-metering-api/qa/azure/build.gradle +++ b/x-pack/plugin/repositories-metering-api/qa/azure/build.gradle @@ -60,15 +60,15 @@ if (useFixture) { testFixtures.useFixture(fixture.path, 'azure-fixture-repositories-metering') } -integTest { - dependsOn repositoryPlugin.bundlePlugin +tasks.named("integTest") { + dependsOn ":plugins:repository-azure:bundlePlugin" systemProperty 'test.azure.container', azureContainer nonInputProperties.systemProperty 'test.azure.base_path', azureBasePath + "_repositories_metering_tests_" + BuildParams.testSeed } testClusters.integTest { testDistribution = 'DEFAULT' - plugin repositoryPlugin.bundlePlugin.archiveFile + plugin ":plugins:repository-azure" keystore 'azure.client.repositories_metering.account', azureAccount if (azureKey != null && azureKey.isEmpty() == false) { @@ -93,7 +93,7 @@ testClusters.integTest { } } -task azureThirdPartyTest { - dependsOn integTest +tasks.register("azureThirdPartyTest") { + dependsOn "integTest" } diff --git a/x-pack/plugin/repositories-metering-api/qa/build.gradle b/x-pack/plugin/repositories-metering-api/qa/build.gradle index 53a1915bb2a07..72cd4bba91169 100644 --- a/x-pack/plugin/repositories-metering-api/qa/build.gradle +++ b/x-pack/plugin/repositories-metering-api/qa/build.gradle @@ -1,5 +1,5 @@ apply plugin: 'elasticsearch.build' -test.enabled = false +tasks.named("test").configure { enabled = false } dependencies { api project(':test:framework') diff --git a/x-pack/plugin/repositories-metering-api/qa/gcs/build.gradle b/x-pack/plugin/repositories-metering-api/qa/gcs/build.gradle index 9de6417051a1e..e3284ce5c68ba 100644 --- a/x-pack/plugin/repositories-metering-api/qa/gcs/build.gradle +++ b/x-pack/plugin/repositories-metering-api/qa/gcs/build.gradle @@ -63,7 +63,7 @@ if (!gcsServiceAccount && !gcsBucket && !gcsBasePath) { } /** A service account file that points to the Google Cloud Storage service emulated by the fixture **/ -task createServiceAccountFile() { +tasks.register("createServiceAccountFile") { doLast { KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance("RSA") keyPairGenerator.initialize(1024) @@ -104,8 +104,11 @@ if (useFixture) { testFixtures.useFixture(fixture.path, 'gcs-fixture-repositories-metering') } -integTest { +tasks.named("integTest").configure { dependsOn ":plugins:repository-gcs:bundlePlugin" + if (useFixture) { + dependsOn "createServiceAccountFile" + } systemProperty 'test.gcs.bucket', gcsBucket nonInputProperties.systemProperty 'test.gcs.base_path', gcsBasePath + "_repositories_metering" + BuildParams.testSeed } @@ -116,7 +119,6 @@ testClusters.integTest { keystore 'gcs.client.repositories_metering.credentials_file', serviceAccountFile, IGNORE_VALUE if (useFixture) { - tasks.integTest.dependsOn createServiceAccountFile /* Use a closure on the string to delay evaluation until tests are executed */ setting 'gcs.client.repositories_metering.endpoint', { "${-> fixtureAddress('gcs-fixture-repositories-metering')}" }, IGNORE_VALUE setting 'gcs.client.repositories_metering.token_uri', { "${-> fixtureAddress('gcs-fixture-repositories-metering')}/o/oauth2/token" }, IGNORE_VALUE diff --git a/x-pack/plugin/repositories-metering-api/qa/s3/build.gradle b/x-pack/plugin/repositories-metering-api/qa/s3/build.gradle index 63e2d46bb0321..26b9a88f7a4c3 100644 --- a/x-pack/plugin/repositories-metering-api/qa/s3/build.gradle +++ b/x-pack/plugin/repositories-metering-api/qa/s3/build.gradle @@ -42,15 +42,15 @@ if (useFixture) { testFixtures.useFixture(fixture.path, 's3-fixture-repositories-metering') } -integTest { - dependsOn repositoryPlugin.bundlePlugin +tasks.named("integTest").configure { + dependsOn ':plugins:repository-s3:bundlePlugin' systemProperty 'test.s3.bucket', s3Bucket nonInputProperties.systemProperty 'test.s3.base_path', s3BasePath ? s3BasePath + "_repositories_metering" + BuildParams.testSeed : 'base_path' } testClusters.integTest { testDistribution = 'DEFAULT' - plugin repositoryPlugin.bundlePlugin.archiveFile + plugin ':plugins:repository-s3' keystore 's3.client.repositories_metering.access_key', s3AccessKey keystore 's3.client.repositories_metering.secret_key', s3SecretKey @@ -70,6 +70,6 @@ testClusters.integTest { } } -task s3ThirdPartyTest { - dependsOn integTest -} +tasks.register("s3ThirdPartyTest").configure { + dependsOn "integTest" +} \ No newline at end of file diff --git a/x-pack/plugin/rollup/build.gradle b/x-pack/plugin/rollup/build.gradle index 9e8e98ab91773..6d62a1666ebcf 100644 --- a/x-pack/plugin/rollup/build.gradle +++ b/x-pack/plugin/rollup/build.gradle @@ -17,15 +17,8 @@ dependencies { testImplementation project(path: xpackModule('core'), configuration: 'testArtifacts') } -// add all sub-projects of the qa sub-project -gradle.projectsEvaluated { - project.subprojects - .find { it.path == project.path + ":qa" } - .subprojects - .findAll { it.path.startsWith(project.path + ":qa") } - .each { check.dependsOn it.check } -} +addQaCheckDependencies() -test { +tasks.named("test").configure { systemProperty 'es.rollup_v2_feature_flag_enabled', 'true' } diff --git a/x-pack/plugin/rollup/qa/build.gradle b/x-pack/plugin/rollup/qa/build.gradle index 29f9d37d09c40..9acd352c294ae 100644 --- a/x-pack/plugin/rollup/qa/build.gradle +++ b/x-pack/plugin/rollup/qa/build.gradle @@ -8,7 +8,7 @@ import org.elasticsearch.gradle.test.RestIntegTestTask apply plugin: 'elasticsearch.build' -test.enabled = false +tasks.named("test").configure { enabled = false } dependencies { api project(':test:framework') diff --git a/x-pack/plugin/runtime-fields/build.gradle b/x-pack/plugin/runtime-fields/build.gradle index 6e1f92b112225..d85effefc7fd1 100644 --- a/x-pack/plugin/runtime-fields/build.gradle +++ b/x-pack/plugin/runtime-fields/build.gradle @@ -8,8 +8,9 @@ esplugin { } archivesBaseName = 'x-pack-runtime-fields' -compileJava.options.compilerArgs << "-Xlint:-rawtypes" -compileTestJava.options.compilerArgs << "-Xlint:-rawtypes" +tasks.withType(JavaCompile).configureEach { + options.compilerArgs << "-Xlint:-rawtypes" +} dependencies { compileOnly project(":server") @@ -17,7 +18,7 @@ dependencies { compileOnly project(path: xpackModule('core'), configuration: 'default') } -dependencyLicenses { +tasks.named("dependencyLicenses").configure { ignoreSha 'x-pack-core' } diff --git a/x-pack/plugin/runtime-fields/qa/build.gradle b/x-pack/plugin/runtime-fields/qa/build.gradle index 9fd5e0e62ecf7..527a0b71c4f53 100644 --- a/x-pack/plugin/runtime-fields/qa/build.gradle +++ b/x-pack/plugin/runtime-fields/qa/build.gradle @@ -27,12 +27,12 @@ subprojects { } } - testClusters.yamlRestTest { + testClusters.matching { it.name == "yamlRestTest" }.configureEach { testDistribution = 'DEFAULT' setting 'xpack.license.self_generated.type', 'trial' } - yamlRestTest { + tasks.named("yamlRestTest").configure { def suites = [ 'async_search', 'search', @@ -44,7 +44,7 @@ subprojects { ] if (project.name.equals('core-with-mapped')) { //disabled until runtime fields can be created from a dynamic template - yamlRestTest.enabled = false + enabled = false suites += [ // These two don't support runtime fields on the request. Should they? 'field_caps', diff --git a/x-pack/plugin/runtime-fields/qa/with-security/build.gradle b/x-pack/plugin/runtime-fields/qa/with-security/build.gradle index e4c280e9e8303..1d1a33c90fea3 100644 --- a/x-pack/plugin/runtime-fields/qa/with-security/build.gradle +++ b/x-pack/plugin/runtime-fields/qa/with-security/build.gradle @@ -8,7 +8,7 @@ dependencies { def clusterCredentials = [username: System.getProperty('tests.rest.cluster.username', 'test_admin'), password: System.getProperty('tests.rest.cluster.password', 'x-pack-test-password')] -javaRestTest { +tasks.named("javaRestTest").configure { systemProperty 'tests.rest.cluster.username', clusterCredentials.username systemProperty 'tests.rest.cluster.password', clusterCredentials.password } diff --git a/x-pack/plugin/searchable-snapshots/qa/azure/build.gradle b/x-pack/plugin/searchable-snapshots/qa/azure/build.gradle index e7918009a9f42..1305052ff7c5b 100644 --- a/x-pack/plugin/searchable-snapshots/qa/azure/build.gradle +++ b/x-pack/plugin/searchable-snapshots/qa/azure/build.gradle @@ -42,7 +42,7 @@ if (useFixture) { testFixtures.useFixture(fixture.path, 'azure-fixture-other') } -integTest { +tasks.named("integTest").configure { systemProperty 'test.azure.container', azureContainer nonInputProperties.systemProperty 'test.azure.base_path', azureBasePath + "_searchable_snapshots_tests_" + BuildParams.testSeed } diff --git a/x-pack/plugin/searchable-snapshots/qa/build.gradle b/x-pack/plugin/searchable-snapshots/qa/build.gradle index 53a1915bb2a07..72cd4bba91169 100644 --- a/x-pack/plugin/searchable-snapshots/qa/build.gradle +++ b/x-pack/plugin/searchable-snapshots/qa/build.gradle @@ -1,5 +1,5 @@ apply plugin: 'elasticsearch.build' -test.enabled = false +tasks.named("test").configure { enabled = false } dependencies { api project(':test:framework') diff --git a/x-pack/plugin/searchable-snapshots/qa/gcs/build.gradle b/x-pack/plugin/searchable-snapshots/qa/gcs/build.gradle index 8faee373d9254..7e0c961a720ce 100644 --- a/x-pack/plugin/searchable-snapshots/qa/gcs/build.gradle +++ b/x-pack/plugin/searchable-snapshots/qa/gcs/build.gradle @@ -76,7 +76,7 @@ Map expansions = [ 'base_path': gcsBasePath + "_integration_tests" ] -processTestResources { +tasks.named("processTestResources").configure { inputs.properties(expansions) MavenFilteringHack.filter(it, expansions) } @@ -86,9 +86,13 @@ if (useFixture) { testFixtures.useFixture(fixture.path, 'gcs-fixture-other') } -integTest { +tasks.named("integTest").configure { systemProperty 'test.gcs.bucket', gcsBucket nonInputProperties.systemProperty 'test.gcs.base_path', gcsBasePath + "_searchable_snapshots_tests" + BuildParams.testSeed + + if (useFixture) { + dependsOn "createServiceAccountFile" + } } testClusters.integTest { @@ -97,7 +101,6 @@ testClusters.integTest { keystore 'gcs.client.searchable_snapshots.credentials_file', serviceAccountFile, IGNORE_VALUE if (useFixture) { - tasks.integTest.dependsOn createServiceAccountFile /* Use a closure on the string to delay evaluation until tests are executed */ setting 'gcs.client.searchable_snapshots.endpoint', { "${-> fixtureAddress('gcs-fixture-other')}" }, IGNORE_VALUE setting 'gcs.client.searchable_snapshots.token_uri', { "${-> fixtureAddress('gcs-fixture-other')}/o/oauth2/token" }, IGNORE_VALUE @@ -108,6 +111,7 @@ testClusters.integTest { setting 'xpack.license.self_generated.type', 'trial' } + tasks.register("gcsThirdPartyTest") { dependsOn "integTest" } diff --git a/x-pack/plugin/searchable-snapshots/qa/minio/build.gradle b/x-pack/plugin/searchable-snapshots/qa/minio/build.gradle index b19ef31c970ad..f41cff55fbddf 100644 --- a/x-pack/plugin/searchable-snapshots/qa/minio/build.gradle +++ b/x-pack/plugin/searchable-snapshots/qa/minio/build.gradle @@ -27,7 +27,7 @@ def fixtureAddress = { '127.0.0.1:' + ephemeralPort } -integTest { +tasks.named("integTest").configure { systemProperty 'test.minio.bucket', 'bucket' systemProperty 'test.minio.base_path', 'searchable_snapshots_tests' } diff --git a/x-pack/plugin/searchable-snapshots/qa/rest/build.gradle b/x-pack/plugin/searchable-snapshots/qa/rest/build.gradle index fc741f9728d62..85e604b779ce5 100644 --- a/x-pack/plugin/searchable-snapshots/qa/rest/build.gradle +++ b/x-pack/plugin/searchable-snapshots/qa/rest/build.gradle @@ -9,7 +9,7 @@ dependencies { final File repoDir = file("$buildDir/testclusters/repo") -integTest { +tasks.named("integTest").configure { systemProperty 'tests.path.repo', repoDir } diff --git a/x-pack/plugin/searchable-snapshots/qa/s3/build.gradle b/x-pack/plugin/searchable-snapshots/qa/s3/build.gradle index db27a341e04c8..2f3478316805f 100644 --- a/x-pack/plugin/searchable-snapshots/qa/s3/build.gradle +++ b/x-pack/plugin/searchable-snapshots/qa/s3/build.gradle @@ -42,7 +42,7 @@ if (useFixture) { testFixtures.useFixture(fixture.path, 's3-fixture-other') } -integTest { +tasks.named("integTest").configure { systemProperty 'test.s3.bucket', s3Bucket nonInputProperties.systemProperty 'test.s3.base_path', s3BasePath ? s3BasePath + "_searchable_snapshots_tests" + BuildParams.testSeed : 'base_path' } diff --git a/x-pack/plugin/security/build.gradle b/x-pack/plugin/security/build.gradle index 57db2af2e960e..3f1ffcb3b7222 100644 --- a/x-pack/plugin/security/build.gradle +++ b/x-pack/plugin/security/build.gradle @@ -484,7 +484,7 @@ tasks.named("test").configure { systemProperty 'es.set.netty.runtime.available.processors', 'false' } -internalClusterTest { +tasks.named("internalClusterTest").configure { /* * We have to disable setting the number of available processors as tests in the same JVM randomize processors and will step on each * other if we allow them to set the number of available processors as it's set-once in Netty. diff --git a/x-pack/plugin/security/qa/basic-enable-security/build.gradle b/x-pack/plugin/security/qa/basic-enable-security/build.gradle index 0bf30d055e765..49a3459220541 100644 --- a/x-pack/plugin/security/qa/basic-enable-security/build.gradle +++ b/x-pack/plugin/security/qa/basic-enable-security/build.gradle @@ -9,28 +9,31 @@ dependencies { javaRestTestImplementation project(path: xpackModule('core'), configuration: 'testArtifacts') } -javaRestTest { +tasks.named("javaRestTest").configure { description = "Run tests against a cluster that doesn't have security" systemProperty 'tests.has_security', 'false' } -testClusters.javaRestTest { - testDistribution = 'DEFAULT' - numberOfNodes = 2 - setting 'xpack.ml.enabled', 'false' - setting 'xpack.license.self_generated.type', 'basic' - setting 'xpack.security.enabled', 'false' +testClusters { + javaRestTest { + testDistribution = 'DEFAULT' + numberOfNodes = 2 + setting 'xpack.ml.enabled', 'false' + setting 'xpack.license.self_generated.type', 'basic' + setting 'xpack.security.enabled', 'false' + } } -task javaRestTestWithSecurity(type: StandaloneRestIntegTestTask) { +tasks.register("javaRestTestWithSecurity", StandaloneRestIntegTestTask) { description = "Run tests against a cluster that has security enabled" + dependsOn "javaRestTest" useCluster testClusters.javaRestTest - dependsOn javaRestTest systemProperty 'tests.has_security', 'true' testClassesDirs = sourceSets.javaRestTest.output.classesDirs classpath = sourceSets.javaRestTest.runtimeClasspath doFirst { testClusters.javaRestTest { + // TODO Rene: revisit if using dedicated new cluster definitions would be more efficient. // Reconfigure cluster to enable security setting 'xpack.security.enabled', 'true' setting 'xpack.security.authc.anonymous.roles', 'anonymous' @@ -53,5 +56,5 @@ task javaRestTestWithSecurity(type: StandaloneRestIntegTestTask) { nonInputProperties.systemProperty 'tests.rest.cluster', "${-> testClusters.javaRestTest.getAllHttpSocketURI().join(",")}" } } -tasks.named("check").configure { dependsOn(javaRestTestWithSecurity) } +tasks.named("check").configure { dependsOn("javaRestTestWithSecurity") } diff --git a/x-pack/plugin/sql/qa/jdbc/security/build.gradle b/x-pack/plugin/sql/qa/jdbc/security/build.gradle index 182ec02c7f567..67baeb48e3181 100644 --- a/x-pack/plugin/sql/qa/jdbc/security/build.gradle +++ b/x-pack/plugin/sql/qa/jdbc/security/build.gradle @@ -57,5 +57,5 @@ subprojects { "${-> testClusters.integTest.singleNode().getAuditLog().getParentFile()}/integTest_audit-${new Date().format('yyyy-MM-dd')}.json" } - testingConventions.enabled = false + tasks.named("testingConventions").configure { enabled = false } } diff --git a/x-pack/plugin/sql/qa/server/security/build.gradle b/x-pack/plugin/sql/qa/server/security/build.gradle index 50e75c1376b25..e995676493d4c 100644 --- a/x-pack/plugin/sql/qa/server/security/build.gradle +++ b/x-pack/plugin/sql/qa/server/security/build.gradle @@ -16,7 +16,7 @@ artifacts { } // Tests are pushed down to subprojects and will be checked there. -testingConventions.enabled = false +tasks.named("testingConventions").configure { enabled = false } subprojects { // Use tests from the root security qa project in subprojects @@ -47,7 +47,7 @@ subprojects { into testArtifactsDir } - integTest { + tasks.named("integTest").configure { dependsOn copyTestClasses testClassesDirs += project.files(testArtifactsDir) classpath += configurations.testArtifacts @@ -57,5 +57,5 @@ subprojects { "${-> testClusters.integTest.singleNode().getAuditLog().getParentFile()}/integTest_audit-${new Date().format('yyyy-MM-dd')}.json" } - testingConventions.enabled = false + tasks.named("testingConventions").configure { enabled = false } } diff --git a/x-pack/plugin/sql/qa/server/security/with-ssl/build.gradle b/x-pack/plugin/sql/qa/server/security/with-ssl/build.gradle index 80aa1632b50a9..d56bf2cc0991e 100644 --- a/x-pack/plugin/sql/qa/server/security/with-ssl/build.gradle +++ b/x-pack/plugin/sql/qa/server/security/with-ssl/build.gradle @@ -2,7 +2,7 @@ import org.elasticsearch.gradle.info.BuildParams apply plugin: 'elasticsearch.test-with-ssl' -integTest { +tasks.named("integTest").configure { onlyIf { // Do not attempt to form a cluster in a FIPS JVM, as doing so with a JKS keystore will fail. // TODO Revisit this when SQL CLI client can handle key/certificate instead of only Keystores. diff --git a/x-pack/plugin/sql/qa/server/security/without-ssl/build.gradle b/x-pack/plugin/sql/qa/server/security/without-ssl/build.gradle index 0f27f7a4c48c1..442e1844bcb76 100644 --- a/x-pack/plugin/sql/qa/server/security/without-ssl/build.gradle +++ b/x-pack/plugin/sql/qa/server/security/without-ssl/build.gradle @@ -1,4 +1,4 @@ -integTest { +tasks.named("integTest").configure { systemProperty 'tests.ssl.enabled', 'false' } diff --git a/x-pack/plugin/sql/sql-cli/build.gradle b/x-pack/plugin/sql/sql-cli/build.gradle index 3e6ef43e510ea..a30a38b2e6dcf 100644 --- a/x-pack/plugin/sql/sql-cli/build.gradle +++ b/x-pack/plugin/sql/sql-cli/build.gradle @@ -42,7 +42,7 @@ tasks.named("dependencyLicenses").configure { mapping from: /jline-.*/, to: 'jline' } -shadowJar { +tasks.named("shadowJar").configure { manifest { attributes 'Main-Class': 'org.elasticsearch.xpack.sql.cli.Cli' } diff --git a/x-pack/plugin/sql/sql-client/build.gradle b/x-pack/plugin/sql/sql-client/build.gradle index dee9c08a4392a..d36dd8d03a598 100644 --- a/x-pack/plugin/sql/sql-client/build.gradle +++ b/x-pack/plugin/sql/sql-client/build.gradle @@ -27,6 +27,6 @@ tasks.named('forbiddenApisTest').configure { bundledSignatures += 'jdk-internal' } -forbiddenPatterns { +tasks.named("forbiddenPatterns").configure { exclude '**/*.keystore' } diff --git a/x-pack/plugin/stack/qa/rest/build.gradle b/x-pack/plugin/stack/qa/rest/build.gradle index e341cbf957c8e..da36654b8fa9f 100644 --- a/x-pack/plugin/stack/qa/rest/build.gradle +++ b/x-pack/plugin/stack/qa/rest/build.gradle @@ -14,7 +14,7 @@ restResources { def clusterCredentials = [username: System.getProperty('tests.rest.cluster.username', 'test_admin'), password: System.getProperty('tests.rest.cluster.password', 'x-pack-test-password')] -yamlRestTest { +tasks.named("yamlRestTest").configure { systemProperty 'tests.rest.cluster.username', clusterCredentials.username systemProperty 'tests.rest.cluster.password', clusterCredentials.password } diff --git a/x-pack/plugin/watcher/qa/common/build.gradle b/x-pack/plugin/watcher/qa/common/build.gradle index fca0d41407fd5..3f64d7084c5ae 100644 --- a/x-pack/plugin/watcher/qa/common/build.gradle +++ b/x-pack/plugin/watcher/qa/common/build.gradle @@ -1,5 +1,5 @@ apply plugin: 'elasticsearch.build' -test.enabled = false +tasks.named("test").configure { enabled = false } dependencies { implementation project(':test:framework') diff --git a/x-pack/qa/build.gradle b/x-pack/qa/build.gradle index 908bc14d45eae..36a5bfbc9099e 100644 --- a/x-pack/qa/build.gradle +++ b/x-pack/qa/build.gradle @@ -2,7 +2,7 @@ // by the elasticsearch x-plugins include mechanism apply plugin: 'elasticsearch.build' -test.enabled = false +tasks.named("test").configure { enabled = false } dependencies { api project(':test:framework') diff --git a/x-pack/qa/core-rest-tests-with-security/build.gradle b/x-pack/qa/core-rest-tests-with-security/build.gradle index bd0b5bff2ba1d..3c2eeef0ff726 100644 --- a/x-pack/qa/core-rest-tests-with-security/build.gradle +++ b/x-pack/qa/core-rest-tests-with-security/build.gradle @@ -13,7 +13,7 @@ restResources { } } -integTest { +tasks.named("integTest").configure { systemProperty 'tests.rest.blacklist', [ 'index/10_with_id/Index with ID', diff --git a/x-pack/qa/evil-tests/build.gradle b/x-pack/qa/evil-tests/build.gradle index a57b259996dd7..777f89dfeb061 100644 --- a/x-pack/qa/evil-tests/build.gradle +++ b/x-pack/qa/evil-tests/build.gradle @@ -4,7 +4,7 @@ dependencies { testImplementation project(path: xpackModule('security'), configuration: 'testArtifacts') } -test { +tasks.named("test").configure { systemProperty 'tests.security.manager', 'false' include '**/*Tests.class' } diff --git a/x-pack/qa/kerberos-tests/build.gradle b/x-pack/qa/kerberos-tests/build.gradle index d75321b11aea1..d35b6635f2619 100644 --- a/x-pack/qa/kerberos-tests/build.gradle +++ b/x-pack/qa/kerberos-tests/build.gradle @@ -44,11 +44,11 @@ testClusters.integTest { tasks.register("copyKeytabToGeneratedResources", Copy) { from project(':test:fixtures:krb5kdc-fixture').ext.krb5Keytabs("peppa", "peppa.keytab") into "$buildDir/generated-resources/keytabs" - dependsOn project(':test:fixtures:krb5kdc-fixture').postProcessFixture + dependsOn ":test:fixtures:krb5kdc-fixture:postProcessFixture" } String realm = "BUILD.ELASTIC.CO" -integTest { +tasks.named("integTest").configure { Path peppaKeytab = Paths.get("${project.buildDir}", "generated-resources", "keytabs", "peppa.keytab") nonInputProperties.systemProperty 'test.userkt', "peppa@${realm}" nonInputProperties.systemProperty 'test.userkt.keytab', "${peppaKeytab}" @@ -59,5 +59,6 @@ integTest { "-Djava.security.krb5.conf=${project(':test:fixtures:krb5kdc-fixture').ext.krb5Conf("peppa")}", "-Dsun.security.krb5.debug=true" ]) - classpath += copyKeytabToGeneratedResources.outputs.files + dependsOn "copyKeytabToGeneratedResources" + classpath += files("$buildDir/generated-resources/keytabs") } diff --git a/x-pack/qa/reindex-tests-with-security/build.gradle b/x-pack/qa/reindex-tests-with-security/build.gradle index 9186fc883d53a..30bdf322794c6 100644 --- a/x-pack/qa/reindex-tests-with-security/build.gradle +++ b/x-pack/qa/reindex-tests-with-security/build.gradle @@ -12,7 +12,7 @@ dependencies { testImplementation project(path: ':modules:reindex') } -forbiddenPatterns { +tasks.named("forbiddenPatterns").configure { exclude '**/*.key' exclude '**/*.pem' exclude '**/*.p12' diff --git a/x-pack/qa/rolling-upgrade/build.gradle b/x-pack/qa/rolling-upgrade/build.gradle index bd374e47661aa..5d082a64fcb3b 100644 --- a/x-pack/qa/rolling-upgrade/build.gradle +++ b/x-pack/qa/rolling-upgrade/build.gradle @@ -19,7 +19,7 @@ restResources { } } -forbiddenPatterns { +tasks.named("forbiddenPatterns").configure { exclude '**/system_key' } diff --git a/x-pack/qa/smoke-test-plugins-ssl/build.gradle b/x-pack/qa/smoke-test-plugins-ssl/build.gradle index 571ccd5feda92..e29b1297c6667 100644 --- a/x-pack/qa/smoke-test-plugins-ssl/build.gradle +++ b/x-pack/qa/smoke-test-plugins-ssl/build.gradle @@ -1,6 +1,6 @@ import org.elasticsearch.gradle.MavenFilteringHack - import org.elasticsearch.gradle.http.WaitForHttpResource +import org.elasticsearch.gradle.info.BuildParams apply plugin: 'elasticsearch.testclusters' apply plugin: 'elasticsearch.standalone-rest-test' @@ -37,12 +37,23 @@ def copyKeyCerts = tasks.register("copyKeyCerts", Copy) { } // Add keystores to test classpath: it expects it there sourceSets.test.resources.srcDir(keystoreDir) -processTestResources.dependsOn(copyKeyCerts) +tasks.named("processTestResources").configure { + dependsOn(copyKeyCerts) +} +tasks.named("integTest").configure { + dependsOn(copyKeyCerts) +} -integTest.dependsOn(copyKeyCerts) +ext.pluginPaths = [] +project(':plugins').getChildProjects().each { pluginName, pluginProject -> + if (BuildParams.inFipsJvm && pluginName == "ingest-attachment") { + // Do not attempt to install ingest-attachment in FIPS 140 as it is not supported (it depends on non-FIPS BouncyCastle) + return + } + pluginPaths << pluginProject.path +} -def pluginsCount = 0 -testClusters.integTest { +testClusters.matching { it.name == "integTest" }.configureEach { testDistribution = 'DEFAULT' setting 'xpack.monitoring.collection.interval', '1s' @@ -66,14 +77,17 @@ testClusters.integTest { user username: "test_user", password: "x-pack-test-password" user username: "monitoring_agent", password: "x-pack-test-password", role: "remote_monitoring_agent" - project(':plugins').getChildProjects().each { pluginName, pluginProject -> - plugin pluginProject.path - pluginsCount += 1 + pluginPaths.each { pluginPath -> + plugin pluginPath } } ext.expansions = [ - 'expected.plugins.count': pluginsCount + 'expected.plugins.count': pluginPaths.size() +] + +ext.expansions = [ + 'expected.plugins.count': pluginPaths.size() ] tasks.named("processTestResources").configure { diff --git a/x-pack/qa/third-party/jira/build.gradle b/x-pack/qa/third-party/jira/build.gradle index 80704b0fd4f9f..a24a8c6902159 100644 --- a/x-pack/qa/third-party/jira/build.gradle +++ b/x-pack/qa/third-party/jira/build.gradle @@ -38,8 +38,8 @@ tasks.register("cleanJira", DefaultTask) { // require network access for this one, exit early instead of starting up the cluster if we dont have network if (!jiraUrl && !jiraUser && !jiraPassword && !jiraProject) { - integTest.enabled = false - testingConventions.enabled = false + tasks.named("integTest").configure { enabled = false } + tasks.named("testingConventions").configure { enabled = false } } else { testClusters.integTest { testDistribution = 'DEFAULT' diff --git a/x-pack/qa/third-party/pagerduty/build.gradle b/x-pack/qa/third-party/pagerduty/build.gradle index d23cc39a77e1e..1e7f11aa3d6ab 100644 --- a/x-pack/qa/third-party/pagerduty/build.gradle +++ b/x-pack/qa/third-party/pagerduty/build.gradle @@ -17,8 +17,8 @@ restResources { } if (!pagerDutyServiceKey) { - integTest.enabled = false - testingConventions.enabled = false + tasks.named("integTest").configure { enabled = false } + tasks.named("testingConventions").configure { enabled = false } } else { testClusters.integTest { testDistribution = 'DEFAULT' diff --git a/x-pack/qa/third-party/slack/build.gradle b/x-pack/qa/third-party/slack/build.gradle index 3860522db4d42..1430d1b8a4c03 100644 --- a/x-pack/qa/third-party/slack/build.gradle +++ b/x-pack/qa/third-party/slack/build.gradle @@ -17,8 +17,8 @@ restResources { String slackUrl = System.getenv('slack_url') if (!slackUrl) { - integTest.enabled = false - testingConventions.enabled = false + tasks.named("integTest").configure { enabled = false } + tasks.named("testingConventions").configure { enabled = false } } else { testClusters.integTest { testDistribution = 'DEFAULT' diff --git a/x-pack/test/smb-fixture/build.gradle b/x-pack/test/smb-fixture/build.gradle index 5b2161de2907b..76532ab24abcc 100644 --- a/x-pack/test/smb-fixture/build.gradle +++ b/x-pack/test/smb-fixture/build.gradle @@ -1,4 +1,4 @@ apply plugin: 'elasticsearch.build' apply plugin: 'elasticsearch.test.fixtures' -test.enabled = false +tasks.named("test").configure { enabled = false }