[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' classname 'org.elasticsearch.search.aggregations.matrix.MatrixAggregationPlugin'
hasClientJar = true hasClientJar = true
} }
restResources {
restApi {
includeCore '_common', 'indices', 'cluster', 'index', 'search', 'nodes'
}
}

View file

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

View file

@ -29,6 +29,12 @@ dependencies {
compile project(':libs:elasticsearch-dissect') compile project(':libs:elasticsearch-dissect')
} }
restResources {
restApi {
includeCore '_common', 'ingest', 'cluster', 'indices', 'index', 'bulk', 'nodes', 'get', 'update', 'cat', 'mget'
}
}
testClusters.integTest { testClusters.integTest {
// Needed in order to test ingest pipeline templating: // 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) // (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' testCompile 'org.elasticsearch:geolite2-databases:20191119'
} }
restResources {
restApi {
includeCore '_common', 'indices', 'index', 'cluster', 'nodes', 'get', 'ingest'
}
}
task copyDefaultGeoIp2DatabaseFiles(type: Copy) { task copyDefaultGeoIp2DatabaseFiles(type: Copy) {
from { zipTree(configurations.testCompile.files.find { it.name.contains('geolite2-databases') }) } from { zipTree(configurations.testCompile.files.find { it.name.contains('geolite2-databases') }) }
into "${project.buildDir}/ingest-geoip" into "${project.buildDir}/ingest-geoip"

View file

@ -22,6 +22,12 @@ esplugin {
classname 'org.elasticsearch.ingest.useragent.IngestUserAgentPlugin' classname 'org.elasticsearch.ingest.useragent.IngestUserAgentPlugin'
} }
restResources {
restApi {
includeCore '_common', 'indices', 'index', 'cluster', 'nodes', 'get', 'ingest'
}
}
testClusters.integTest { testClusters.integTest {
extraConfigFile 'ingest-user-agent/test-regexes.yml', file('src/test/test-regexes.yml') 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-commons:5.0.4'
compile 'org.ow2.asm:asm-tree:5.0.4' compile 'org.ow2.asm:asm-tree:5.0.4'
} }
restResources {
restApi {
includeCore '_common', 'indices', 'index', 'cluster', 'nodes', 'search'
}
}
dependencyLicenses { dependencyLicenses {
mapping from: /lucene-.*/, to: 'lucene' mapping from: /lucene-.*/, to: 'lucene'

View file

@ -27,3 +27,9 @@ dependencies {
compile "com.github.spullara.mustache.java:compiler:0.9.6" 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' 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 { test {
// in WhenThingsGoWrongTests we intentionally generate an out of memory error, this prevents the heap from being dumped to disk // in WhenThingsGoWrongTests we intentionally generate an out of memory error, this prevents the heap from being dumped to disk
jvmArgs '-XX:-OmitStackTraceInFastThrow', '-XX:-HeapDumpOnOutOfMemoryError' jvmArgs '-XX:-OmitStackTraceInFastThrow', '-XX:-HeapDumpOnOutOfMemoryError'

View file

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

View file

@ -22,3 +22,9 @@ esplugin {
classname 'org.elasticsearch.join.ParentJoinPlugin' classname 'org.elasticsearch.join.ParentJoinPlugin'
hasClientJar = true 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') testCompile project(path: ':modules:parent-join', configuration: 'runtime')
} }
restResources {
restApi {
includeCore '_common', 'indices', 'index', 'search', 'msearch'
}
}
dependencyLicenses { dependencyLicenses {
// Don't check the client's license. We know it. // Don't check the client's license. We know it.
dependencies = project.configurations.runtime.fileCollection { dependencies = project.configurations.runtime.fileCollection {

View file

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

View file

@ -56,6 +56,13 @@ dependencies {
testCompile project(path: ':modules:parent-join', configuration: 'runtime') 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( thirdPartyAudit.ignoreMissingClasses(
// Commons logging // Commons logging
'javax.servlet.ServletContextEvent', 'javax.servlet.ServletContextEvent',

View file

@ -26,7 +26,13 @@ esplugin {
classname 'org.elasticsearch.plugin.repository.url.URLRepositoryPlugin' 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") File repositoryDir = new File(project.buildDir, "shared-repository")
/** A task to start the URLFixture which exposes the repositoryDir over HTTP **/ /** 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}" compile "io.netty:netty-transport:${versions.netty}"
} }
restResources {
restApi {
includeCore '_common', 'cluster', 'nodes'
}
}
dependencyLicenses { dependencyLicenses {
mapping from: /netty-.*/, to: 'netty' mapping from: /netty-.*/, to: 'netty'
} }

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -33,6 +33,12 @@ dependencies {
testCompile project(path: ':plugins:discovery-gce', configuration: 'runtime') 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 **/ /** A task to start the GCEFixture which emulates a GCE service **/
task gceFixture(type: AntFixture) { task gceFixture(type: AntFixture) {
dependsOn compileTestJava dependsOn compileTestJava

View file

@ -72,6 +72,12 @@ dependencies {
compile 'org.apache.commons:commons-lang3:3.9' compile 'org.apache.commons:commons-lang3:3.9'
} }
restResources {
restApi {
includeCore '_common', 'cluster', 'nodes', 'ingest', 'index', 'get'
}
}
dependencyLicenses { dependencyLicenses {
mapping from: /apache-mime4j-.*/, to: 'apache-mime4j' 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.' 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' 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.' 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' 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.' description 'The Mapper Size plugin allows document to record their uncompressed size at index time.'
classname 'org.elasticsearch.plugin.mapper.MapperSizePlugin' 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') testCompile project(':test:fixtures:azure-fixture')
} }
restResources {
restApi {
includeCore '_common', 'cluster', 'nodes'
}
}
dependencyLicenses { dependencyLicenses {
mapping from: /azure-.*/, to: 'azure' mapping from: /azure-.*/, to: 'azure'
mapping from: /jackson-.*/, to: 'jackson' 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.rest-test'
apply plugin: 'elasticsearch.test.fixtures' apply plugin: 'elasticsearch.test.fixtures'
restResources {
restApi {
includeCore '_common', 'snapshot', 'bulk', 'count', 'indices'
}
}
testFixtures.useFixture ":test:fixtures:azure-fixture", "azure-fixture" testFixtures.useFixture ":test:fixtures:azure-fixture", "azure-fixture"
boolean useFixture = false boolean useFixture = false

View file

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

View file

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

View file

@ -74,6 +74,12 @@ dependencies {
} }
} }
restResources {
restApi {
includeCore '_common', 'cluster', 'nodes', 'indices', 'index', 'snapshot'
}
}
normalization { normalization {
runtimeClasspath { runtimeClasspath {
// ignore generated keytab files for the purposes of build avoidance // 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.' description 'The Store SMB plugin adds support for SMB stores.'
classname 'org.elasticsearch.plugin.store.smb.SMBStorePlugin' classname 'org.elasticsearch.plugin.store.smb.SMBStorePlugin'
} }
restResources {
restApi {
includeCore '_common', 'cluster', 'nodes', 'index', 'indices', 'get'
}
}

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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