[7.x] Optimize which Rest resources are used by the Rest tests… (#53766)

This should help with Gradle's incremental compile such that projects
only depend upon the resources they use.

related #52114
This commit is contained in:
Jake Landis 2020-03-19 12:28:59 -05:00 committed by GitHub
parent 53f7e31462
commit db3420d757
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
45 changed files with 230 additions and 3 deletions

View File

@ -22,3 +22,9 @@ esplugin {
classname 'org.elasticsearch.search.aggregations.matrix.MatrixAggregationPlugin'
hasClientJar = true
}
restResources {
restApi {
includeCore '_common', 'indices', 'cluster', 'index', 'search', 'nodes'
}
}

View File

@ -23,6 +23,12 @@ esplugin {
extendedPlugins = ['lang-painless']
}
restResources {
restApi {
includeCore '_common', 'indices', 'index', 'cluster', 'search', 'nodes', 'bulk', 'termvectors', 'explain', 'count'
}
}
dependencies {
compileOnly project(':modules:lang-painless')
}

View File

@ -29,6 +29,12 @@ dependencies {
compile project(':libs:elasticsearch-dissect')
}
restResources {
restApi {
includeCore '_common', 'ingest', 'cluster', 'indices', 'index', 'bulk', 'nodes', 'get', 'update', 'cat', 'mget'
}
}
testClusters.integTest {
// Needed in order to test ingest pipeline templating:
// (this is because the integTest node is not using default distribution, but only the minimal number of required modules)

View File

@ -34,6 +34,12 @@ dependencies {
testCompile 'org.elasticsearch:geolite2-databases:20191119'
}
restResources {
restApi {
includeCore '_common', 'indices', 'index', 'cluster', 'nodes', 'get', 'ingest'
}
}
task copyDefaultGeoIp2DatabaseFiles(type: Copy) {
from { zipTree(configurations.testCompile.files.find { it.name.contains('geolite2-databases') }) }
into "${project.buildDir}/ingest-geoip"

View File

@ -22,6 +22,12 @@ esplugin {
classname 'org.elasticsearch.ingest.useragent.IngestUserAgentPlugin'
}
restResources {
restApi {
includeCore '_common', 'indices', 'index', 'cluster', 'nodes', 'get', 'ingest'
}
}
testClusters.integTest {
extraConfigFile 'ingest-user-agent/test-regexes.yml', file('src/test/test-regexes.yml')
}

View File

@ -29,6 +29,11 @@ dependencies {
compile 'org.ow2.asm:asm-commons:5.0.4'
compile 'org.ow2.asm:asm-tree:5.0.4'
}
restResources {
restApi {
includeCore '_common', 'indices', 'index', 'cluster', 'nodes', 'search'
}
}
dependencyLicenses {
mapping from: /lucene-.*/, to: 'lucene'

View File

@ -27,3 +27,9 @@ dependencies {
compile "com.github.spullara.mustache.java:compiler:0.9.6"
}
restResources {
restApi {
includeCore '_common', 'cluster', 'nodes', 'indices', 'index', 'bulk',
'put_script', 'render_search_template', 'search_template', 'msearch_template', 'lang_mustache'
}
}

View File

@ -44,6 +44,13 @@ dependencyLicenses {
mapping from: /asm-.*/, to: 'asm'
}
restResources {
restApi {
includeCore '_common', 'cluster', 'nodes', 'indices', 'index', 'search', 'get', 'bulk', 'update',
'scripts_painless_execute', 'put_script', 'delete_script'
}
}
test {
// in WhenThingsGoWrongTests we intentionally generate an out of memory error, this prevents the heap from being dumped to disk
jvmArgs '-XX:-OmitStackTraceInFastThrow', '-XX:-HeapDumpOnOutOfMemoryError'

View File

@ -22,3 +22,9 @@ esplugin {
classname 'org.elasticsearch.index.mapper.MapperExtrasPlugin'
hasClientJar = true
}
restResources {
restApi {
includeCore '_common', 'cluster', 'nodes', 'indices', 'index', 'search', 'get'
}
}

View File

@ -22,3 +22,9 @@ esplugin {
classname 'org.elasticsearch.join.ParentJoinPlugin'
hasClientJar = true
}
restResources {
restApi {
includeCore '_common', 'cluster', 'nodes', 'indices', 'index', 'search'
}
}

View File

@ -27,6 +27,11 @@ dependencies {
testCompile project(path: ':modules:parent-join', configuration: 'runtime')
}
restResources {
restApi {
includeCore '_common', 'indices', 'index', 'search', 'msearch'
}
}
dependencyLicenses {
// Don't check the client's license. We know it.
dependencies = project.configurations.runtime.fileCollection {

View File

@ -23,6 +23,12 @@ esplugin {
hasClientJar = true
}
restResources {
restApi {
includeCore '_common', 'indices', 'index', 'rank_eval'
}
}
testClusters.integTest {
// Modules who's integration is explicitly tested in integration tests
module file(project(':modules:lang-mustache').tasks.bundlePlugin.archiveFile)

View File

@ -56,6 +56,13 @@ dependencies {
testCompile project(path: ':modules:parent-join', configuration: 'runtime')
}
restResources {
restApi {
includeCore '_common', 'cluster', 'nodes', 'indices', 'index', 'get', 'search', 'mget', 'count',
'update_by_query', 'delete_by_query', 'reindex_rethrottle', 'tasks', 'reindex', 'put_script'
}
}
thirdPartyAudit.ignoreMissingClasses(
// Commons logging
'javax.servlet.ServletContextEvent',

View File

@ -26,7 +26,13 @@ esplugin {
classname 'org.elasticsearch.plugin.repository.url.URLRepositoryPlugin'
}
// This directory is shared between two URL repositories and one FS repository in YAML integration tests
restResources {
restApi {
includeCore '_common', 'cluster', 'nodes', 'indices', 'index', 'bulk', 'count', 'snapshot'
}
}
// This directory is shared between two URL repositories and one FS repository in YAML integration tests
File repositoryDir = new File(project.buildDir, "shared-repository")
/** A task to start the URLFixture which exposes the repositoryDir over HTTP **/

View File

@ -44,6 +44,12 @@ dependencies {
compile "io.netty:netty-transport:${versions.netty}"
}
restResources {
restApi {
includeCore '_common', 'cluster', 'nodes'
}
}
dependencyLicenses {
mapping from: /netty-.*/, to: 'netty'
}

View File

@ -36,6 +36,12 @@ dependencies {
compile "com.ibm.icu:icu4j:${versions.icu4j}"
}
restResources {
restApi {
includeCore '_common', 'indices', 'index', 'search'
}
}
dependencyLicenses {
mapping from: /lucene-.*/, to: 'lucene'
}

View File

@ -26,6 +26,12 @@ dependencies {
compile "org.apache.lucene:lucene-analyzers-kuromoji:${versions.lucene}"
}
restResources {
restApi {
includeCore '_common', 'indices', 'index', 'search'
}
}
dependencyLicenses {
mapping from: /lucene-.*/, to: 'lucene'
}

View File

@ -26,6 +26,11 @@ dependencies {
compile "org.apache.lucene:lucene-analyzers-nori:${versions.lucene}"
}
restResources {
restApi {
includeCore '_common', 'indices', 'index', 'search'
}
}
dependencyLicenses {
mapping from: /lucene-.*/, to: 'lucene'
}

View File

@ -27,6 +27,12 @@ dependencies {
compile "commons-codec:commons-codec:${versions.commonscodec}"
}
restResources {
restApi {
includeCore '_common', 'indices', 'index', 'search'
}
}
dependencyLicenses {
mapping from: /lucene-.*/, to: 'lucene'
}

View File

@ -26,6 +26,12 @@ dependencies {
compile "org.apache.lucene:lucene-analyzers-smartcn:${versions.lucene}"
}
restResources {
restApi {
includeCore '_common', 'indices', 'index', 'search'
}
}
dependencyLicenses {
mapping from: /lucene-.*/, to: 'lucene'
}

View File

@ -26,6 +26,12 @@ dependencies {
compile "org.apache.lucene:lucene-analyzers-stempel:${versions.lucene}"
}
restResources {
restApi {
includeCore '_common', 'indices', 'index', 'search'
}
}
dependencyLicenses {
mapping from: /lucene-.*/, to: 'lucene'
}

View File

@ -29,6 +29,12 @@ dependencies {
compile "ua.net.nlp:morfologik-ukrainian-search:3.7.5"
}
restResources {
restApi {
includeCore '_common', 'indices', 'index', 'search'
}
}
dependencyLicenses {
mapping from: /lucene-.*/, to: 'lucene'
mapping from: /morfologik-.*/, to: 'lucene'

View File

@ -57,6 +57,11 @@ dependencies {
compile 'javax.xml.bind:jaxb-api:2.2.2'
}
restResources {
restApi {
includeCore '_common', 'cluster', 'nodes'
}
}
// needed to be consistent with ssl host checking
String host = InetAddress.getLoopbackAddress().getHostAddress()

View File

@ -40,6 +40,12 @@ dependencies {
compile "com.fasterxml.jackson.core:jackson-annotations:${versions.jackson}"
}
restResources {
restApi {
includeCore '_common', 'cluster', 'nodes'
}
}
dependencyLicenses {
mapping from: /aws-java-sdk-.*/, to: 'aws-java-sdk'
mapping from: /jackson-.*/, to: 'jackson'

View File

@ -32,6 +32,12 @@ dependencies {
testCompile project(path: ':plugins:discovery-ec2', configuration: 'runtime')
}
restResources {
restApi {
includeCore '_common', 'cluster', 'nodes'
}
}
final int ec2NumberOfNodes = 3
Map<String, Object> expansions = [

View File

@ -21,6 +21,12 @@ dependencies {
compile "commons-codec:commons-codec:${versions.commonscodec}"
}
restResources {
restApi {
includeCore '_common', 'cluster', 'nodes'
}
}
dependencyLicenses {
mapping from: /google-.*/, to: 'google'
}

View File

@ -33,6 +33,12 @@ dependencies {
testCompile project(path: ':plugins:discovery-gce', configuration: 'runtime')
}
restResources {
restApi {
includeCore '_common', 'cluster', 'nodes'
}
}
/** A task to start the GCEFixture which emulates a GCE service **/
task gceFixture(type: AntFixture) {
dependsOn compileTestJava

View File

@ -72,6 +72,12 @@ dependencies {
compile 'org.apache.commons:commons-lang3:3.9'
}
restResources {
restApi {
includeCore '_common', 'cluster', 'nodes', 'ingest', 'index', 'get'
}
}
dependencyLicenses {
mapping from: /apache-mime4j-.*/, to: 'apache-mime4j'
}

View File

@ -21,3 +21,9 @@ esplugin {
description 'The Mapper Annotated_text plugin adds support for text fields with markup used to inject annotation tokens into the index.'
classname 'org.elasticsearch.plugin.mapper.AnnotatedTextPlugin'
}
restResources {
restApi {
includeCore '_common', 'indices', 'index', 'search'
}
}

View File

@ -21,3 +21,9 @@ esplugin {
description 'The Mapper Murmur3 plugin allows to compute hashes of a field\'s values at index-time and to store them in the index.'
classname 'org.elasticsearch.plugin.mapper.MapperMurmur3Plugin'
}
restResources {
restApi {
includeCore '_common', 'indices', 'index', 'search'
}
}

View File

@ -21,3 +21,9 @@ esplugin {
description 'The Mapper Size plugin allows document to record their uncompressed size at index time.'
classname 'org.elasticsearch.plugin.mapper.MapperSizePlugin'
}
restResources {
restApi {
includeCore '_common', 'indices', 'index', 'get'
}
}

View File

@ -32,6 +32,12 @@ dependencies {
testCompile project(':test:fixtures:azure-fixture')
}
restResources {
restApi {
includeCore '_common', 'cluster', 'nodes'
}
}
dependencyLicenses {
mapping from: /azure-.*/, to: 'azure'
mapping from: /jackson-.*/, to: 'jackson'

View File

@ -29,6 +29,12 @@ apply plugin: 'elasticsearch.standalone-rest-test'
apply plugin: 'elasticsearch.rest-test'
apply plugin: 'elasticsearch.test.fixtures'
restResources {
restApi {
includeCore '_common', 'snapshot', 'bulk', 'count', 'indices'
}
}
testFixtures.useFixture ":test:fixtures:azure-fixture", "azure-fixture"
boolean useFixture = false

View File

@ -58,6 +58,12 @@ dependencies {
testCompile project(':test:fixtures:gcs-fixture')
}
restResources {
restApi {
includeCore '_common', 'cluster', 'nodes'
}
}
dependencyLicenses {
mapping from: /google-cloud-.*/, to: 'google-cloud'
mapping from: /google-auth-.*/, to: 'google-auth'

View File

@ -36,6 +36,12 @@ dependencies {
testCompile project(path: ':plugins:repository-gcs')
}
restResources {
restApi {
includeCore '_common', 'snapshot','indices', 'index', 'bulk', 'count'
}
}
testFixtures.useFixture(':test:fixtures:gcs-fixture')
boolean useFixture = false

View File

@ -74,6 +74,12 @@ dependencies {
}
}
restResources {
restApi {
includeCore '_common', 'cluster', 'nodes', 'indices', 'index', 'snapshot'
}
}
normalization {
runtimeClasspath {
// ignore generated keytab files for the purposes of build avoidance

View File

@ -21,4 +21,8 @@ esplugin {
description 'The Store SMB plugin adds support for SMB stores.'
classname 'org.elasticsearch.plugin.store.smb.SMBStorePlugin'
}
restResources {
restApi {
includeCore '_common', 'cluster', 'nodes', 'index', 'indices', 'get'
}
}

View File

@ -11,6 +11,7 @@ dependencies {
restResources {
restApi {
includeCore '_common'
includeXpack 'autoscaling'
}
}

View File

@ -5,8 +5,9 @@ apply plugin: 'elasticsearch.standalone-test'
restResources {
restApi {
includeCore '_common', 'cluster', 'nodes', 'indices', 'index', 'info'
includeXpack 'ccr'
}
}
}
dependencies {

View File

@ -4,6 +4,7 @@ apply plugin: 'elasticsearch.rest-test'
restResources {
restApi {
includeCore '_common', 'indices', 'index'
includeXpack 'enrich'
}
}

View File

@ -6,6 +6,7 @@ apply plugin: 'elasticsearch.rest-test'
restResources {
restApi {
includeCore '_common', 'bulk'
includeXpack 'eql'
}
}

View File

@ -9,6 +9,7 @@ dependencies {
// bring in graph rest test suite
restResources {
restApi {
includeCore '_common', 'cluster', 'indices', 'index'
includeXpack 'graph'
}
restTests {

View File

@ -10,6 +10,7 @@ dependencies {
restResources {
restApi {
includeCore '_common', 'cluster', 'indices', 'index', 'snapshot'
includeXpack 'ilm', 'slm'
}
}

View File

@ -11,6 +11,7 @@ dependencies {
// bring in machine learning rest test suite
restResources {
restApi {
includeCore '_common', 'cluster', 'nodes', 'indices', 'index', 'search', 'get', 'count', 'ingest'
includeXpack 'ml', 'cat'
}
restTests {

View File

@ -21,6 +21,8 @@ artifacts {
restResources {
restApi {
includeCore '_common', 'cluster', 'nodes', 'search', 'get', 'indices',
'index', 'put_script', 'ingest', 'count'
includeXpack 'watcher', 'xpack'
}
}