Build: Replace references to x-pack-elasticsearch paths with helper methods (elastic/x-pack-elasticsearch#3748)

In order to more easily integrate xpack once it moves into the
elasticsearch repo, references to the existing x-pack-elasticsearch need
to be reduced. This commit introduces a few helper "methods" available
to any project within xpack (through gradle project extension
properties, as closures). All refeerences to project paths now use these
helper methods, except for those pertaining to bwc, which will be
handled in a followup.

Original commit: elastic/x-pack-elasticsearch@850668744c
This commit is contained in:
Ryan Ernst 2018-01-26 21:48:30 -08:00 committed by GitHub
parent e583b72c8d
commit 5a86450df7
48 changed files with 217 additions and 217 deletions

View File

@ -1,4 +1,5 @@
import org.elasticsearch.gradle.BuildPlugin
import org.elasticsearch.gradle.plugin.PluginBuildPlugin
import org.elasticsearch.gradle.Version
import org.elasticsearch.gradle.precommit.LicenseHeadersTask
@ -8,8 +9,14 @@ if (project.projectDir.name != 'x-pack-elasticsearch') {
task wrapper(type: Wrapper)
Project xpackRootProject = project
subprojects {
group = 'org.elasticsearch.plugin'
ext.xpackRootProject = xpackRootProject
ext.xpackProject = { String projectName -> xpackRootProject.project(projectName) }
// helper method to find the path to a module
ext.xpackModule = { String moduleName -> xpackProject("plugin:${moduleName}").path }
plugins.withType(MavenPublishPlugin).whenPluginAdded {
publishing {
@ -34,8 +41,13 @@ subprojects {
}
plugins.withType(BuildPlugin).whenPluginAdded {
project.licenseFile = project(':x-pack-elasticsearch').file('LICENSE.txt')
project.noticeFile = project(':x-pack-elasticsearch').file('NOTICE.txt')
project.licenseFile = xpackRootProject.file('LICENSE.txt')
project.noticeFile = xpackRootProject.file('NOTICE.txt')
}
plugins.withType(PluginBuildPlugin).whenPluginAdded {
project.esplugin.licenseFile = xpackRootProject.file('LICENSE.txt')
project.esplugin.noticeFile = xpackRootProject.file('NOTICE.txt')
}
}
@ -53,16 +65,16 @@ subprojects {
approvedLicenses = ['Elasticsearch Confidential']
additionalLicense 'ESCON', 'Elasticsearch Confidential', 'ELASTICSEARCH CONFIDENTIAL'
}
ext.projectSubstitutions += [ "org.elasticsearch.plugin:x-pack-api:${version}": ':x-pack-elasticsearch:plugin:core']
ext.projectSubstitutions += [ "org.elasticsearch.plugin:x-pack-core:${version}": ':x-pack-elasticsearch:plugin:core']
ext.projectSubstitutions += [ "org.elasticsearch.plugin:x-pack-deprecation:${version}": ':x-pack-elasticsearch:plugin:deprecation']
ext.projectSubstitutions += [ "org.elasticsearch.plugin:x-pack-graph:${version}": ':x-pack-elasticsearch:plugin:graph']
ext.projectSubstitutions += [ "org.elasticsearch.plugin:x-pack-logstash:${version}": ':x-pack-elasticsearch:plugin:logstash']
ext.projectSubstitutions += [ "org.elasticsearch.plugin:x-pack-ml:${version}": ':x-pack-elasticsearch:plugin:ml']
ext.projectSubstitutions += [ "org.elasticsearch.plugin:x-pack-monitoring:${version}": ':x-pack-elasticsearch:plugin:monitoring']
ext.projectSubstitutions += [ "org.elasticsearch.plugin:x-pack-security:${version}": ':x-pack-elasticsearch:plugin:security']
ext.projectSubstitutions += [ "org.elasticsearch.plugin:x-pack-upgrade:${version}": ':x-pack-elasticsearch:plugin:upgrade']
ext.projectSubstitutions += [ "org.elasticsearch.plugin:x-pack-watcher:${version}": ':x-pack-elasticsearch:plugin:watcher']
ext.projectSubstitutions += [ "org.elasticsearch.plugin:x-pack-api:${version}": xpackModule('core')]
ext.projectSubstitutions += [ "org.elasticsearch.plugin:x-pack-core:${version}": xpackModule('core')]
ext.projectSubstitutions += [ "org.elasticsearch.plugin:x-pack-deprecation:${version}": xpackModule('deprecation')]
ext.projectSubstitutions += [ "org.elasticsearch.plugin:x-pack-graph:${version}": xpackModule('graph')]
ext.projectSubstitutions += [ "org.elasticsearch.plugin:x-pack-logstash:${version}": xpackModule('logstash')]
ext.projectSubstitutions += [ "org.elasticsearch.plugin:x-pack-ml:${version}": xpackModule('ml')]
ext.projectSubstitutions += [ "org.elasticsearch.plugin:x-pack-monitoring:${version}": xpackModule('monitoring')]
ext.projectSubstitutions += [ "org.elasticsearch.plugin:x-pack-security:${version}": xpackModule('security')]
ext.projectSubstitutions += [ "org.elasticsearch.plugin:x-pack-upgrade:${version}": xpackModule('upgrade')]
ext.projectSubstitutions += [ "org.elasticsearch.plugin:x-pack-watcher:${version}": xpackModule('watcher')]
for (final Version version : versionCollection.versionsIndexCompatibleWithCurrent) {
if (version.branch != null) {

View File

@ -95,9 +95,9 @@ buildRestTests.expectedUnconvertedCandidates = [
]
dependencies {
testCompile project(path: ':x-pack-elasticsearch:plugin:core', configuration: 'runtime')
testCompile project(path: ':x-pack-elasticsearch:plugin:core', configuration: 'testArtifacts')
testCompile project(path: ':x-pack-elasticsearch:plugin', configuration: 'testArtifacts')
testCompile project(path: xpackModule('core'), configuration: 'runtime')
testCompile project(path: xpackModule('core'), configuration: 'testArtifacts')
testCompile project(path: xpackProject('plugin').path, configuration: 'testArtifacts')
}
Closure waitWithAuth = { NodeInfo node, AntBuilder ant ->
@ -142,7 +142,7 @@ Closure waitWithAuth = { NodeInfo node, AntBuilder ant ->
}
integTestCluster {
plugin ':x-pack-elasticsearch:plugin'
plugin xpackProject('plugin').path
setting 'xpack.security.authc.token.enabled', 'true'
// Disable monitoring exporters for the docs tests
setting 'xpack.monitoring.exporters._local.type', 'local'

View File

@ -1,7 +1,7 @@
apply plugin: 'elasticsearch.build'
dependencies {
compile project(':x-pack-elasticsearch:plugin:core')
compile project(xpackModule('core'))
compile "org.elasticsearch:elasticsearch:${version}"
testCompile "org.elasticsearch.test:framework:${version}"
}

View File

@ -20,7 +20,7 @@ es_meta_plugin {
}
dependencies {
testCompile project(path: ':x-pack-elasticsearch:plugin:core', configuration: 'testArtifacts')
testCompile project(path: xpackModule('core'), configuration: 'testArtifacts')
}
// https://github.com/elastic/x-plugins/issues/724

View File

@ -58,7 +58,7 @@ subprojects {
task createXPackClone(type: LoggedExec) {
onlyIf { xpackCheckoutDir.exists() == false }
commandLine = ['git', 'clone', project(':x-pack-elasticsearch').projectDir, xpackCheckoutPath]
commandLine = ['git', 'clone', xpackRootProject.projectDir, xpackCheckoutPath]
}
// we use regular Exec here to ensure we always get output, regardless of logging level

View File

@ -16,8 +16,6 @@ esplugin {
classname 'org.elasticsearch.xpack.core.XPackPlugin'
hasNativeController false
requiresKeystore false
licenseFile project(':x-pack-elasticsearch').file('LICENSE.txt')
noticeFile project(':x-pack-elasticsearch').file('NOTICE.txt')
}
dependencyLicenses {

View File

@ -1,4 +1,4 @@
evaluationDependsOn(':x-pack-elasticsearch:plugin:core')
evaluationDependsOn(xpackModule('core'))
apply plugin: 'elasticsearch.esplugin'
esplugin {
@ -8,8 +8,6 @@ esplugin {
hasNativeController false
requiresKeystore false
extendedPlugins = ['x-pack-core']
licenseFile project(':x-pack-elasticsearch').file('LICENSE.txt')
noticeFile project(':x-pack-elasticsearch').file('NOTICE.txt')
}
archivesBaseName = 'x-pack-deprecation'
@ -24,7 +22,7 @@ dependencyLicenses {
}
run {
plugin ':x-pack-elasticsearch:plugin:core'
plugin xpackModule('core')
}
integTest.enabled = false

View File

@ -1,4 +1,4 @@
evaluationDependsOn(':x-pack-elasticsearch:plugin:core')
evaluationDependsOn(xpackModule('core'))
apply plugin: 'elasticsearch.esplugin'
esplugin {
@ -8,8 +8,6 @@ esplugin {
hasNativeController false
requiresKeystore false
extendedPlugins = ['x-pack-core']
licenseFile project(':x-pack-elasticsearch').file('LICENSE.txt')
noticeFile project(':x-pack-elasticsearch').file('NOTICE.txt')
}
archivesBaseName = 'x-pack-graph'
@ -17,7 +15,7 @@ dependencies {
provided "org.elasticsearch:elasticsearch:${version}"
provided "org.elasticsearch.plugin:x-pack-core:${version}"
testCompile project(path: ':x-pack-elasticsearch:plugin:core', configuration: 'testArtifacts')
testCompile project(path: xpackModule('core'), configuration: 'testArtifacts')
}
dependencyLicenses {
@ -25,7 +23,7 @@ dependencyLicenses {
}
run {
plugin ':x-pack-elasticsearch:plugin:core'
plugin xpackModule('core')
}
integTest.enabled = false

View File

@ -1,4 +1,4 @@
evaluationDependsOn(':x-pack-elasticsearch:plugin:core')
evaluationDependsOn(xpackModule('core'))
apply plugin: 'elasticsearch.esplugin'
esplugin {
@ -8,8 +8,6 @@ esplugin {
hasNativeController false
requiresKeystore false
extendedPlugins = ['x-pack-core']
licenseFile project(':x-pack-elasticsearch').file('LICENSE.txt')
noticeFile project(':x-pack-elasticsearch').file('NOTICE.txt')
}
archivesBaseName = 'x-pack-logstash'
@ -17,7 +15,7 @@ dependencies {
provided "org.elasticsearch:elasticsearch:${version}"
provided "org.elasticsearch.plugin:x-pack-core:${version}"
testCompile project(path: ':x-pack-elasticsearch:plugin:core', configuration: 'testArtifacts')
testCompile project(path: xpackModule('core'), configuration: 'testArtifacts')
}
@ -26,7 +24,7 @@ dependencyLicenses {
}
run {
plugin ':x-pack-elasticsearch:plugin:core'
plugin xpackModule('core')
}
integTest.enabled = false

View File

@ -1,7 +1,7 @@
import com.carrotsearch.gradle.junit4.RandomizedTestingTask
import org.elasticsearch.gradle.BuildPlugin
evaluationDependsOn(':x-pack-elasticsearch:plugin:core')
evaluationDependsOn(xpackModule('core'))
apply plugin: 'elasticsearch.esplugin'
esplugin {
@ -11,8 +11,6 @@ esplugin {
hasNativeController true
requiresKeystore false
extendedPlugins = ['x-pack-core']
licenseFile project(':x-pack-elasticsearch').file('LICENSE.txt')
noticeFile project(':x-pack-elasticsearch').file('NOTICE.txt')
}
archivesBaseName = 'x-pack-ml'
@ -46,9 +44,9 @@ dependencies {
provided "org.elasticsearch:elasticsearch:${version}"
provided "org.elasticsearch.plugin:x-pack-core:${version}"
testCompile project(path: ':x-pack-elasticsearch:plugin:core', configuration: 'testArtifacts')
testCompile project(path: xpackModule('core'), configuration: 'testArtifacts')
// This should not be here
testCompile project(path: ':x-pack-elasticsearch:plugin:security', configuration: 'testArtifacts')
testCompile project(path: xpackModule('security'), configuration: 'testArtifacts')
// ml deps
compile 'net.sf.supercsv:super-csv:2.4.0'
@ -74,7 +72,7 @@ dependencyLicenses {
}
run {
plugin ':x-pack-elasticsearch:plugin:core'
plugin xpackModule('core')
}
// xpack modules are installed in real clusters as the meta plugin, so

View File

@ -1,7 +1,7 @@
import com.carrotsearch.gradle.junit4.RandomizedTestingTask
import org.elasticsearch.gradle.BuildPlugin
evaluationDependsOn(':x-pack-elasticsearch:plugin:core')
evaluationDependsOn(xpackModule('core'))
apply plugin: 'elasticsearch.esplugin'
esplugin {
@ -11,8 +11,6 @@ esplugin {
hasNativeController false
requiresKeystore false
extendedPlugins = ['x-pack-core']
licenseFile project(':x-pack-elasticsearch').file('LICENSE.txt')
noticeFile project(':x-pack-elasticsearch').file('NOTICE.txt')
}
archivesBaseName = 'x-pack-monitoring'
@ -20,7 +18,7 @@ dependencies {
provided "org.elasticsearch:elasticsearch:${version}"
provided "org.elasticsearch.plugin:x-pack-core:${version}"
testCompile project(path: ':x-pack-elasticsearch:plugin:core', configuration: 'testArtifacts')
testCompile project(path: xpackModule('core'), configuration: 'testArtifacts')
// monitoring deps
compile "org.elasticsearch.client:elasticsearch-rest-client:${version}"
@ -57,7 +55,7 @@ dependencyLicenses {
}
run {
plugin ':x-pack-elasticsearch:plugin:core'
plugin xpackModule('core')
}
// xpack modules are installed in real clusters as the meta plugin, so

View File

@ -1,4 +1,4 @@
evaluationDependsOn(':x-pack-elasticsearch:plugin:core')
evaluationDependsOn(xpackModule('core'))
apply plugin: 'elasticsearch.esplugin'
esplugin {
@ -8,8 +8,6 @@ esplugin {
hasNativeController false
requiresKeystore true
extendedPlugins = ['x-pack-core']
licenseFile project(':x-pack-elasticsearch').file('LICENSE.txt')
noticeFile project(':x-pack-elasticsearch').file('NOTICE.txt')
}
archivesBaseName = 'x-pack-security'
@ -21,9 +19,9 @@ dependencies {
compileOnly project(path: ':modules:transport-netty4', configuration: 'runtime')
provided project(path: ':plugins:transport-nio', configuration: 'runtime')
testCompile project(path: ':x-pack-elasticsearch:plugin:monitoring')
testCompile project(path: xpackModule('monitoring'))
testCompile project(path: ':x-pack-elasticsearch:plugin:core', configuration: 'testArtifacts')
testCompile project(path: xpackModule('core'), configuration: 'testArtifacts')
//compile project(path: ':modules:transport-netty4')
compile 'com.unboundid:unboundid-ldapsdk:3.2.0'
@ -220,7 +218,7 @@ if (JavaVersion.current() > JavaVersion.VERSION_1_8) {
}
run {
plugin ':x-pack-elasticsearch:plugin:core'
plugin xpackModule('core')
}
test {

View File

@ -22,6 +22,6 @@ dependencies {
// compile project(':x-pack-elasticsearch:sql:server')
}
//project(':x-pack-elasticsearch:plugin:core').bundlePlugin {
//project(xpackModule('core')).bundlePlugin {
// from jar
//}

View File

@ -1,7 +1,7 @@
import com.carrotsearch.gradle.junit4.RandomizedTestingTask
import org.elasticsearch.gradle.BuildPlugin
evaluationDependsOn(':x-pack-elasticsearch:plugin:core')
evaluationDependsOn(xpackModule('core'))
apply plugin: 'elasticsearch.esplugin'
esplugin {
@ -11,8 +11,6 @@ esplugin {
hasNativeController false
requiresKeystore false
extendedPlugins = ['x-pack-core']
licenseFile project(':x-pack-elasticsearch').file('LICENSE.txt')
noticeFile project(':x-pack-elasticsearch').file('NOTICE.txt')
}
archivesBaseName = 'x-pack-upgrade'
@ -20,7 +18,7 @@ archivesBaseName = 'x-pack-upgrade'
dependencies {
provided "org.elasticsearch:elasticsearch:${version}"
provided "org.elasticsearch.plugin:x-pack-core:${version}"
testCompile project(path: ':x-pack-elasticsearch:plugin:core', configuration: 'testArtifacts')
testCompile project(path: xpackModule('core'), configuration: 'testArtifacts')
}
compileJava.options.compilerArgs << "-Xlint:-deprecation,-rawtypes,-serial,-try,-unchecked"
@ -31,7 +29,7 @@ dependencyLicenses {
}
run {
plugin ':x-pack-elasticsearch:plugin:core'
plugin xpackModule('core')
}
integTest.enabled = false

View File

@ -1,4 +1,4 @@
evaluationDependsOn(':x-pack-elasticsearch:plugin:core')
evaluationDependsOn(xpackModule('core'))
apply plugin: 'elasticsearch.esplugin'
esplugin {
@ -8,8 +8,6 @@ esplugin {
hasNativeController false
requiresKeystore false
extendedPlugins = ['x-pack-core']
licenseFile project(':x-pack-elasticsearch').file('LICENSE.txt')
noticeFile project(':x-pack-elasticsearch').file('NOTICE.txt')
}
archivesBaseName = 'x-pack-watcher'
@ -31,7 +29,7 @@ dependencies {
provided project(path: ':modules:transport-netty4', configuration: 'runtime')
provided project(path: ':plugins:transport-nio', configuration: 'runtime')
testCompile project(path: ':x-pack-elasticsearch:plugin:core', configuration: 'testArtifacts')
testCompile project(path: xpackModule('core'), configuration: 'testArtifacts')
// watcher deps
compile 'com.googlecode.owasp-java-html-sanitizer:owasp-java-html-sanitizer:r239'
@ -101,7 +99,7 @@ if (JavaVersion.current() <= JavaVersion.VERSION_1_8) {
}
run {
plugin ':x-pack-elasticsearch:plugin:core'
plugin xpackModule('core')
}
test {

View File

@ -2,22 +2,22 @@ apply plugin: 'elasticsearch.standalone-rest-test'
apply plugin: 'elasticsearch.rest-test'
dependencies {
testCompile project(path: ':x-pack-elasticsearch:plugin:security', configuration: 'testArtifacts')
testCompile project(path: xpackModule('security'), configuration: 'testArtifacts')
}
String outputDir = "generated-resources/${project.name}"
task copyXPackPluginProps(type: Copy) { // wth is this?
from project(':x-pack-elasticsearch:plugin:core').file('src/main/plugin-metadata')
from project(':x-pack-elasticsearch:plugin:core').tasks.pluginProperties
from project(':x-pack-elasticsearch:plugin:security').file('src/main/plugin-metadata')
from project(':x-pack-elasticsearch:plugin:security').tasks.pluginProperties
from project(xpackModule('core')).file('src/main/plugin-metadata')
from project(xpackModule('core')).tasks.pluginProperties
from project(xpackModule('security')).file('src/main/plugin-metadata')
from project(xpackModule('security')).tasks.pluginProperties
into outputDir
}
project.sourceSets.test.output.dir(outputDir, builtBy: copyXPackPluginProps)
integTestCluster {
distribution 'zip'
plugin ':x-pack-elasticsearch:plugin'
plugin xpackProject('plugin').path
setting 'xpack.ml.enabled', 'false'
setting 'xpack.security.audit.enabled', 'true'
setting 'xpack.security.audit.outputs', 'index'

View File

@ -2,8 +2,8 @@ apply plugin: 'elasticsearch.standalone-rest-test'
apply plugin: 'elasticsearch.rest-test'
dependencies {
testCompile project(path: ':x-pack-elasticsearch:plugin:core', configuration: 'testArtifacts')
testCompile project(path: ':x-pack-elasticsearch:plugin:security', configuration: 'testArtifacts')
testCompile project(path: xpackModule('core'), configuration: 'testArtifacts')
testCompile project(path: xpackModule('security'), configuration: 'testArtifacts')
}
integTest {
@ -22,7 +22,7 @@ integTestRunner {
}
integTestCluster {
plugin ':x-pack-elasticsearch:plugin'
plugin xpackProject('plugin').path
setting 'xpack.watcher.enabled', 'false'
setting 'xpack.monitoring.enabled', 'false'
setting 'xpack.ml.enabled', 'false'

View File

@ -11,16 +11,16 @@ apply plugin: 'elasticsearch.build'
test.enabled = false
dependencies {
testCompile project(path: ':x-pack-elasticsearch:plugin:core', configuration: 'runtime')
testCompile (project(path: ':x-pack-elasticsearch:plugin:security', configuration: 'runtime')) {
testCompile project(path: xpackModule('core'), configuration: 'runtime')
testCompile (project(path: xpackModule('security'), configuration: 'runtime')) {
// Need to drop the guava dependency here or we get a conflict with watcher's guava dependency.
// This is total #$%, but the solution is to get the SAML realm (which uses guava) out of security proper
exclude group: "com.google.guava", module: "guava"
}
testCompile project(path: ':x-pack-elasticsearch:plugin:watcher', configuration: 'runtime')
testCompile project(path: xpackModule('watcher'), configuration: 'runtime')
testCompile project(path: ':x-pack-elasticsearch:plugin:core', configuration: 'testArtifacts')
testCompile (project(path: ':x-pack-elasticsearch:plugin:security', configuration: 'testArtifacts')) {
testCompile project(path: xpackModule('core'), configuration: 'testArtifacts')
testCompile (project(path: xpackModule('security'), configuration: 'testArtifacts')) {
// Need to drop the guava dependency here or we get a conflict with watcher's guava dependency.
// This is total #$%, but the solution is to get the SAML realm (which uses guava) out of security proper
exclude group: "com.google.guava", module: "guava"
@ -125,7 +125,7 @@ subprojects {
String output = "generated-resources/${project.name}"
task copyTestNodeKeystore(type: Copy) {
from project(':x-pack-elasticsearch:plugin:core')
from project(xpackModule('core'))
.file('src/test/resources/org/elasticsearch/xpack/security/transport/ssl/certs/simple/testnode.jks')
into outputDir
}
@ -140,7 +140,7 @@ subprojects {
Object extension = extensions.findByName("${baseName}#oldClusterTestCluster")
configure(extensions.findByName("${baseName}#oldClusterTestCluster")) {
dependsOn copyTestNodeKeystore
plugin ':x-pack-elasticsearch:plugin'
plugin xpackProject('plugin').path
distribution = 'zip'
bwcVersion = version
numBwcNodes = 2
@ -190,7 +190,7 @@ subprojects {
dependsOn oldClusterTestRunner,
"${baseName}#oldClusterTestCluster#node0.stop",
"${baseName}#oldClusterTestCluster#node1.stop"
plugin ':x-pack-elasticsearch:plugin'
plugin xpackProject('plugin').path
distribution = 'zip'
numNodes = 2
clusterName = 'full-cluster-restart'
@ -248,24 +248,24 @@ subprojects {
check.dependsOn(integTest)
dependencies {
testCompile project(path: ':x-pack-elasticsearch:plugin:core', configuration: 'runtime')
testCompile project(path: ':x-pack-elasticsearch:plugin:watcher', configuration: 'runtime')
testCompile project(path: ':x-pack-elasticsearch:plugin:core', configuration: 'testArtifacts')
testCompile project(path: ':x-pack-elasticsearch:plugin:security', configuration: 'testArtifacts')
testCompile project(path: xpackModule('core'), configuration: 'runtime')
testCompile project(path: xpackModule('watcher'), configuration: 'runtime')
testCompile project(path: xpackModule('core'), configuration: 'testArtifacts')
testCompile project(path: xpackModule('security'), configuration: 'testArtifacts')
}
// copy x-pack plugin info so it is on the classpath and security manager has the right permissions
task copyXPackRestSpec(type: Copy) {
dependsOn(project.configurations.restSpec, 'processTestResources')
from project(':x-pack-elasticsearch:plugin:core').sourceSets.test.resources
from project(xpackModule('core')).sourceSets.test.resources
include 'rest-api-spec/api/**'
into project.sourceSets.test.output.resourcesDir
}
task copyXPackPluginProps(type: Copy) {
dependsOn(copyXPackRestSpec)
from project(':x-pack-elasticsearch:plugin:core').file('src/main/plugin-metadata')
from project(':x-pack-elasticsearch:plugin:core').tasks.pluginProperties
from project(xpackModule('core')).file('src/main/plugin-metadata')
from project(xpackModule('core')).tasks.pluginProperties
into outputDir
}
project.sourceSets.test.output.dir(outputDir, builtBy: copyXPackPluginProps)

View File

@ -2,8 +2,8 @@ apply plugin: 'elasticsearch.standalone-rest-test'
apply plugin: 'elasticsearch.rest-test'
dependencies {
testCompile project(path: ':x-pack-elasticsearch:plugin:core', configuration: 'runtime')
testCompile project(path: ':x-pack-elasticsearch:plugin:ml', configuration: 'runtime')
testCompile project(path: xpackModule('core'), configuration: 'runtime')
testCompile project(path: xpackModule('ml'), configuration: 'runtime')
}
integTestCluster {
@ -13,5 +13,5 @@ integTestCluster {
setting 'xpack.ml.enabled', 'true'
numNodes = 3
distribution = 'zip'
plugin ':x-pack-elasticsearch:plugin'
plugin xpackProject('plugin').path
}

View File

@ -2,8 +2,8 @@ apply plugin: 'elasticsearch.standalone-rest-test'
apply plugin: 'elasticsearch.rest-test'
dependencies {
testCompile project(path: ':x-pack-elasticsearch:plugin:core', configuration: 'runtime')
testCompile project(path: ':x-pack-elasticsearch:plugin:ml', configuration: 'runtime')
testCompile project(path: xpackModule('core'), configuration: 'runtime')
testCompile project(path: xpackModule('ml'), configuration: 'runtime')
}
integTestCluster {
@ -11,5 +11,5 @@ integTestCluster {
setting 'xpack.ml.enabled', 'false'
numNodes = 1
distribution = 'zip'
plugin ':x-pack-elasticsearch:plugin'
plugin xpackProject('plugin').path
}

View File

@ -4,10 +4,10 @@ apply plugin: 'elasticsearch.standalone-rest-test'
apply plugin: 'elasticsearch.rest-test'
dependencies {
testCompile project(path: ':x-pack-elasticsearch:plugin:core', configuration: 'runtime')
testCompile project(path: ':x-pack-elasticsearch:plugin:core', configuration: 'testArtifacts')
testCompile project(path: ':x-pack-elasticsearch:plugin:ml', configuration: 'runtime')
testCompile project(path: ':x-pack-elasticsearch:plugin:ml', configuration: 'testArtifacts')
testCompile project(path: xpackModule('core'), configuration: 'runtime')
testCompile project(path: xpackModule('core'), configuration: 'testArtifacts')
testCompile project(path: xpackModule('ml'), configuration: 'runtime')
testCompile project(path: xpackModule('ml'), configuration: 'testArtifacts')
}
integTestRunner {
@ -59,7 +59,7 @@ integTestCluster {
setting 'xpack.security.transport.ssl.keystore.path', nodeKeystore.name
setting 'xpack.security.transport.ssl.verification_mode', 'certificate'
setting 'xpack.security.audit.enabled', 'true'
plugin ':x-pack-elasticsearch:plugin'
plugin xpackProject('plugin').path
keystoreSetting 'bootstrap.password', 'x-pack-test-password'
keystoreSetting 'xpack.security.transport.ssl.keystore.secure_password', 'keypass'

View File

@ -1,7 +1,7 @@
apply plugin: 'elasticsearch.standalone-test'
dependencies {
testCompile project(path: ':x-pack-elasticsearch:plugin:core', configuration: 'runtime')
testCompile project(path: ':x-pack-elasticsearch:plugin:ml', configuration: 'runtime')
testCompile project(path: xpackModule('core'), configuration: 'runtime')
testCompile project(path: xpackModule('ml'), configuration: 'runtime')
}

View File

@ -2,11 +2,11 @@ apply plugin: 'elasticsearch.standalone-rest-test'
apply plugin: 'elasticsearch.rest-test'
dependencies {
testCompile project(path: ':x-pack-elasticsearch:plugin:core', configuration: 'runtime')
testCompile project(path: ':x-pack-elasticsearch:plugin:ml', configuration: 'runtime')
testCompile project(path: xpackModule('core'), configuration: 'runtime')
testCompile project(path: xpackModule('ml'), configuration: 'runtime')
}
integTestCluster {
setting 'xpack.security.enabled', 'false'
plugin ':x-pack-elasticsearch:plugin'
plugin xpackProject('plugin').path
}

View File

@ -3,8 +3,8 @@ import org.elasticsearch.gradle.test.RestIntegTestTask
apply plugin: 'elasticsearch.standalone-test'
dependencies {
testCompile project(path: ':x-pack-elasticsearch:plugin:core', configuration: 'runtime')
testCompile project(path: ':x-pack-elasticsearch:plugin:core', configuration: 'testArtifacts')
testCompile project(path: xpackModule('core'), configuration: 'runtime')
testCompile project(path: xpackModule('core'), configuration: 'testArtifacts')
}
task remoteClusterTest(type: RestIntegTestTask) {
@ -16,7 +16,7 @@ remoteClusterTestCluster {
numNodes = 2
clusterName = 'remote-cluster'
setting 'search.remote.connect', false
plugin ':x-pack-elasticsearch:plugin'
plugin xpackProject('plugin').path
setting 'xpack.watcher.enabled', 'false'
setting 'xpack.monitoring.enabled', 'false'
setting 'xpack.ml.enabled', 'false'
@ -42,7 +42,7 @@ task mixedClusterTest(type: RestIntegTestTask) {}
mixedClusterTestCluster {
dependsOn remoteClusterTestRunner
plugin ':x-pack-elasticsearch:plugin'
plugin xpackProject('plugin').path
setting 'xpack.watcher.enabled', 'false'
setting 'xpack.monitoring.enabled', 'false'
setting 'xpack.ml.enabled', 'false'

View File

@ -2,14 +2,14 @@ apply plugin: 'elasticsearch.standalone-rest-test'
apply plugin: 'elasticsearch.rest-test'
dependencies {
testCompile project(path: ':x-pack-elasticsearch:plugin:core', configuration: 'runtime')
testCompile project(path: xpackModule('core'), configuration: 'runtime')
}
integTestCluster {
distribution = 'zip'
numNodes = 2
clusterName = 'multi-node'
plugin ':x-pack-elasticsearch:plugin'
plugin xpackProject('plugin').path
setting 'xpack.watcher.enabled', 'false'
setting 'xpack.monitoring.enabled', 'false'
setting 'xpack.ml.enabled', 'false'

View File

@ -1,10 +1,13 @@
Project idpFixtureProject = xpackProject("test:idp-fixture")
evaluationDependsOn(idpFixtureProject.path)
apply plugin: 'elasticsearch.standalone-test'
apply plugin: 'elasticsearch.vagrantsupport'
dependencies {
testCompile project(path: ':x-pack-elasticsearch:plugin:core', configuration: 'runtime')
testCompile project(path: ':x-pack-elasticsearch:plugin:security', configuration: 'testArtifacts')
testCompile project(path: ':x-pack-elasticsearch:plugin:core', configuration: 'testArtifacts')
testCompile project(path: xpackModule('core'), configuration: 'runtime')
testCompile project(path: xpackModule('security'), configuration: 'testArtifacts')
testCompile project(path: xpackModule('core'), configuration: 'testArtifacts')
}
processTestResources {
@ -16,18 +19,18 @@ processTestResources {
sourceSets {
test {
resources {
srcDirs += project(":x-pack-elasticsearch:test:idp-fixture").file("src/main/resources/provision/generated")
srcDirs += idpFixtureProject.file("src/main/resources/provision/generated")
}
}
}
task openLdapFixture {
dependsOn "vagrantCheckVersion", "virtualboxCheckVersion", ":x-pack-elasticsearch:test:idp-fixture:up"
dependsOn "vagrantCheckVersion", "virtualboxCheckVersion", idpFixtureProject.up
}
if (project.rootProject.vagrantSupported) {
test.dependsOn openLdapFixture
test.finalizedBy ":x-pack-elasticsearch:test:idp-fixture:halt"
test.finalizedBy idpFixtureProject.halt
} else {
test.enabled = false
}

View File

@ -2,14 +2,14 @@ apply plugin: 'elasticsearch.standalone-rest-test'
apply plugin: 'elasticsearch.rest-test'
dependencies {
testCompile project(path: ':x-pack-elasticsearch:plugin:core', configuration: 'runtime')
testCompile project(path: ':x-pack-elasticsearch:plugin:security', configuration: 'testArtifacts')
testCompile project(path: ':x-pack-elasticsearch:plugin:core', configuration: 'testArtifacts')
testCompile project(path: xpackModule('core'), configuration: 'runtime')
testCompile project(path: xpackModule('security'), configuration: 'testArtifacts')
testCompile project(path: xpackModule('core'), configuration: 'testArtifacts')
testCompile project(path: ':modules:reindex')
}
integTestCluster {
plugin ':x-pack-elasticsearch:plugin'
plugin xpackProject('plugin').path
// Whitelist reindexing from the local node so we can test it.
setting 'reindex.remote.whitelist', '127.0.0.1:*'
setting 'xpack.ml.enabled', 'false'

View File

@ -10,9 +10,9 @@ apply plugin: 'elasticsearch.build'
test.enabled = false
dependencies {
testCompile project(path: ':x-pack-elasticsearch:plugin:core', configuration: 'runtime')
testCompile project(path: ':x-pack-elasticsearch:plugin:security', configuration: 'runtime')
testCompile project(path: ':x-pack-elasticsearch:plugin:core', configuration: 'testArtifacts') // to be moved in a later commit
testCompile project(path: xpackModule('core'), configuration: 'runtime')
testCompile project(path: xpackModule('security'), configuration: 'runtime')
testCompile project(path: xpackModule('core'), configuration: 'testArtifacts') // to be moved in a later commit
}
Closure waitWithAuth = { NodeInfo node, AntBuilder ant ->
@ -100,7 +100,7 @@ subprojects {
String output = "generated-resources/${project.name}"
task copyTestNodeKeystore(type: Copy) {
from project(':x-pack-elasticsearch:plugin:core')
from project(xpackModule('core'))
.file('src/test/resources/org/elasticsearch/xpack/security/transport/ssl/certs/simple/testnode.jks')
into outputDir
}
@ -115,7 +115,7 @@ subprojects {
Object extension = extensions.findByName("${baseName}#oldClusterTestCluster")
configure(extensions.findByName("${baseName}#oldClusterTestCluster")) {
dependsOn copyTestNodeKeystore
plugin ':x-pack-elasticsearch:plugin'
plugin xpackProject('plugin').path
setupCommand 'setupTestUser', 'bin/x-pack/users', 'useradd', 'test_user', '-p', 'x-pack-test-password', '-r', 'superuser'
distribution = 'zip'
bwcVersion = version
@ -160,7 +160,7 @@ subprojects {
configure(extensions.findByName("${baseName}#mixedClusterTestCluster")) {
dependsOn oldClusterTestRunner, "${baseName}#oldClusterTestCluster#node1.stop"
plugin ':x-pack-elasticsearch:plugin'
plugin xpackProject('plugin').path
setupCommand 'setupTestUser', 'bin/x-pack/users', 'useradd', 'test_user', '-p', 'x-pack-test-password', '-r', 'superuser'
distribution = 'zip'
clusterName = 'rolling-upgrade'
@ -198,7 +198,7 @@ subprojects {
configure(extensions.findByName("${baseName}#upgradedClusterTestCluster")) {
dependsOn(mixedClusterTestRunner, "${baseName}#oldClusterTestCluster#node0.stop")
plugin ':x-pack-elasticsearch:plugin'
plugin xpackProject('plugin').path
setupCommand 'setupTestUser', 'bin/x-pack/users', 'useradd', 'test_user', '-p', 'x-pack-test-password', '-r', 'superuser'
distribution = 'zip'
clusterName = 'rolling-upgrade'
@ -266,9 +266,9 @@ subprojects {
check.dependsOn(integTest)
dependencies {
testCompile project(path: ':x-pack-elasticsearch:plugin:core', configuration: 'runtime')
testCompile project(path: ':x-pack-elasticsearch:plugin:core', configuration: 'testArtifacts')
testCompile project(path: ':x-pack-elasticsearch:plugin:watcher')
testCompile project(path: xpackModule('core'), configuration: 'runtime')
testCompile project(path: xpackModule('core'), configuration: 'testArtifacts')
testCompile project(path: xpackModule('watcher'))
}
compileTestJava.options.compilerArgs << "-Xlint:-cast,-deprecation,-rawtypes,-try,-unchecked"
@ -276,15 +276,15 @@ subprojects {
// copy x-pack plugin info so it is on the classpath and security manager has the right permissions
task copyXPackRestSpec(type: Copy) {
dependsOn(project.configurations.restSpec, 'processTestResources')
from project(':x-pack-elasticsearch:plugin').sourceSets.test.resources
from project(xpackProject('plugin').path).sourceSets.test.resources
include 'rest-api-spec/api/**'
into project.sourceSets.test.output.resourcesDir
}
task copyXPackPluginProps(type: Copy) {
dependsOn(copyXPackRestSpec)
from project(':x-pack-elasticsearch:plugin:core').file('src/main/plugin-metadata')
from project(':x-pack-elasticsearch:plugin:core').tasks.pluginProperties
from project(xpackModule('core')).file('src/main/plugin-metadata')
from project(xpackModule('core')).tasks.pluginProperties
into outputDir
}
project.sourceSets.test.output.dir(outputDir, builtBy: copyXPackPluginProps)

View File

@ -1,10 +1,13 @@
Project idpFixtureProject = xpackProject("test:idp-fixture")
evaluationDependsOn(idpFixtureProject.path)
apply plugin: 'elasticsearch.standalone-test'
apply plugin: 'elasticsearch.vagrantsupport'
dependencies {
testCompile project(path: ':x-pack-elasticsearch:plugin:core', configuration: 'runtime')
testCompile project(path: ':x-pack-elasticsearch:plugin:core', configuration: 'testArtifacts')
testCompile project(path: ':x-pack-elasticsearch:plugin:security', configuration: 'testArtifacts')
testCompile project(path: xpackModule('core'), configuration: 'runtime')
testCompile project(path: xpackModule('core'), configuration: 'testArtifacts')
testCompile project(path: xpackModule('security'), configuration: 'testArtifacts')
testCompile 'com.google.jimfs:jimfs:1.1'
}
@ -17,19 +20,19 @@ processTestResources {
sourceSets {
test {
resources {
srcDirs += project(":x-pack-elasticsearch:test:idp-fixture").file("src/main/resources/provision/generated")
srcDirs += project(':x-pack-elasticsearch:plugin:security').file('src/test/resources')
srcDirs += idpFixtureProject.file("src/main/resources/provision/generated")
srcDirs += project(xpackModule('security')).file('src/test/resources')
}
}
}
task idpFixture {
dependsOn "vagrantCheckVersion", "virtualboxCheckVersion", ":x-pack-elasticsearch:test:idp-fixture:up"
dependsOn "vagrantCheckVersion", "virtualboxCheckVersion", idpFixtureProject.up
}
if (project.rootProject.vagrantSupported) {
test.dependsOn idpFixture
test.finalizedBy ":x-pack-elasticsearch:test:idp-fixture:halt"
test.finalizedBy idpFixtureProject.halt
} else {
test.enabled = false
}

View File

@ -2,14 +2,14 @@ apply plugin: 'elasticsearch.standalone-rest-test'
apply plugin: 'elasticsearch.rest-test'
dependencies {
testCompile project(path: ':x-pack-elasticsearch:plugin:core', configuration: 'runtime')
testCompile project(path: ':x-pack-elasticsearch:transport-client', configuration: 'runtime')
testCompile project(path: xpackModule('core'), configuration: 'runtime')
testCompile project(path: xpackProject('transport-client').path, configuration: 'runtime')
}
String outputDir = "generated-resources/${project.name}"
task copyXPackPluginProps(type: Copy) {
from project(':x-pack-elasticsearch:plugin:core').file('src/main/plugin-metadata')
from project(':x-pack-elasticsearch:plugin:core').tasks.pluginProperties
from project(xpackModule('core')).file('src/main/plugin-metadata')
from project(xpackModule('core')).tasks.pluginProperties
into outputDir
}
project.sourceSets.test.output.dir(outputDir, builtBy: copyXPackPluginProps)
@ -19,7 +19,7 @@ integTestRunner {
}
integTestCluster {
plugin ':x-pack-elasticsearch:plugin'
plugin xpackProject('plugin').path
setting 'xpack.ml.enabled', 'false'
setupCommand 'setupDummyUser',
'bin/x-pack/users', 'useradd', 'test_user', '-p', 'x-pack-test-password', '-r', 'superuser'

View File

@ -8,8 +8,8 @@ esplugin {
}
dependencies {
provided project(path: ':x-pack-elasticsearch:plugin:core', configuration: 'runtime')
testCompile project(path: ':x-pack-elasticsearch:transport-client', configuration: 'runtime')
provided project(path: xpackModule('core'), configuration: 'runtime')
testCompile project(path: xpackProject('transport-client').path, configuration: 'runtime')
}
@ -19,7 +19,7 @@ integTestRunner {
integTestCluster {
dependsOn buildZip
plugin ':x-pack-elasticsearch:plugin'
plugin xpackProject('plugin').path
setting 'xpack.security.authc.realms.custom.order', '0'
setting 'xpack.security.authc.realms.custom.type', 'custom'
setting 'xpack.security.authc.realms.custom.filtered_setting', 'should be filtered'

View File

@ -2,13 +2,13 @@ apply plugin: 'elasticsearch.standalone-rest-test'
apply plugin: 'elasticsearch.rest-test'
dependencies {
testCompile project(path: ':x-pack-elasticsearch:plugin:core', configuration: 'runtime')
testCompile project(path: ':x-pack-elasticsearch:plugin:security', configuration: 'runtime')
testCompile project(path: ':x-pack-elasticsearch:transport-client', configuration: 'runtime')
testCompile project(path: xpackModule('core'), configuration: 'runtime')
testCompile project(path: xpackModule('security'), configuration: 'runtime')
testCompile project(path: xpackProject('transport-client').path, configuration: 'runtime')
}
integTestCluster {
plugin ':x-pack-elasticsearch:plugin'
plugin xpackProject('plugin').path
extraConfigFile 'x-pack/roles.yml', 'roles.yml'
[
test_admin: 'superuser',

View File

@ -2,9 +2,9 @@ apply plugin: 'elasticsearch.standalone-rest-test'
apply plugin: 'elasticsearch.rest-test'
dependencies {
testCompile project(path: ':x-pack-elasticsearch:plugin:core', configuration: 'runtime')
testCompile project(path: ':x-pack-elasticsearch:plugin:security', configuration: 'runtime')
testCompile project(path: ':x-pack-elasticsearch:plugin:core', configuration: 'testArtifacts')
testCompile project(path: xpackModule('core'), configuration: 'runtime')
testCompile project(path: xpackModule('security'), configuration: 'runtime')
testCompile project(path: xpackModule('core'), configuration: 'testArtifacts')
}
integTestRunner {
@ -12,7 +12,7 @@ integTestRunner {
}
integTestCluster {
plugin ':x-pack-elasticsearch:plugin'
plugin xpackProject('plugin').path
setupCommand 'setupTestAdmin',
'bin/x-pack/users', 'useradd', "test_admin", '-p', 'x-pack-test-password', '-r', "superuser"
waitCondition = { node, ant ->

View File

@ -1,14 +1,14 @@
apply plugin: 'elasticsearch.standalone-test'
dependencies {
testCompile project(':x-pack-elasticsearch:plugin:security')
testCompile project(path: ':x-pack-elasticsearch:plugin:security', configuration: 'testArtifacts')
testCompile project(xpackModule('security'))
testCompile project(path: xpackModule('security'), configuration: 'testArtifacts')
testCompile 'com.google.jimfs:jimfs:1.1'
testCompile 'com.google.guava:guava:16.0.1'
}
// add test resources from security, so certificate tool tests can use example certs
sourceSets.test.resources.srcDirs(project(':x-pack-elasticsearch:plugin:security').sourceSets.test.resources.srcDirs)
sourceSets.test.resources.srcDirs(project(xpackModule('security')).sourceSets.test.resources.srcDirs)
// we have to repeate these patterns because the security test resources are effectively in the src of this project
forbiddenPatterns {

View File

@ -2,19 +2,19 @@ apply plugin: 'elasticsearch.standalone-rest-test'
apply plugin: 'elasticsearch.rest-test'
dependencies {
testCompile project(path: ':x-pack-elasticsearch:plugin:core', configuration: 'runtime')
testCompile project(path: xpackModule('core'), configuration: 'runtime')
}
// bring in graph rest test suite
task copyGraphRestTests(type: Copy) {
into project.sourceSets.test.output.resourcesDir
from project(':x-pack-elasticsearch:plugin').sourceSets.test.resources.srcDirs
from project(xpackProject('plugin').path).sourceSets.test.resources.srcDirs
include 'rest-api-spec/test/graph/**'
}
integTestCluster {
dependsOn copyGraphRestTests
plugin ':x-pack-elasticsearch:plugin'
plugin xpackProject('plugin').path
extraConfigFile 'x-pack/roles.yml', 'roles.yml'
setupCommand 'setupTestAdminUser',
'bin/x-pack/users', 'useradd', 'test_admin', '-p', 'x-pack-test-password', '-r', 'superuser'

View File

@ -2,15 +2,15 @@ apply plugin: 'elasticsearch.standalone-rest-test'
apply plugin: 'elasticsearch.rest-test'
dependencies {
testCompile project(path: ':x-pack-elasticsearch:plugin:core', configuration: 'runtime')
testCompile project(path: ':x-pack-elasticsearch:plugin:core', configuration: 'testArtifacts')
testCompile project(path: ':x-pack-elasticsearch:plugin', configuration: 'testArtifacts')
testCompile project(path: xpackModule('core'), configuration: 'runtime')
testCompile project(path: xpackModule('core'), configuration: 'testArtifacts')
testCompile project(path: xpackProject('plugin').path, configuration: 'testArtifacts')
}
// bring in machine learning rest test suite
task copyMlRestTests(type: Copy) {
into project.sourceSets.test.output.resourcesDir
from project(':x-pack-elasticsearch:plugin').sourceSets.test.resources.srcDirs
from project(xpackProject('plugin').path).sourceSets.test.resources.srcDirs
include 'rest-api-spec/test/ml/**'
}
@ -91,7 +91,7 @@ integTestRunner {
integTestCluster {
dependsOn copyMlRestTests
plugin ':x-pack-elasticsearch:plugin'
plugin xpackProject('plugin').path
extraConfigFile 'x-pack/roles.yml', 'roles.yml'
setupCommand 'setupTestAdminUser',
'bin/x-pack/users', 'useradd', 'x_pack_rest_user', '-p', 'x-pack-test-password', '-r', 'superuser'

View File

@ -2,13 +2,13 @@ apply plugin: 'elasticsearch.standalone-rest-test'
apply plugin: 'elasticsearch.rest-test'
dependencies {
testCompile project(path: ':x-pack-elasticsearch:plugin:core')
testCompile project(path: ':x-pack-elasticsearch:plugin:watcher')
testCompile project(path: ':x-pack-elasticsearch:plugin:monitoring')
testCompile project(path: xpackModule('core'))
testCompile project(path: xpackModule('watcher'))
testCompile project(path: xpackModule('monitoring'))
}
integTestCluster {
plugin ':x-pack-elasticsearch:plugin'
plugin xpackProject('plugin').path
setting 'xpack.monitoring.enabled', 'true'
setting 'xpack.watcher.enabled', 'true'
setting 'xpack.security.enabled', 'false'

View File

@ -14,13 +14,13 @@ apply plugin: 'elasticsearch.standalone-rest-test'
apply plugin: 'elasticsearch.rest-test'
dependencies {
testCompile project(path: ':x-pack-elasticsearch:plugin:core', configuration: 'runtime')
testCompile project(path: xpackModule('core'), configuration: 'runtime')
}
String outputDir = "generated-resources/${project.name}"
task copyXPackPluginProps(type: Copy) {
from project(':x-pack-elasticsearch:plugin:core').file('src/main/plugin-metadata')
from project(':x-pack-elasticsearch:plugin:core').tasks.pluginProperties
from project(xpackModule('core')).file('src/main/plugin-metadata')
from project(xpackModule('core')).tasks.pluginProperties
into outputDir
}
project.sourceSets.test.output.dir(outputDir, builtBy: copyXPackPluginProps)
@ -160,7 +160,7 @@ integTestCluster.dependsOn(importClientCertificateInNodeKeyStore, importNodeCert
ext.pluginsCount = 0
project(':x-pack-elasticsearch:plugin').subprojects { Project p ->
project(xpackProject('plugin').path).subprojects { Project p ->
// the meta plugin contains the individual xpack plugins
if (p.extensions.findByName('esplugin') != null) {
pluginsCount += 1
@ -188,7 +188,7 @@ integTestCluster {
setting 'xpack.ml.enabled', 'false'
plugin ':x-pack-elasticsearch:plugin'
plugin xpackProject('plugin').path
// copy keystores into config/
extraConfigFile nodeKeystore.name, nodeKeystore

View File

@ -4,11 +4,11 @@ apply plugin: 'elasticsearch.standalone-rest-test'
apply plugin: 'elasticsearch.rest-test'
dependencies {
testCompile project(path: ':x-pack-elasticsearch:plugin:core', configuration: 'runtime')
testCompile project(path: xpackModule('core'), configuration: 'runtime')
}
ext.pluginsCount = 0
project(':x-pack-elasticsearch:plugin').subprojects { Project p ->
project(xpackProject('plugin').path).subprojects { Project p ->
// the meta plugin contains the individual xpack plugins
if (p.extensions.findByName('esplugin') != null) {
pluginsCount += 1
@ -21,7 +21,7 @@ project.rootProject.subprojects.findAll { it.path.startsWith(':plugins:') }.each
}
integTestCluster {
plugin ':x-pack-elasticsearch:plugin'
plugin xpackProject('plugin').path
setupCommand 'setupDummyUser',
'bin/x-pack/users', 'useradd', 'test_user', '-p', 'x-pack-test-password', '-r', 'superuser'

View File

@ -2,13 +2,13 @@ apply plugin: 'elasticsearch.standalone-rest-test'
apply plugin: 'elasticsearch.rest-test'
dependencies {
testCompile project(path: ':x-pack-elasticsearch:plugin:core', configuration: 'runtime')
testCompile project(path: ':x-pack-elasticsearch:plugin:core', configuration: 'testArtifacts')
testCompile project(path: xpackModule('core'), configuration: 'runtime')
testCompile project(path: xpackModule('core'), configuration: 'testArtifacts')
testCompile project(path: ':modules:lang-mustache', configuration: 'runtime')
}
integTestCluster {
plugin ':x-pack-elasticsearch:plugin'
plugin xpackProject('plugin').path
setting 'xpack.watcher.enabled', 'false'
setting 'xpack.monitoring.enabled', 'false'
setupCommand 'setupDummyUser',

View File

@ -2,13 +2,13 @@ apply plugin: 'elasticsearch.standalone-rest-test'
apply plugin: 'elasticsearch.rest-test'
dependencies {
testCompile project(path: ':x-pack-elasticsearch:plugin:core', configuration: 'runtime')
testCompile project(path: ':x-pack-elasticsearch:plugin:watcher', configuration: 'runtime')
testCompile project(path: xpackModule('core'), configuration: 'runtime')
testCompile project(path: xpackModule('watcher'), configuration: 'runtime')
testCompile project(path: ':modules:lang-mustache', configuration: 'runtime')
}
integTestCluster {
plugin ':x-pack-elasticsearch:plugin'
plugin xpackProject('plugin').path
setting 'xpack.security.enabled', 'false'
setting 'xpack.monitoring.enabled', 'false'
}

View File

@ -2,12 +2,12 @@ apply plugin: 'elasticsearch.standalone-rest-test'
apply plugin: 'elasticsearch.rest-test'
dependencies {
testCompile project(path: ':x-pack-elasticsearch:plugin:core', configuration: 'runtime')
testCompile project(path: xpackModule('core'), configuration: 'runtime')
testCompile project(path: ':modules:lang-painless', configuration: 'runtime')
}
integTestCluster {
plugin ':x-pack-elasticsearch:plugin'
plugin xpackProject('plugin').path
setting 'xpack.security.enabled', 'false'
setting 'xpack.monitoring.enabled', 'false'
}

View File

@ -2,13 +2,13 @@ apply plugin: 'elasticsearch.standalone-rest-test'
apply plugin: 'elasticsearch.rest-test'
dependencies {
testCompile project(path: ':x-pack-elasticsearch:plugin:core', configuration: 'runtime')
testCompile project(path: xpackModule('core'), configuration: 'runtime')
}
// bring in watcher rest test suite
task copyWatcherRestTests(type: Copy) {
into project.sourceSets.test.output.resourcesDir
from project(':x-pack-elasticsearch:plugin').sourceSets.test.resources.srcDirs
from project(xpackProject('plugin').path).sourceSets.test.resources.srcDirs
include 'rest-api-spec/test/watcher/**'
}
@ -28,7 +28,7 @@ integTestCluster {
setting 'xpack.notification.email.account._email.smtp.port', '587'
setting 'xpack.notification.email.account._email.smtp.user', '_user'
setting 'xpack.notification.email.account._email.smtp.password', '_passwd'
plugin ':x-pack-elasticsearch:plugin'
plugin xpackProject('plugin').path
extraConfigFile 'x-pack/roles.yml', 'roles.yml'
setupCommand 'setupTestAdminUser',
'bin/x-pack/users', 'useradd', 'test_admin', '-p', 'x-pack-test-password', '-r', 'superuser'

View File

@ -7,7 +7,7 @@ apply plugin: 'elasticsearch.standalone-rest-test'
apply plugin: 'elasticsearch.rest-test'
dependencies {
testCompile project(path: ':x-pack-elasticsearch:plugin:core', configuration: 'runtime')
testCompile project(path: xpackModule('core'), configuration: 'runtime')
}
ext {
@ -18,7 +18,7 @@ ext {
}
integTestCluster {
plugin ':x-pack-elasticsearch:plugin'
plugin xpackProject('plugin').path
setting 'xpack.security.enabled', 'false'
setting 'xpack.monitoring.enabled', 'false'
setting 'xpack.ml.enabled', 'false'

View File

@ -2,11 +2,11 @@ apply plugin: 'elasticsearch.standalone-rest-test'
apply plugin: 'elasticsearch.rest-test'
dependencies {
testCompile project(path: ':x-pack-elasticsearch:plugin:core', configuration: 'runtime')
testCompile project(path: ':x-pack-elasticsearch:transport-client', configuration: 'runtime')
testCompile project(path: xpackModule('core'), configuration: 'runtime')
testCompile project(path: xpackProject('transport-client').path, configuration: 'runtime')
}
integTestCluster {
setting 'xpack.security.enabled', 'false'
plugin ':x-pack-elasticsearch:plugin'
plugin xpackProject('plugin').path
}

View File

@ -8,19 +8,19 @@ apply plugin: 'elasticsearch.rest-test'
dependencies {
testCompile project(path: ':modules:tribe', configuration: 'runtime')
testCompile project(path: ':x-pack-elasticsearch:plugin', configuration: 'testArtifacts')
testCompile project(path: xpackProject('plugin').path, configuration: 'testArtifacts')
// TODO: remove all these test deps, this is completely bogus, guava is being force upgraded
testCompile project(path: ':x-pack-elasticsearch:plugin:deprecation', configuration: 'runtime')
testCompile project(path: ':x-pack-elasticsearch:plugin:graph', configuration: 'runtime')
testCompile project(path: ':x-pack-elasticsearch:plugin:logstash', configuration: 'runtime')
testCompile project(path: ':x-pack-elasticsearch:plugin:ml', configuration: 'runtime')
testCompile project(path: ':x-pack-elasticsearch:plugin:monitoring', configuration: 'runtime')
testCompile project(path: ':x-pack-elasticsearch:plugin:security', configuration: 'runtime')
testCompile project(path: ':x-pack-elasticsearch:plugin:upgrade', configuration: 'runtime')
testCompile project(path: ':x-pack-elasticsearch:plugin:watcher', configuration: 'runtime')
testCompile project(path: ':x-pack-elasticsearch:plugin:core', configuration: 'testArtifacts')
testCompile project(path: ':x-pack-elasticsearch:plugin:monitoring', configuration: 'testArtifacts')
testCompile project(path: xpackModule('deprecation'), configuration: 'runtime')
testCompile project(path: xpackModule('graph'), configuration: 'runtime')
testCompile project(path: xpackModule('logstash'), configuration: 'runtime')
testCompile project(path: xpackModule('ml'), configuration: 'runtime')
testCompile project(path: xpackModule('monitoring'), configuration: 'runtime')
testCompile project(path: xpackModule('security'), configuration: 'runtime')
testCompile project(path: xpackModule('upgrade'), configuration: 'runtime')
testCompile project(path: xpackModule('watcher'), configuration: 'runtime')
testCompile project(path: xpackModule('core'), configuration: 'testArtifacts')
testCompile project(path: xpackModule('monitoring'), configuration: 'testArtifacts')
}
compileTestJava.options.compilerArgs << "-Xlint:-rawtypes,-unchecked"
@ -35,7 +35,7 @@ test {
include '**/*Tests.class'
}
String licensePath = project(':x-pack-elasticsearch:license-tools').projectDir.toPath().resolve('src/test/resources').toString()
String licensePath = xpackProject('license-tools').projectDir.toPath().resolve('src/test/resources').toString()
sourceSets {
test {
resources {
@ -53,7 +53,7 @@ ClusterConfiguration cluster1Config = new ClusterConfiguration(project)
cluster1Config.clusterName = 'cluster1'
cluster1Config.setting('node.name', 'cluster1-node1')
// x-pack
cluster1Config.plugin(':x-pack-elasticsearch:plugin')
cluster1Config.plugin(xpackProject('plugin').path)
cluster1Config.setting('xpack.monitoring.enabled', false)
cluster1Config.setting('xpack.security.enabled', false)
cluster1Config.setting('xpack.watcher.enabled', false)
@ -67,7 +67,7 @@ ClusterConfiguration cluster2Config = new ClusterConfiguration(project)
cluster2Config.clusterName = 'cluster2'
cluster2Config.setting('node.name', 'cluster2-node1')
// x-pack
cluster2Config.plugin(':x-pack-elasticsearch:plugin')
cluster2Config.plugin(xpackProject('plugin').path)
cluster2Config.setting('xpack.monitoring.enabled', false)
cluster2Config.setting('xpack.monitoring.enabled', false)
cluster2Config.setting('xpack.security.enabled', false)
@ -100,7 +100,7 @@ integTestCluster {
setting 'tribe.cluster2.xpack.graph.enabled', false
setting 'tribe.cluster2.xpack.ml.enabled', false
// x-pack
plugin ':x-pack-elasticsearch:plugin'
plugin xpackProject('plugin').path
setting 'xpack.monitoring.enabled', false
setting 'xpack.monitoring.enabled', false
setting 'xpack.security.enabled', false

View File

@ -8,9 +8,9 @@ apply plugin: 'elasticsearch.rest-test'
dependencies {
testCompile project(path: ':modules:tribe', configuration: 'runtime')
testCompile project(path: ':x-pack-elasticsearch:plugin:core', configuration: 'runtime')
testCompile project(path: ':x-pack-elasticsearch:plugin:core', configuration: 'testArtifacts')
testCompile project(path: ':x-pack-elasticsearch:plugin:security', configuration: 'testArtifacts')
testCompile project(path: xpackModule('core'), configuration: 'runtime')
testCompile project(path: xpackModule('core'), configuration: 'testArtifacts')
testCompile project(path: xpackModule('security'), configuration: 'testArtifacts')
testCompile project(path: ':modules:analysis-common', configuration: 'runtime')
}
@ -18,7 +18,7 @@ namingConventions.skipIntegTestInDisguise = true
compileTestJava.options.compilerArgs << "-Xlint:-try"
String xpackPath = project(':x-pack-elasticsearch:plugin:core').projectDir.toPath().resolve('src/test/resources').toString()
String xpackPath = project(xpackModule('core')).projectDir.toPath().resolve('src/test/resources').toString()
sourceSets {
test {
resources {
@ -40,7 +40,7 @@ configOne.clusterName = 'cluster1'
configOne.setting('node.name', 'cluster1-node1')
configOne.setting('xpack.monitoring.enabled', false)
configOne.setting('xpack.ml.enabled', false)
configOne.plugin(':x-pack-elasticsearch:plugin')
configOne.plugin(xpackProject('plugin').path)
configOne.module(project.project(':modules:analysis-common'))
configOne.setupCommand('setupDummyUser',
'bin/x-pack/users', 'useradd', 'test_user', '-p', 'x-pack-test-password', '-r', 'superuser')
@ -62,7 +62,7 @@ configTwo.clusterName = 'cluster2'
configTwo.setting('node.name', 'cluster2-node1')
configTwo.setting('xpack.monitoring.enabled', false)
configTwo.setting('xpack.ml.enabled', false)
configTwo.plugin(':x-pack-elasticsearch:plugin')
configTwo.plugin(xpackProject('plugin').path)
configTwo.module(project.project(':modules:analysis-common'))
configTwo.setupCommand('setupDummyUser',
'bin/x-pack/users', 'useradd', 'test_user', '-p', 'x-pack-test-password', '-r', 'superuser')
@ -80,7 +80,7 @@ List<NodeInfo> cluster2Nodes = ClusterFormationTasks.setup(project, 'clusterTwo'
integTestCluster {
dependsOn setupClusterOne, setupClusterTwo
plugin ':x-pack-elasticsearch:plugin'
plugin xpackProject('plugin').path
setupCommand 'setupDummyUser',
'bin/x-pack/users', 'useradd', 'test_user', '-p', 'x-pack-test-password', '-r', 'superuser'
setting 'xpack.monitoring.enabled', false

View File

@ -12,7 +12,7 @@ esvagrant {
dependencies {
// Packaging tests use the x-pack meta plugin
bats project(path: ':x-pack-elasticsearch:plugin', configuration: 'zip')
bats project(path: xpackProject('plugin').path, configuration: 'zip')
// Inherit Bats test utils from :qa:vagrant project
bats project(path: ':qa:vagrant', configuration: 'bats')