Apply 2-space indent to all gradle scripts (#48849)

Closes #48724. Update `.editorconfig` to make the Java settings the default
for all files, and then apply a 2-space indent to all `*.gradle` files.
Then reformat all the files.
This commit is contained in:
Rory Hunter 2019-11-13 10:14:04 +00:00 committed by GitHub
parent fbaf8c428d
commit 3a3e5f6176
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
184 changed files with 4122 additions and 4120 deletions

View file

@ -1,5 +1,5 @@
import com.bettercloud.vault.VaultConfig;
import com.bettercloud.vault.Vault;
import com.bettercloud.vault.VaultConfig
import com.bettercloud.vault.Vault
initscript {
repositories {
@ -10,7 +10,7 @@ initscript {
}
}
boolean USE_ARTIFACTORY=false
boolean USE_ARTIFACTORY = false
if (System.getenv('VAULT_ADDR') == null) {
throw new GradleException("You must set the VAULT_ADDR environment variable to use this init script.")
@ -26,11 +26,11 @@ final String vaultToken = System.getenv('VAULT_TOKEN') ?: new Vault(
.address(System.env.VAULT_ADDR)
.engineVersion(1)
.build()
)
)
.withRetries(5, 1000)
.auth()
.loginByAppRole("approle", System.env.VAULT_ROLE_ID, System.env.VAULT_SECRET_ID)
.getAuthClientToken();
.getAuthClientToken()
final Vault vault = new Vault(
new VaultConfig()
@ -43,9 +43,9 @@ final Vault vault = new Vault(
if (USE_ARTIFACTORY) {
final Map<String,String> artifactoryCredentials = vault.logical()
final Map<String, String> artifactoryCredentials = vault.logical()
.read("secret/elasticsearch-ci/artifactory.elstc.co")
.getData();
.getData()
logger.info("Using elastic artifactory repos")
Closure configCache = {
return {
@ -91,9 +91,9 @@ final String buildCacheUrl = System.getProperty('org.elasticsearch.build.cache.u
final boolean buildCachePush = Boolean.valueOf(System.getProperty('org.elasticsearch.build.cache.push', 'false'))
if (buildCacheUrl) {
final Map<String,String> buildCacheCredentials = vault.logical()
final Map<String, String> buildCacheCredentials = vault.logical()
.read("secret/elasticsearch-ci/gradle-build-cache")
.getData();
.getData()
gradle.settingsEvaluated { settings ->
settings.buildCache {
local {

View file

@ -2,12 +2,15 @@
root = true
[*.java]
[*]
charset = utf-8
indent_style = space
indent_size = 4
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = space
indent_size = 4
[*.bat]
indent_size = 2
[*.gradle]
indent_size = 2

View file

@ -55,7 +55,7 @@ forbiddenApisMain.enabled = false
dependencyLicenses.enabled = false
dependenciesInfo.enabled = false
thirdPartyAudit.ignoreViolations (
thirdPartyAudit.ignoreViolations(
// these classes intentionally use JDK internal API (and this is ok since the project is maintained by Oracle employees)
'org.openjdk.jmh.profile.AbstractHotspotProfiler',
'org.openjdk.jmh.profile.HotspotThreadProfiler',

View file

@ -247,7 +247,7 @@ allprojects {
// the "value" -quiet is added, separated by a space. This is ok since the javadoc
// command already adds -quiet, so we are just duplicating it
// see https://discuss.gradle.org/t/add-custom-javadoc-option-that-does-not-take-an-argument/5959
javadoc.options.encoding='UTF8'
javadoc.options.encoding = 'UTF8'
javadoc.options.addStringOption('Xdoclint:all,-missing', '-quiet')
}
@ -411,7 +411,7 @@ allprojects {
// TODO: "package this up" for external builds
from new File(project.rootDir, 'buildSrc/src/main/resources/eclipse.settings')
into '.settings'
filter{ it.replaceAll('@@LICENSE_HEADER_TEXT@@', licenseHeader)}
filter { it.replaceAll('@@LICENSE_HEADER_TEXT@@', licenseHeader) }
}
// otherwise .settings is not nuked entirely
tasks.register('wipeEclipseSettings', Delete) {
@ -435,6 +435,7 @@ class Run extends DefaultTask {
project.project(':distribution').run.debug = enabled
}
}
task run(type: Run) {
dependsOn ':distribution:run'
description = 'Runs elasticsearch in the foreground'
@ -493,7 +494,7 @@ gradle.projectsEvaluated {
allprojects {
tasks.register('resolveAllDependencies') {
dependsOn tasks.matching { it.name == "pullFixture"}
dependsOn tasks.matching { it.name == "pullFixture" }
doLast {
configurations.findAll { it.isCanBeResolved() }.each { it.resolve() }
}

View file

@ -73,7 +73,7 @@ allprojects {
sourceSets {
// We have a few classes that need to be compiled for older java versions
minimumRuntime { }
minimumRuntime {}
}
compileMinimumRuntimeJava {
@ -256,7 +256,7 @@ class VersionPropertiesLoader {
elasticsearch
)
}
String qualifier = systemProperties.getProperty("build.version_qualifier", "");
String qualifier = systemProperties.getProperty("build.version_qualifier", "")
if (qualifier.isEmpty() == false) {
if (qualifier.matches("(alpha|beta|rc)\\d+") == false) {
throw new IllegalStateException("Invalid qualifier: " + qualifier)

View file

@ -1,4 +1,3 @@
String distroConfig = System.getProperty('tests.local_distro.config')
if (distroConfig != null) {
// setup the test distribution as an artifact of this project

View file

@ -1,4 +1,3 @@
project.gradle.projectsEvaluated {
// wire the jdk repo to wiremock
String fakeJdkRepo = Objects.requireNonNull(System.getProperty('tests.jdk_repo'))

View file

@ -38,7 +38,7 @@ task buildGZipTar(type: SymbolicLinkPreservingTar) { SymbolicLinkPreservingTar t
tar.compression = Compression.GZIP
tar.preserveFileTimestamps = preserveFileTimestamps
from fileTree(source)
doLast{
doLast {
println archiveFile.get().asFile.path
}
}
@ -47,7 +47,7 @@ task buildTar(type: SymbolicLinkPreservingTar) { SymbolicLinkPreservingTar tar -
tar.archiveExtension = 'tar'
tar.preserveFileTimestamps = preserveFileTimestamps
from fileTree(source)
doLast{
doLast {
println archiveFile.get().asFile.path
}
}

View file

@ -65,7 +65,7 @@ project(':tests_in_main') {
}
project (':valid_setup_with_base') {
project(':valid_setup_with_base') {
test {
include "**/*IT.class"
include "**/*Tests.class"

View file

@ -54,7 +54,7 @@ dependencies {
tasks.withType(CheckForbiddenApis) {
//client does not depend on server, so only jdk and http signatures should be checked
replaceSignatureFiles ('jdk-signatures', 'http-signatures')
replaceSignatureFiles('jdk-signatures', 'http-signatures')
}
forbiddenPatterns {
@ -69,7 +69,7 @@ forbiddenApisTest {
// 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
jarHell.enabled = false
testingConventions {
naming.clear()
@ -80,7 +80,7 @@ testingConventions {
}
}
thirdPartyAudit.ignoreMissingClasses (
thirdPartyAudit.ignoreMissingClasses(
//commons-logging optional dependencies
'org.apache.avalon.framework.logger.Logger',
'org.apache.log.Hierarchy',

View file

@ -69,7 +69,7 @@ dependencyLicenses {
// 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
jarHell.enabled = false
testingConventions {
naming.clear()
@ -80,14 +80,13 @@ testingConventions {
}
}
dependencyLicenses {
dependencies = project.configurations.runtime.fileCollection {
it.group.startsWith('org.elasticsearch') == false
}
}
thirdPartyAudit.ignoreMissingClasses (
thirdPartyAudit.ignoreMissingClasses(
//commons-logging optional dependencies
'org.apache.avalon.framework.logger.Logger',
'org.apache.log.Hierarchy',

View file

@ -45,7 +45,7 @@ forbiddenApisTest {
// 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
jarHell.enabled = false
// TODO: should we have licenses for our test deps?
dependencyLicenses.enabled = false

View file

@ -27,6 +27,7 @@ import org.elasticsearch.gradle.tar.SymbolicLinkPreservingTar
import java.nio.file.Files
import java.nio.file.Path
// need this so Zip/Tar tasks get basic defaults...
apply plugin: 'base'
@ -38,7 +39,7 @@ task createLogsDir(type: EmptyDirTask) {
dir = "${logsDir}"
dirMode = 0755
}
ext.pluginsDir= new File(buildDir, 'plugins-hack/plugins')
ext.pluginsDir = new File(buildDir, 'plugins-hack/plugins')
task createPluginsDir(type: EmptyDirTask) {
dir = "${pluginsDir}"
dirMode = 0755

View file

@ -27,7 +27,7 @@ integTest.runner {
*/
if (System.getProperty("tests.rest.cluster") == null) {
nonInputProperties.systemProperty 'tests.logfile',
"${ -> testClusters.integTest.singleNode().getServerLog()}"
"${-> testClusters.integTest.singleNode().getServerLog()}"
} else {
systemProperty 'tests.logfile', '--external--'
}

View file

@ -36,9 +36,9 @@ apply plugin: 'elasticsearch.testclusters'
// Concatenates the dependencies CSV files into a single file
task generateDependenciesReport(type: ConcatFilesTask) {
files = fileTree(dir: project.rootDir, include: '**/dependencies.csv' )
files = fileTree(dir: project.rootDir, include: '**/dependencies.csv')
headerLine = "name,version,url,license"
target = new File(System.getProperty('csv')?: "${project.buildDir}/reports/dependencies/es-dependencies.csv")
target = new File(System.getProperty('csv') ?: "${project.buildDir}/reports/dependencies/es-dependencies.csv")
}
/*****************************************************************************
@ -559,7 +559,6 @@ subprojects {
'def': oss ? 'oss' : 'default'
],
'es.distribution.type': [
'deb': 'deb',
'rpm': 'rpm',
@ -606,8 +605,8 @@ subprojects {
}
}
['archives:windows-zip','archives:oss-windows-zip',
'archives:darwin-tar','archives:oss-darwin-tar',
['archives:windows-zip', 'archives:oss-windows-zip',
'archives:darwin-tar', 'archives:oss-darwin-tar',
'archives:linux-tar', 'archives:oss-linux-tar',
'archives:integ-test-zip',
'packages:rpm', 'packages:deb',

View file

@ -35,7 +35,8 @@ import static org.elasticsearch.gradle.BuildPlugin.getJavaHome
* unreleased versions are when Gradle projects are set up, so we use "build-unreleased-version-*" as placeholders
* and configure them to build various versions here.
*/
bwcVersions.forPreviousUnreleased { BwcVersions.UnreleasedVersionInfo unreleasedVersion -> project("${unreleasedVersion.gradleProjectPath}") {
bwcVersions.forPreviousUnreleased { BwcVersions.UnreleasedVersionInfo unreleasedVersion ->
project("${unreleasedVersion.gradleProjectPath}") {
Version bwcVersion = unreleasedVersion.version
String bwcBranch = unreleasedVersion.branch
apply plugin: 'distribution'
@ -215,7 +216,7 @@ bwcVersions.forPreviousUnreleased { BwcVersions.UnreleasedVersionInfo unreleased
}
Closure buildBwcTaskName = { projectName ->
return "buildBwc${projectName.replaceAll(/-\w/){ it[1].toUpperCase() }.capitalize()}"
return "buildBwc${projectName.replaceAll(/-\w/) { it[1].toUpperCase() }.capitalize()}"
}
task buildBwc {}
@ -312,7 +313,8 @@ bwcVersions.forPreviousUnreleased { BwcVersions.UnreleasedVersionInfo unreleased
}
// make sure no dependencies were added to assemble; we want it to be a no-op
assemble.dependsOn = []
}}
}
}
class IndentingOutputStream extends OutputStream {

View file

@ -38,11 +38,11 @@ ext.expansions = { oss, ubi, local ->
}
private static String buildPath(final boolean oss, final boolean ubi) {
return "build/${ oss ? 'oss-' : ''}${ ubi ? 'ubi-' : ''}docker"
return "build/${oss ? 'oss-' : ''}${ubi ? 'ubi-' : ''}docker"
}
private static String taskName(final String prefix, final boolean oss, final boolean ubi, final String suffix) {
return "${prefix}${oss ? 'Oss' : ''}${ubi ? 'Ubi': ''}${suffix}"
return "${prefix}${oss ? 'Oss' : ''}${ubi ? 'Ubi' : ''}${suffix}"
}
project.ext {
@ -89,7 +89,7 @@ void addCopyDockerContextTask(final boolean oss, final boolean ubi) {
}
}
def createAndSetWritable (Object... locations) {
def createAndSetWritable(Object... locations) {
locations.each { location ->
File file = file(location)
file.mkdirs()
@ -130,7 +130,7 @@ preProcessFixture {
}
processTestResources {
from ({ zipTree(configurations.restSpec.singleFile) }) {
from({ zipTree(configurations.restSpec.singleFile) }) {
include 'rest-api-spec/api/**'
}
from project(':x-pack:plugin:core')

View file

@ -92,6 +92,7 @@ void addProcessFilesTask(String type, boolean oss, boolean jdk) {
}
}
}
addProcessFilesTask('deb', true, true)
addProcessFilesTask('deb', true, false)
addProcessFilesTask('deb', false, true)
@ -111,7 +112,7 @@ Closure commonPackageConfig(String type, boolean oss, boolean jdk) {
}
dependsOn "process${oss ? 'Oss' : ''}${jdk ? '' : 'NoJdk'}${type.capitalize()}Files"
packageName "elasticsearch${oss ? '-oss' : ''}"
arch (type == 'deb' ? 'amd64' : 'X86_64')
arch(type == 'deb' ? 'amd64' : 'X86_64')
// Follow elasticsearch's file naming convention
String jdkString = jdk ? "" : "no-jdk-"
archiveName "${packageName}-${project.version}-${jdkString}${archString}.${type}"

View file

@ -131,7 +131,7 @@ Closure setupTwitter = { String name, int count ->
{"index":{"_id": "$i"}}
{"user": "$user", "message": "$text", "date": "2009-11-15T14:12:12", "likes": $i}"""
}
}
}
setupTwitter('twitter', 5)
setupTwitter('big_twitter', 120)
setupTwitter('huge_twitter', 1200)
@ -503,7 +503,7 @@ buildRestTests.setups['latency'] = '''
for (int i = 0; i < 100; i++) {
def value = i
if (i % 10) {
value = i*10
value = i * 10
}
buildRestTests.setups['latency'] += """
{"index":{}}

View file

@ -17,7 +17,7 @@ buildScan {
if (jobName) {
value 'Job name', jobName
}
if(buildNumber) {
if (buildNumber) {
value 'Job number', buildNumber
}

View file

@ -40,7 +40,7 @@ forbiddenApisMain {
replaceSignatureFiles 'jdk-signatures'
}
thirdPartyAudit.ignoreMissingClasses (
thirdPartyAudit.ignoreMissingClasses(
// from log4j
'org/osgi/framework/AdaptPermission',
'org/osgi/framework/AdminPermission',

View file

@ -46,7 +46,7 @@ forbiddenApisMain {
replaceSignatureFiles 'jdk-signatures'
}
thirdPartyAudit.ignoreMissingClasses (
thirdPartyAudit.ignoreMissingClasses(
// from com.fasterxml.jackson.dataformat.yaml.YAMLMapper (jackson-dataformat-yaml)
'com.fasterxml.jackson.databind.ObjectMapper',
)

View file

@ -26,7 +26,7 @@ esplugin {
dependencies {
// Upgrade to 2.10.0 or higher when jackson-core gets upgraded to 2.9.x. Blocked by #27032
compile ('com.maxmind.geoip2:geoip2:2.9.0')
compile('com.maxmind.geoip2:geoip2:2.9.0')
// geoip2 dependencies:
compile("com.fasterxml.jackson.core:jackson-annotations:${versions.jackson}")
compile("com.fasterxml.jackson.core:jackson-databind:2.8.11.3")
@ -36,7 +36,7 @@ dependencies {
}
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"
include "*.mmdb"
}
@ -49,7 +49,7 @@ bundlePlugin {
}
}
thirdPartyAudit.ignoreMissingClasses (
thirdPartyAudit.ignoreMissingClasses(
// geoip WebServiceClient needs apache http client, but we're not using WebServiceClient:
'org.apache.http.HttpEntity',
'org.apache.http.HttpHost',

View file

@ -17,6 +17,7 @@
* under the License.
*/
import org.elasticsearch.gradle.testclusters.DefaultTestClustersTask;
esplugin {
description 'An easy, safe and fast scripting language for Elasticsearch'
classname 'org.elasticsearch.painless.PainlessPlugin'

View file

@ -55,7 +55,7 @@ dependencies {
testCompile project(path: ':modules:parent-join', configuration: 'runtime')
}
thirdPartyAudit.ignoreMissingClasses (
thirdPartyAudit.ignoreMissingClasses(
// Commons logging
'javax.servlet.ServletContextEvent',
'javax.servlet.ServletContextListener',
@ -116,8 +116,8 @@ if (Os.isFamily(Os.FAMILY_WINDOWS)) {
dependsOn project.configurations.oldesFixture
dependsOn unzip
executable = "${BuildParams.runtimeJavaHome}/bin/java"
env 'CLASSPATH', "${ -> project.configurations.oldesFixture.asPath }"
env 'JAVA_HOME', "${ -> getJavaHome(it, 8)}"
env 'CLASSPATH', "${-> project.configurations.oldesFixture.asPath}"
env 'JAVA_HOME', "${-> getJavaHome(it, 8)}"
args 'oldes.OldElasticsearch',
baseDir,
unzip.temporaryDir,
@ -136,7 +136,7 @@ if (Os.isFamily(Os.FAMILY_WINDOWS)) {
/* Use a closure on the string to delay evaluation until right before we
* run the integration tests so that we can be sure that the file is
* ready. */
nonInputProperties.systemProperty "es${version}.port", "${ -> fixture.addressAndPort }"
nonInputProperties.systemProperty "es${version}.port", "${-> fixture.addressAndPort}"
}
}
}

View file

@ -35,7 +35,7 @@ task urlFixture(type: AntFixture) {
doFirst {
repositoryDir.mkdirs()
}
env 'CLASSPATH', "${ -> project.sourceSets.test.runtimeClasspath.asPath }"
env 'CLASSPATH', "${-> project.sourceSets.test.runtimeClasspath.asPath}"
executable = "${BuildParams.runtimeJavaHome}/bin/java"
args 'org.elasticsearch.repositories.url.URLFixture', baseDir, "${repositoryDir.absolutePath}"
}
@ -47,5 +47,7 @@ testClusters.integTest {
// repositoryDir is used by a FS repository to create snapshots
setting 'path.repo', "${repositoryDir.absolutePath}", PropertyNormalization.IGNORE_VALUE
// repositoryDir is used by two URL repositories to restore snapshots
setting 'repositories.url.allowed_urls', { "http://snapshot.test*,http://${urlFixture.addressAndPort}" }, PropertyNormalization.IGNORE_VALUE
setting 'repositories.url.allowed_urls', {
"http://snapshot.test*,http://${urlFixture.addressAndPort}"
}, PropertyNormalization.IGNORE_VALUE
}

View file

@ -82,7 +82,7 @@ testClusters.pooledIntegTest {
check.dependsOn(pooledTest, pooledIntegTest)
thirdPartyAudit {
ignoreMissingClasses (
ignoreMissingClasses(
// classes are missing
// from io.netty.handler.codec.protobuf.ProtobufDecoder (netty)
@ -175,7 +175,7 @@ thirdPartyAudit {
'org.conscrypt.HandshakeListener'
)
ignoreViolations (
ignoreViolations(
'io.netty.util.internal.PlatformDependent0',
'io.netty.util.internal.PlatformDependent0$1',
'io.netty.util.internal.PlatformDependent0$2',

View file

@ -34,7 +34,7 @@ dependencyLicenses {
mapping from: /morfologik-.*/, to: 'lucene'
}
thirdPartyAudit.ignoreMissingClasses (
thirdPartyAudit.ignoreMissingClasses(
// we don't use the morfologik-fsa polish stemmer
'morfologik.stemming.polish.PolishStemmer'
)

View file

@ -26,7 +26,7 @@ esplugin {
}
versions << [
'azure': '0.9.3',
'azure' : '0.9.3',
'jersey': '1.13'
]
@ -101,7 +101,7 @@ dependencyLicenses {
mapping from: /jaxb-.*/, to: 'jaxb'
}
thirdPartyAudit.ignoreMissingClasses (
thirdPartyAudit.ignoreMissingClasses(
'javax.activation.ActivationDataFlavor',
'javax.activation.DataContentHandler',
'javax.activation.DataHandler',

View file

@ -80,7 +80,7 @@ check {
dependsOn 'qa:amazon-ec2:check'
}
thirdPartyAudit.ignoreMissingClasses (
thirdPartyAudit.ignoreMissingClasses(
// classes are missing
'com.amazonaws.jmespath.JmesPathEvaluationVisitor',
'com.amazonaws.jmespath.JmesPathExpression',
@ -109,7 +109,7 @@ thirdPartyAudit.ignoreMissingClasses (
'org.apache.log.Logger'
)
thirdPartyAudit.ignoreMissingClasses (
thirdPartyAudit.ignoreMissingClasses(
'javax.xml.bind.DatatypeConverter',
'javax.xml.bind.JAXBContext'
)

View file

@ -60,7 +60,7 @@ integTest.enabled = false
['KeyStore', 'EnvVariables', 'SystemProperties', 'ContainerCredentials', 'InstanceProfile'].forEach { action ->
AntFixture fixture = tasks.create(name: "ec2Fixture${action}", type: AntFixture) {
dependsOn compileTestJava
env 'CLASSPATH', "${ -> project.sourceSets.test.runtimeClasspath.asPath }"
env 'CLASSPATH', "${-> project.sourceSets.test.runtimeClasspath.asPath}"
executable = "${BuildParams.runtimeJavaHome}/bin/java"
args 'org.elasticsearch.discovery.ec2.AmazonEC2Fixture', baseDir, "${buildDir}/testclusters/integTest${action}-1/config/unicast_hosts.txt"
}

View file

@ -35,7 +35,7 @@ test {
systemProperty 'tests.artifact', project.name
}
thirdPartyAudit.ignoreMissingClasses (
thirdPartyAudit.ignoreMissingClasses(
// classes are missing
'com.google.common.base.Splitter',
'com.google.common.collect.Lists',

View file

@ -36,7 +36,7 @@ dependencies {
/** A task to start the GCEFixture which emulates a GCE service **/
task gceFixture(type: AntFixture) {
dependsOn compileTestJava
env 'CLASSPATH', "${ -> project.sourceSets.test.runtimeClasspath.asPath }"
env 'CLASSPATH', "${-> project.sourceSets.test.runtimeClasspath.asPath}"
executable = "${BuildParams.runtimeJavaHome}/bin/java"
args 'org.elasticsearch.cloud.gce.GCEFixture', baseDir, "${buildDir}/testclusters/integTest-1/config/unicast_hosts.txt"
}

View file

@ -34,7 +34,7 @@ test.enabled = false
task exampleFixture(type: org.elasticsearch.gradle.test.AntFixture) {
dependsOn testClasses
env 'CLASSPATH', "${ -> project.sourceSets.test.runtimeClasspath.asPath }"
env 'CLASSPATH', "${-> project.sourceSets.test.runtimeClasspath.asPath}"
executable = "${BuildParams.runtimeJavaHome}/bin/java"
args 'org.elasticsearch.example.resthandler.ExampleFixture', baseDir, 'TEST'
}
@ -42,7 +42,7 @@ task exampleFixture(type: org.elasticsearch.gradle.test.AntFixture) {
integTest {
dependsOn exampleFixture
runner {
nonInputProperties.systemProperty 'external.address', "${ -> exampleFixture.addressAndPort }"
nonInputProperties.systemProperty 'external.address', "${-> exampleFixture.addressAndPort}"
}
}

View file

@ -25,9 +25,9 @@ esplugin {
}
versions << [
'tika': '1.22',
'tika' : '1.22',
'pdfbox': '2.0.16',
'poi': '4.0.1',
'poi' : '4.0.1',
'mime4j': '0.8.3'
]
@ -84,7 +84,7 @@ forbiddenPatterns {
exclude '**/*.vsdx'
}
thirdPartyAudit{
thirdPartyAudit {
ignoreMissingClasses()
}

View file

@ -41,13 +41,13 @@ dependencyLicenses {
}
thirdPartyAudit {
ignoreMissingClasses (
ignoreMissingClasses(
// Optional and not enabled by Elasticsearch
'org.slf4j.Logger',
'org.slf4j.LoggerFactory'
)
ignoreViolations (
ignoreViolations(
// uses internal java api: sun.misc.Unsafe
'com.google.common.cache.Striped64',
'com.google.common.cache.Striped64$1',

View file

@ -81,7 +81,7 @@ testClusters.integTest {
// Use a closure on the string to delay evaluation until tests are executed. The endpoint_suffix is used
// in a hacky way to change the protocol and endpoint. We must fix that.
setting 'azure.client.integration_test.endpoint_suffix',
{ "ignored;DefaultEndpointsProtocol=http;BlobEndpoint=${ -> azureAddress() }" }, IGNORE_VALUE
{ "ignored;DefaultEndpointsProtocol=http;BlobEndpoint=${-> azureAddress()}" }, IGNORE_VALUE
String firstPartOfSeed = BuildParams.testSeed.tokenize(':').get(0)
setting 'thread_pool.repository_azure.max', (Math.abs(Long.parseUnsignedLong(firstPartOfSeed, 16) % 10) + 1).toString(), System.getProperty('ignore.tests.seed') == null ? DEFAULT : IGNORE_VALUE
}

View file

@ -67,7 +67,7 @@ dependencyLicenses {
}
thirdPartyAudit {
ignoreViolations (
ignoreViolations(
// uses internal java api: sun.misc.Unsafe
'com.google.protobuf.UnsafeUtil',
'com.google.protobuf.UnsafeUtil$1',
@ -90,7 +90,7 @@ thirdPartyAudit {
'com.google.common.primitives.UnsignedBytes$LexicographicalComparatorHolder$UnsafeComparator$1',
)
ignoreMissingClasses (
ignoreMissingClasses(
'com.google.appengine.api.datastore.Blob',
'com.google.appengine.api.datastore.DatastoreService',
'com.google.appengine.api.datastore.DatastoreServiceFactory',

View file

@ -60,7 +60,7 @@ def encodedCredentials = {
}
def fixtureAddress = { fixture ->
assert useFixture : 'closure should not be used without a fixture'
assert useFixture: 'closure should not be used without a fixture'
int ephemeralPort = project(':test:fixtures:gcs-fixture').postProcessFixture.ext."test.fixtures.${fixture}.tcp.80"
assert ephemeralPort > 0
'http://127.0.0.1:' + ephemeralPort
@ -86,11 +86,11 @@ task createServiceAccountFile() {
}
}
task thirdPartyTest (type: Test) {
task thirdPartyTest(type: Test) {
if (useFixture) {
thirdPartyTest.dependsOn createServiceAccountFile
nonInputProperties.systemProperty 'test.google.endpoint', "${ -> fixtureAddress('gcs-fixture-third-party') }"
nonInputProperties.systemProperty 'test.google.tokenURI', "${ -> fixtureAddress('gcs-fixture-third-party') }/o/oauth2/token"
nonInputProperties.systemProperty 'test.google.endpoint', "${-> fixtureAddress('gcs-fixture-third-party')}"
nonInputProperties.systemProperty 'test.google.tokenURI', "${-> fixtureAddress('gcs-fixture-third-party')}/o/oauth2/token"
gradle.taskGraph.whenReady {
if (it.hasTask(gcsThirdPartyTests)) {
@ -104,7 +104,7 @@ task thirdPartyTest (type: Test) {
systemProperty 'tests.security.manager', false
systemProperty 'test.google.bucket', gcsBucket
systemProperty 'test.google.base', gcsBasePath + "_third_party_tests_" + BuildParams.testSeed
nonInputProperties.systemProperty 'test.google.account', "${ -> encodedCredentials.call() }"
nonInputProperties.systemProperty 'test.google.account', "${-> encodedCredentials.call()}"
}
task gcsThirdPartyTests {
@ -115,7 +115,7 @@ integTest.mustRunAfter(thirdPartyTest)
check.dependsOn thirdPartyTest
Map<String, Object> expansions = [
'bucket': gcsBucket,
'bucket' : gcsBucket,
'base_path': gcsBasePath + "_integration_tests"
]
@ -136,8 +136,8 @@ testClusters.integTest {
if (useFixture) {
tasks.integTest.dependsOn createServiceAccountFile
/* Use a closure on the string to delay evaluation until tests are executed */
setting 'gcs.client.integration_test.endpoint', { "${ -> fixtureAddress('gcs-fixture') }" }, IGNORE_VALUE
setting 'gcs.client.integration_test.token_uri', { "${ -> fixtureAddress('gcs-fixture') }/o/oauth2/token" }, IGNORE_VALUE
setting 'gcs.client.integration_test.endpoint', { "${-> fixtureAddress('gcs-fixture')}" }, IGNORE_VALUE
setting 'gcs.client.integration_test.token_uri', { "${-> fixtureAddress('gcs-fixture')}/o/oauth2/token" }, IGNORE_VALUE
} else {
println "Using an external service to test the repository-gcs plugin"
}

View file

@ -70,7 +70,7 @@ dependencies {
// Set the keytab files in the classpath so that we can access them from test code without the security manager
// freaking out.
if (isEclipse == false) {
testRuntime files(project(':test:fixtures:krb5kdc-fixture').ext.krb5Keytabs("hdfs","hdfs_hdfs.build.elastic.co.keytab").parent)
testRuntime files(project(':test:fixtures:krb5kdc-fixture').ext.krb5Keytabs("hdfs", "hdfs_hdfs.build.elastic.co.keytab").parent)
}
}
@ -95,7 +95,7 @@ for (String fixtureName : ['hdfsFixture', 'haHdfsFixture', 'secureHdfsFixture',
project.tasks.create(fixtureName, org.elasticsearch.gradle.test.AntFixture) {
dependsOn project.configurations.hdfsFixture, project(':test:fixtures:krb5kdc-fixture').tasks.postProcessFixture
executable = "${BuildParams.runtimeJavaHome}/bin/java"
env 'CLASSPATH', "${ -> project.configurations.hdfsFixture.asPath }"
env 'CLASSPATH', "${-> project.configurations.hdfsFixture.asPath}"
maxWaitInSeconds 60
onlyIf { project(':test:fixtures:krb5kdc-fixture').buildFixture.enabled && BuildParams.inFipsJvm == false }
waitCondition = { fixture, ant ->
@ -173,9 +173,9 @@ for (String integTestTaskName : ['integTestHa', 'integTestSecure', 'integTestSec
nonInputProperties.systemProperty "test.krb5.principal.es", "elasticsearch@${realm}"
nonInputProperties.systemProperty "test.krb5.principal.hdfs", "hdfs/hdfs.build.elastic.co@${realm}"
jvmArgs "-Djava.security.krb5.conf=${krb5conf}"
nonInputProperties.systemProperty (
nonInputProperties.systemProperty(
"test.krb5.keytab.hdfs",
project(':test:fixtures:krb5kdc-fixture').ext.krb5Keytabs("hdfs","hdfs_hdfs.build.elastic.co.keytab")
project(':test:fixtures:krb5kdc-fixture').ext.krb5Keytabs("hdfs", "hdfs_hdfs.build.elastic.co.keytab")
)
}
}
@ -275,7 +275,7 @@ integTestSecureHa.runner {
thirdPartyAudit {
ignoreMissingClasses()
ignoreViolations (
ignoreViolations(
// internal java api: sun.net.dns.ResolverConfiguration
// internal java api: sun.net.util.IPAddressUtil
'org.apache.hadoop.security.SecurityUtil$QualifiedHostResolver',

View file

@ -173,7 +173,7 @@ if (useFixture) {
thirdPartyTest {
dependsOn tasks.bundlePlugin, tasks.postProcessFixture
nonInputProperties.systemProperty 'test.s3.endpoint', "${ -> minioAddress.call() }"
nonInputProperties.systemProperty 'test.s3.endpoint', "${-> minioAddress.call()}"
}
task integTestMinio(type: RestIntegTestTask) {
@ -241,21 +241,21 @@ task s3Fixture(type: AntFixture) {
dependsOn s3FixtureProperties
inputs.file(s3FixtureFile)
env 'CLASSPATH', "${ -> project.sourceSets.test.runtimeClasspath.asPath }"
env 'CLASSPATH', "${-> project.sourceSets.test.runtimeClasspath.asPath}"
executable = "${BuildParams.runtimeJavaHome}/bin/java"
args 'org.elasticsearch.repositories.s3.AmazonS3Fixture', baseDir, s3FixtureFile.getAbsolutePath()
}
processTestResources {
Map<String, Object> expansions = [
'permanent_bucket': s3PermanentBucket,
'permanent_base_path': s3PermanentBasePath + "_integration_tests",
'temporary_bucket': s3TemporaryBucket,
'temporary_base_path': s3TemporaryBasePath + "_integration_tests",
'ec2_bucket': s3EC2Bucket,
'ec2_base_path': s3EC2BasePath,
'ecs_bucket': s3ECSBucket,
'ecs_base_path': s3ECSBasePath,
'permanent_bucket' : s3PermanentBucket,
'permanent_base_path' : s3PermanentBasePath + "_integration_tests",
'temporary_bucket' : s3TemporaryBucket,
'temporary_base_path' : s3TemporaryBasePath + "_integration_tests",
'ec2_bucket' : s3EC2Bucket,
'ec2_base_path' : s3EC2BasePath,
'ecs_bucket' : s3ECSBucket,
'ecs_base_path' : s3ECSBasePath,
'disable_chunked_encoding': s3DisableChunkedEncoding,
]
inputs.properties(expansions)
@ -319,7 +319,7 @@ if (useFixture) {
}
}
thirdPartyAudit.ignoreMissingClasses (
thirdPartyAudit.ignoreMissingClasses(
// classes are missing
'javax.servlet.ServletContextEvent',
'javax.servlet.ServletContextListener',

View file

@ -43,7 +43,7 @@ dependencyLicenses {
}
thirdPartyAudit {
ignoreMissingClasses (
ignoreMissingClasses(
// from io.netty.handler.codec.protobuf.ProtobufDecoder (netty)
'com.google.protobuf.ExtensionRegistry',
'com.google.protobuf.MessageLite$Builder',
@ -132,7 +132,7 @@ thirdPartyAudit {
'io.netty.internal.tcnative.SniHostNameMatcher',
)
ignoreViolations (
ignoreViolations(
'io.netty.util.internal.PlatformDependent0',
'io.netty.util.internal.PlatformDependent0$1',

View file

@ -1,4 +1,3 @@
import org.elasticsearch.gradle.test.RestIntegTestTask
import org.elasticsearch.gradle.testclusters.TestClustersPlugin

View file

@ -37,11 +37,11 @@ test {
}
thirdPartyAudit {
ignoreMissingClasses (
ignoreMissingClasses(
'com.ibm.icu.lang.UCharacter'
)
ignoreViolations (
ignoreViolations(
// uses internal java api: sun.misc.Unsafe
'com.google.common.cache.Striped64',
'com.google.common.cache.Striped64$1',

View file

@ -35,7 +35,7 @@ for (Version bwcVersion : bwcVersions.indexCompatible) {
testClusters {
"${baseName}" {
versions = [ bwcVersion.toString(), project.version ]
versions = [bwcVersion.toString(), project.version]
numberOfNodes = 2
// some tests rely on the translog not being flushed
setting 'indices.memory.shard_inactive_time', '20m'
@ -67,8 +67,8 @@ for (Version bwcVersion : bwcVersions.indexCompatible) {
tasks.matching { it.name.startsWith(baseName) && it.name.endsWith("ClusterTest") }.configureEach {
it.systemProperty 'tests.old_cluster_version', bwcVersion.toString().minus("-SNAPSHOT")
it.systemProperty 'tests.path.repo', "${buildDir}/cluster/shared/repo/${baseName}"
it.nonInputProperties.systemProperty('tests.rest.cluster', "${-> testClusters."${baseName}".allHttpSocketURI.join(",") }")
it.nonInputProperties.systemProperty('tests.clustername', "${-> testClusters."${baseName}".getName() }")
it.nonInputProperties.systemProperty('tests.rest.cluster', "${-> testClusters."${baseName}".allHttpSocketURI.join(",")}")
it.nonInputProperties.systemProperty('tests.clustername', "${-> testClusters."${baseName}".getName()}")
}
if (project.bwc_tests_enabled) {

View file

@ -1,4 +1,4 @@
/*
/*
* Licensed to Elasticsearch under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
@ -32,7 +32,7 @@ testClusters.integTest {
integTest.runner {
nonInputProperties.systemProperty 'tests.logfile',
"${ -> testClusters.integTest.singleNode().getServerLog().absolutePath.replaceAll(".json", ".log")}"
"${-> testClusters.integTest.singleNode().getServerLog().absolutePath.replaceAll(".json", ".log")}"
}
test {

View file

@ -39,14 +39,14 @@ dependencies {
}
processTestResources {
from ({ zipTree(configurations.restSpec.singleFile) })
from({ zipTree(configurations.restSpec.singleFile) })
dependsOn configurations.restSpec
}
for (Version bwcVersion : bwcVersions.wireCompatible) {
if (bwcVersion == VersionProperties.getElasticsearchVersion()) {
// Not really a mixed cluster
continue ;
continue;
}
String baseName = "v${bwcVersion}"
@ -55,7 +55,7 @@ for (Version bwcVersion : bwcVersions.wireCompatible) {
the nodes has a different minor. */
testClusters {
"${baseName}" {
versions = [ bwcVersion.toString(), project.version ]
versions = [bwcVersion.toString(), project.version]
numberOfNodes = 4
setting 'path.repo', "${buildDir}/cluster/shared/repo/${baseName}"
@ -69,16 +69,16 @@ for (Version bwcVersion : bwcVersions.wireCompatible) {
doFirst {
project.delete("${buildDir}/cluster/shared/repo/${baseName}")
// Getting the endpoints causes a wait for the cluster
println "Test cluster endpoints are: ${-> testClusters."${baseName}".allHttpSocketURI.join(",") }"
println "Test cluster endpoints are: ${-> testClusters."${baseName}".allHttpSocketURI.join(",")}"
println "Upgrading one node to create a mixed cluster"
testClusters."${baseName}".nextNodeToNextVersion()
// Getting the endpoints causes a wait for the cluster
println "Upgrade complete, endpoints are: ${-> testClusters."${baseName}".allHttpSocketURI.join(",") }"
println "Upgrade complete, endpoints are: ${-> testClusters."${baseName}".allHttpSocketURI.join(",")}"
println "Upgrading another node to create a mixed cluster"
testClusters."${baseName}".nextNodeToNextVersion()
nonInputProperties.systemProperty('tests.rest.cluster', "${-> testClusters."${baseName}".allHttpSocketURI.join(",") }")
nonInputProperties.systemProperty('tests.clustername', "${-> testClusters."${baseName}".getName() }")
nonInputProperties.systemProperty('tests.rest.cluster', "${-> testClusters."${baseName}".allHttpSocketURI.join(",")}")
nonInputProperties.systemProperty('tests.clustername', "${-> testClusters."${baseName}".getName()}")
}
systemProperty 'tests.path.repo', "${buildDir}/cluster/shared/repo/${baseName}"
onlyIf { project.bwc_tests_enabled }

View file

@ -51,7 +51,7 @@ testingConventions.enabled = false
tasks.dependencyLicenses.enabled = false
tasks.dependenciesInfo.enabled = false
tasks.thirdPartyAudit.ignoreMissingClasses ()
tasks.thirdPartyAudit.ignoreMissingClasses()
tasks.register('destructivePackagingTest') {
dependsOn 'destructiveDistroTest', 'destructiveBatsTest.oss', 'destructiveBatsTest.default'

View file

@ -40,7 +40,7 @@ dependencies {
}
processTestResources {
from ({ zipTree(configurations.restSpec.singleFile) }) {
from({ zipTree(configurations.restSpec.singleFile) }) {
include 'rest-api-spec/api/**'
}
dependsOn configurations.restSpec
@ -64,7 +64,7 @@ for (Version bwcVersion : bwcVersions.wireCompatible) {
testClusters {
"${baseName}" {
versions = [ bwcVersion.toString(), project.version ]
versions = [bwcVersion.toString(), project.version]
numberOfNodes = 3
setting 'repositories.url.allowed_urls', 'http://snapshot.test*'
@ -82,8 +82,8 @@ for (Version bwcVersion : bwcVersions.wireCompatible) {
project.delete("${buildDir}/cluster/shared/repo/${baseName}")
}
systemProperty 'tests.rest.suite', 'old_cluster'
nonInputProperties.systemProperty('tests.rest.cluster', "${-> testClusters."${baseName}".allHttpSocketURI.join(",") }")
nonInputProperties.systemProperty('tests.clustername', "${-> testClusters."${baseName}".getName() }")
nonInputProperties.systemProperty('tests.rest.cluster', "${-> testClusters."${baseName}".allHttpSocketURI.join(",")}")
nonInputProperties.systemProperty('tests.clustername', "${-> testClusters."${baseName}".getName()}")
}
tasks.register("${baseName}#oneThirdUpgradedTest", RestTestRunnerTask) {
@ -94,8 +94,8 @@ for (Version bwcVersion : bwcVersions.wireCompatible) {
}
systemProperty 'tests.rest.suite', 'mixed_cluster'
systemProperty 'tests.first_round', 'true'
nonInputProperties.systemProperty('tests.rest.cluster', "${-> testClusters."${baseName}".allHttpSocketURI.join(",") }")
nonInputProperties.systemProperty('tests.clustername', "${-> testClusters."${baseName}".getName() }")
nonInputProperties.systemProperty('tests.rest.cluster', "${-> testClusters."${baseName}".allHttpSocketURI.join(",")}")
nonInputProperties.systemProperty('tests.clustername', "${-> testClusters."${baseName}".getName()}")
}
tasks.register("${baseName}#twoThirdsUpgradedTest", RestTestRunnerTask) {
@ -106,8 +106,8 @@ for (Version bwcVersion : bwcVersions.wireCompatible) {
}
systemProperty 'tests.rest.suite', 'mixed_cluster'
systemProperty 'tests.first_round', 'false'
nonInputProperties.systemProperty('tests.rest.cluster', "${-> testClusters."${baseName}".allHttpSocketURI.join(",") }")
nonInputProperties.systemProperty('tests.clustername', "${-> testClusters."${baseName}".getName() }")
nonInputProperties.systemProperty('tests.rest.cluster', "${-> testClusters."${baseName}".allHttpSocketURI.join(",")}")
nonInputProperties.systemProperty('tests.clustername', "${-> testClusters."${baseName}".getName()}")
}
tasks.register("${baseName}#upgradedClusterTest", RestTestRunnerTask) {
@ -117,8 +117,8 @@ for (Version bwcVersion : bwcVersions.wireCompatible) {
}
useCluster testClusters."${baseName}"
systemProperty 'tests.rest.suite', 'upgraded_cluster'
nonInputProperties.systemProperty('tests.rest.cluster', "${-> testClusters."${baseName}".allHttpSocketURI.join(",") }")
nonInputProperties.systemProperty('tests.clustername', "${-> testClusters."${baseName}".getName() }")
nonInputProperties.systemProperty('tests.rest.cluster', "${-> testClusters."${baseName}".allHttpSocketURI.join(",")}")
nonInputProperties.systemProperty('tests.clustername', "${-> testClusters."${baseName}".getName()}")
}
if (project.bwc_tests_enabled) {

View file

@ -29,5 +29,5 @@ testClusters.integTest {
integTest.runner {
nonInputProperties.systemProperty 'tests.logfile',
"${ -> testClusters.integTest.singleNode().getServerLog() }"
"${-> testClusters.integTest.singleNode().getServerLog()}"
}

View file

@ -43,8 +43,8 @@ for (Version bwcVersion : bwcVersions.indexCompatible) {
tasks.register("${baseName}#integTest", RestTestRunnerTask) {
useCluster testClusters."${baseName}"
nonInputProperties.systemProperty('tests.rest.cluster', "${-> testClusters."${baseName}".allHttpSocketURI.join(",") }")
nonInputProperties.systemProperty('tests.clustername', "${-> testClusters."${baseName}".getName() }")
nonInputProperties.systemProperty('tests.rest.cluster', "${-> testClusters."${baseName}".allHttpSocketURI.join(",")}")
nonInputProperties.systemProperty('tests.clustername', "${-> testClusters."${baseName}".getName()}")
}
tasks.register("${baseName}#bwcTest") {

View file

@ -58,7 +58,7 @@ dependencies {
providedCompile 'javax.enterprise:cdi-api:1.2'
providedCompile 'org.jboss.spec.javax.annotation:jboss-annotations-api_1.2_spec:1.0.0.Final'
providedCompile 'org.jboss.spec.javax.ws.rs:jboss-jaxrs-api_2.0_spec:1.0.0.Final'
compile ('org.jboss.resteasy:resteasy-jackson2-provider:3.0.19.Final') {
compile('org.jboss.resteasy:resteasy-jackson2-provider:3.0.19.Final') {
exclude module: 'jackson-annotations'
exclude module: 'jackson-core'
exclude module: 'jackson-databind'

View file

@ -206,7 +206,7 @@ processResources {
dependsOn generateModulesList, generatePluginsList
}
thirdPartyAudit.ignoreMissingClasses (
thirdPartyAudit.ignoreMissingClasses(
// from com.fasterxml.jackson.dataformat.yaml.YAMLMapper (jackson-dataformat-yaml)
'com.fasterxml.jackson.databind.ObjectMapper',

View file

@ -83,7 +83,7 @@ void addSubProjects(String path, File dir) {
for (File subdir : dir.listFiles()) {
addSubProjects(projectName, subdir)
}
}
}
// include example plugins first, so adding plugin dirs below won't muck with :example-plugins

View file

@ -1,4 +1,3 @@
subprojects {
// fixtures are mostly external and by default we don't want to check forbidden apis
forbiddenApisMain.enabled = false

View file

@ -46,7 +46,7 @@ forbiddenApisMain {
dependencyLicenses.enabled = false
dependenciesInfo.enabled = false
thirdPartyAudit.ignoreMissingClasses (
thirdPartyAudit.ignoreMissingClasses(
// classes are missing
'javax.servlet.ServletContextEvent',
'javax.servlet.ServletContextListener',

View file

@ -33,7 +33,7 @@ forbiddenApisMain {
}
jarHell.enabled = true // disabled by parent project
thirdPartyAudit.ignoreMissingClasses (
thirdPartyAudit.ignoreMissingClasses(
// log4j
'org.osgi.framework.AdaptPermission',
'org.osgi.framework.AdminPermission',

View file

@ -14,7 +14,7 @@ archivesBaseName = 'x-pack-ccr'
integTest.enabled = false
// Integration Test classes that cannot run with the security manager
String[] noSecurityManagerITClasses = [ "**/CloseFollowerIndexIT.class" ]
String[] noSecurityManagerITClasses = ["**/CloseFollowerIndexIT.class"]
task internalClusterTestNoSecurityManager(type: Test) {
description = 'Java fantasy integration tests with no security manager'

View file

@ -56,9 +56,9 @@ testClusters."follow-cluster" {
setting 'xpack.monitoring.collection.enabled', 'true'
setting 'xpack.license.self_generated.type', 'trial'
setting 'cluster.remote.leader_cluster.seeds',
{ "\"${testClusters."leader-cluster".getAllTransportPortURI().join(",")}\""}
{ "\"${testClusters."leader-cluster".getAllTransportPortURI().join(",")}\"" }
setting 'cluster.remote.middle_cluster.seeds',
{ "\"${testClusters."middle-cluster".getAllTransportPortURI().join(",")}\""}
{ "\"${testClusters."middle-cluster".getAllTransportPortURI().join(",")}\"" }
}
check.dependsOn "follow-cluster"

View file

@ -23,7 +23,7 @@ testClusters.restTest {
setting 'xpack.security.enabled', 'true'
setting 'xpack.license.self_generated.type', 'trial'
// TODO: reduce the need for superuser here
user username:'ccr-user', password: 'ccr-user-password', role: 'superuser'
user username: 'ccr-user', password: 'ccr-user-password', role: 'superuser'
}
check.dependsOn restTest

View file

@ -133,7 +133,7 @@ artifacts {
testArtifacts testJar
}
thirdPartyAudit.ignoreMissingClasses (
thirdPartyAudit.ignoreMissingClasses(
//commons-logging optional dependencies
'org.apache.avalon.framework.logger.Logger',
'org.apache.log.Hierarchy',

View file

@ -5,7 +5,8 @@ apply plugin: 'elasticsearch.rest-test'
dependencies {
testCompile project(path: xpackModule('enrich'), configuration: 'runtime')
testCompile project(path: xpackModule('core'), configuration: 'runtime')
testCompile project(path: xpackModule('enrich:qa:common'), configuration: 'runtime')}
testCompile project(path: xpackModule('enrich:qa:common'), configuration: 'runtime')
}
testClusters.integTest {
testDistribution = 'DEFAULT'

View file

@ -176,7 +176,7 @@ forbiddenApisMain {
// classes are missing, e.g. com.ibm.icu.lang.UCharacter
thirdPartyAudit {
ignoreMissingClasses (
ignoreMissingClasses(
// SAML dependencies
// [missing classes] Some cli utilities that we don't use depend on these missing JCommander classes
'com.beust.jcommander.JCommander',
@ -279,7 +279,7 @@ thirdPartyAudit {
)
ignoreViolations (
ignoreViolations(
// Guava uses internal java api: sun.misc.Unsafe
'com.google.common.cache.Striped64',
'com.google.common.cache.Striped64$1',

View file

@ -10,13 +10,13 @@ esplugin {
ext {
// SQL dependency versions
jlineVersion="3.10.0"
antlrVersion="4.5.3"
jlineVersion = "3.10.0"
antlrVersion = "4.5.3"
// SQL test dependency versions
csvjdbcVersion="1.0.34"
h2Version="1.4.197"
h2gisVersion="1.5.0"
csvjdbcVersion = "1.0.34"
h2Version = "1.4.197"
h2gisVersion = "1.5.0"
}
configurations {
@ -60,7 +60,7 @@ dependencies {
* executable jar that can be moved wherever it is needed.
*/
bundlePlugin {
from (configurations.bin) {
from(configurations.bin) {
into 'bin'
}
}

View file

@ -12,16 +12,16 @@ forbiddenApisMain {
}
dependencies {
compile (xpackProject('plugin:sql:sql-client')) {
compile(xpackProject('plugin:sql:sql-client')) {
transitive = false
}
compile (xpackProject('plugin:sql:sql-proto')) {
compile(xpackProject('plugin:sql:sql-proto')) {
transitive = false
}
compile (project(':libs:elasticsearch-x-content')) {
compile(project(':libs:elasticsearch-x-content')) {
transitive = false
}
compile (project(':libs:elasticsearch-geo')) {
compile(project(':libs:elasticsearch-geo')) {
transitive = false
}
compile project(':libs:elasticsearch-core')

View file

@ -16,7 +16,7 @@ dependencies {
compile project(path: xpackModule('sql:sql-cli'))
// H2GIS testing dependencies
compile ("org.orbisgis:h2gis:${h2gisVersion}") {
compile("org.orbisgis:h2gis:${h2gisVersion}") {
exclude group: "org.locationtech.jts"
}
@ -77,7 +77,7 @@ subprojects {
testRuntime "com.h2database:h2:${h2Version}"
// H2GIS testing dependencies
testRuntime ("org.orbisgis:h2gis:${h2gisVersion}") {
testRuntime("org.orbisgis:h2gis:${h2gisVersion}") {
exclude group: "org.locationtech.jts"
exclude group: "com.fasterxml.jackson.core"
}
@ -92,7 +92,7 @@ subprojects {
// CLI testing dependencies
testRuntime project(path: xpackModule('sql:sql-cli'))
testRuntime (xpackProject('plugin:sql:sql-action')) {
testRuntime(xpackProject('plugin:sql:sql-action')) {
transitive = false
}

View file

@ -6,7 +6,7 @@ description = 'Run a subset of SQL tests against multiple nodes'
* feel should need to be tested against more than one node.
*/
testClusters.integTest{
testClusters.integTest {
numberOfNodes = 2
setting 'xpack.security.enabled', 'false'
setting 'xpack.license.self_generated.type', 'trial'

View file

@ -1,4 +1,3 @@
dependencies {
testCompile project(':x-pack:plugin:core')
}
@ -55,9 +54,9 @@ subprojects {
testClassesDirs += project.files(testArtifactsDir)
classpath += configurations.testArtifacts
nonInputProperties.systemProperty 'tests.audit.logfile',
"${ -> testClusters.integTest.singleNode().getAuditLog()}"
"${-> testClusters.integTest.singleNode().getAuditLog()}"
nonInputProperties.systemProperty 'tests.audit.yesterday.logfile',
"${ -> testClusters.integTest.singleNode().getAuditLog().getParentFile()}/integTest_audit-${new Date().format('yyyy-MM-dd')}.json"
"${-> testClusters.integTest.singleNode().getAuditLog().getParentFile()}/integTest_audit-${new Date().format('yyyy-MM-dd')}.json"
}
testingConventions.enabled = false

View file

@ -233,7 +233,7 @@ class SanEvaluator {
InetAddress address = list.get(i);
String hostAddress;
if (address instanceof Inet6Address) {
hostAddress = compressedIPV6Address((Inet6Address)address);
hostAddress = compressedIPV6Address((Inet6Address) address);
} else {
hostAddress = address.getHostAddress();
}

View file

@ -1,4 +1,3 @@
/*
* This project contains transport-level requests and responses that are shared between x-pack plugin and qa tests
*/
@ -10,13 +9,13 @@ description = 'Request and response objects shared by the cli, jdbc ' +
dependencies {
/* We'd like to just depend on xcontent but there are some bits of
* :server that we rely on.... */
compile (project(':server')) {
compile(project(':server')) {
transitive = false
}
compile (project(':libs:elasticsearch-core')) {
compile(project(':libs:elasticsearch-core')) {
transitive = false
}
compile (project(':libs:elasticsearch-x-content')) {
compile(project(':libs:elasticsearch-x-content')) {
transitive = false
}
compile xpackProject('plugin:sql:sql-proto')
@ -42,7 +41,7 @@ dependencyLicenses {
ignoreSha 'elasticsearch-core'
}
thirdPartyAudit.ignoreMissingClasses (
thirdPartyAudit.ignoreMissingClasses(
'com.fasterxml.jackson.dataformat.yaml.YAMLFactory',
'com.fasterxml.jackson.dataformat.yaml.YAMLMapper',

View file

@ -1,4 +1,3 @@
/*
* The minimal dependencies REST-based SQL client that is used by CLI and JDBC
*/

View file

@ -1,4 +1,3 @@
/*
* This project contains XContent protocol classes shared between server and http client
*/
@ -8,10 +7,10 @@ description = 'Request and response objects shared by the cli, jdbc ' +
'and the Elasticsearch plugin'
dependencies {
compile (project(':libs:elasticsearch-core')) {
compile(project(':libs:elasticsearch-core')) {
transitive = false
}
compile (project(':libs:elasticsearch-x-content')) {
compile(project(':libs:elasticsearch-x-content')) {
transitive = false
}
runtime "com.fasterxml.jackson.core:jackson-core:${versions.jackson}"

View file

@ -46,7 +46,7 @@ dependencies {
// classes are missing, e.g. com.ibm.icu.lang.UCharacter
thirdPartyAudit {
ignoreViolations (
ignoreViolations(
// uses internal java api: sun.misc.Unsafe
'com.google.common.cache.Striped64',
'com.google.common.cache.Striped64$1',

View file

@ -49,10 +49,10 @@ dependencies {
processTestResources {
dependsOn configurations.restSpec
from ({ zipTree(configurations.restSpec.singleFile) }) {
from({ zipTree(configurations.restSpec.singleFile) }) {
include 'rest-api-spec/api/**'
}
from (project(xpackModule('core')).sourceSets.test.resources) {
from(project(xpackModule('core')).sourceSets.test.resources) {
include 'rest-api-spec/api/**'
}
}
@ -120,8 +120,8 @@ for (Version bwcVersion : bwcVersions.indexCompatible) {
tasks.matching { it.name.startsWith(baseName) && it.name.endsWith("ClusterTest") }.configureEach {
it.systemProperty 'tests.old_cluster_version', bwcVersion.toString().minus("-SNAPSHOT")
it.systemProperty 'tests.path.repo', "${buildDir}/cluster/shared/repo/${baseName}"
it.nonInputProperties.systemProperty('tests.rest.cluster', "${-> testClusters."${baseName}".allHttpSocketURI.join(",") }")
it.nonInputProperties.systemProperty('tests.clustername', "${-> testClusters."${baseName}".getName() }")
it.nonInputProperties.systemProperty('tests.rest.cluster', "${-> testClusters."${baseName}".allHttpSocketURI.join(",")}")
it.nonInputProperties.systemProperty('tests.clustername', "${-> testClusters."${baseName}".getName()}")
}
tasks.register("${baseName}#bwcTest") {

View file

@ -24,10 +24,10 @@ dependencies {
processTestResources {
dependsOn configurations.restSpec
from ({ zipTree(configurations.restSpec.singleFile) }) {
from({ zipTree(configurations.restSpec.singleFile) }) {
include 'rest-api-spec/api/**'
}
from (project(xpackProject('plugin').path).sourceSets.test.resources) {
from(project(xpackProject('plugin').path).sourceSets.test.resources) {
include 'rest-api-spec/api/**'
}
}
@ -57,8 +57,8 @@ for (Version bwcVersion : bwcVersions.wireCompatible) {
mustRunAfter(precommit)
systemProperty 'tests.rest.suite', 'old_cluster'
systemProperty 'tests.upgrade_from_version', version.toString().replace('-SNAPSHOT', '')
nonInputProperties.systemProperty('tests.rest.cluster', "${-> testClusters."${baseName}".allHttpSocketURI.join(",") }")
nonInputProperties.systemProperty('tests.clustername', "${-> testClusters."${baseName}".getName() }")
nonInputProperties.systemProperty('tests.rest.cluster', "${-> testClusters."${baseName}".allHttpSocketURI.join(",")}")
nonInputProperties.systemProperty('tests.clustername', "${-> testClusters."${baseName}".getName()}")
}
@ -81,8 +81,8 @@ for (Version bwcVersion : bwcVersions.wireCompatible) {
doFirst {
testClusters."${baseName}".nextNodeToNextVersion()
}
nonInputProperties.systemProperty('tests.rest.cluster', "${-> testClusters."${baseName}".allHttpSocketURI.join(",") }")
nonInputProperties.systemProperty('tests.clustername', "${-> testClusters."${baseName}".getName() }")
nonInputProperties.systemProperty('tests.rest.cluster', "${-> testClusters."${baseName}".allHttpSocketURI.join(",")}")
nonInputProperties.systemProperty('tests.clustername', "${-> testClusters."${baseName}".getName()}")
systemProperty 'tests.rest.suite', 'mixed_cluster'
systemProperty 'tests.first_round', 'false'
systemProperty 'tests.upgrade_from_version', bwcVersion.toString().replace('-SNAPSHOT', '')
@ -94,8 +94,8 @@ for (Version bwcVersion : bwcVersions.wireCompatible) {
doFirst {
testClusters."${baseName}".nextNodeToNextVersion()
}
nonInputProperties.systemProperty('tests.rest.cluster', "${-> testClusters."${baseName}".allHttpSocketURI.join(",") }")
nonInputProperties.systemProperty('tests.clustername', "${-> testClusters."${baseName}".getName() }")
nonInputProperties.systemProperty('tests.rest.cluster', "${-> testClusters."${baseName}".allHttpSocketURI.join(",")}")
nonInputProperties.systemProperty('tests.clustername', "${-> testClusters."${baseName}".getName()}")
systemProperty 'tests.rest.suite', 'upgraded_cluster'
systemProperty 'tests.upgrade_from_version', bwcVersion.toString().replace('-SNAPSHOT', '')
}

View file

@ -24,10 +24,10 @@ dependencies {
processTestResources {
dependsOn configurations.restSpec
from ({ zipTree(configurations.restSpec.singleFile) }) {
from({ zipTree(configurations.restSpec.singleFile) }) {
include 'rest-api-spec/api/**'
}
from (project(xpackProject('plugin').path).sourceSets.test.resources) {
from(project(xpackProject('plugin').path).sourceSets.test.resources) {
include 'rest-api-spec/api/**'
}
}
@ -43,7 +43,7 @@ for (Version bwcVersion : bwcVersions.wireCompatible) {
numberOfNodes = 3
}
}
testClusters.matching{ it.name.startsWith(baseName)}.all {
testClusters.matching { it.name.startsWith(baseName) }.all {
testDistribution = "DEFAULT"
versions = [bwcVersion.toString(), project.version]
@ -57,18 +57,18 @@ for (Version bwcVersion : bwcVersions.wireCompatible) {
javaHome = BuildParams.runtimeJavaHome
}
tasks.withType(RestTestRunnerTask).matching{it.name.startsWith(baseName)}.configureEach {
tasks.withType(RestTestRunnerTask).matching { it.name.startsWith(baseName) }.configureEach {
useCluster testClusters."${baseName}-leader"
useCluster testClusters."${baseName}-follower"
systemProperty 'tests.upgrade_from_version', bwcVersion.toString().replace('-SNAPSHOT', '')
doFirst {
if (name.endsWith("#clusterTest") == false ) {
if (name.endsWith("#clusterTest") == false) {
println "Upgrade node $it"
testClusters."${baseName}-${kindExt}".nextNodeToNextVersion()
}
nonInputProperties.systemProperty('tests.rest.cluster', "${-> testClusters."${baseName}-${kindExt}".allHttpSocketURI.join(",") }")
nonInputProperties.systemProperty('tests.clustername', "${-> testClusters."${baseName}-${kindExt}".getName() }")
nonInputProperties.systemProperty('tests.rest.cluster', "${-> testClusters."${baseName}-${kindExt}".allHttpSocketURI.join(",")}")
nonInputProperties.systemProperty('tests.clustername', "${-> testClusters."${baseName}-${kindExt}".getName()}")
nonInputProperties.systemProperty('tests.leader_host', "${-> testClusters."${baseName}-leader".allHttpSocketURI.last()}")
nonInputProperties.systemProperty('tests.leader_remote_cluster_seed', "${-> testClusters."${baseName}-leader".allTransportPortURI.last()}")
nonInputProperties.systemProperty('tests.follower_host', "${-> testClusters."${baseName}-follower".allHttpSocketURI.last()}")

View file

@ -33,10 +33,10 @@ dependencies {
processTestResources {
dependsOn configurations.restSpec
from ({ zipTree(configurations.restSpec.singleFile) }) {
from({ zipTree(configurations.restSpec.singleFile) }) {
include 'rest-api-spec/api/**'
}
from (project(xpackProject('plugin').path).sourceSets.test.resources) {
from(project(xpackProject('plugin').path).sourceSets.test.resources) {
include 'rest-api-spec/api/**'
}
}
@ -53,7 +53,7 @@ for (Version bwcVersion : bwcVersions.wireCompatible) {
testClusters {
"${baseName}" {
testDistribution = "DEFAULT"
versions = [ bwcVersion.toString(), project.version ]
versions = [bwcVersion.toString(), project.version]
numberOfNodes = 3
setting 'repositories.url.allowed_urls', 'http://snapshot.test*'
@ -110,8 +110,8 @@ for (Version bwcVersion : bwcVersions.wireCompatible) {
dependsOn copyTestNodeKeyMaterial
systemProperty 'tests.rest.suite', 'old_cluster'
systemProperty 'tests.upgrade_from_version', version.toString().replace('-SNAPSHOT', '')
nonInputProperties.systemProperty('tests.rest.cluster', "${-> testClusters."${baseName}".allHttpSocketURI.join(",") }")
nonInputProperties.systemProperty('tests.clustername', "${-> testClusters."${baseName}".getName() }")
nonInputProperties.systemProperty('tests.rest.cluster', "${-> testClusters."${baseName}".allHttpSocketURI.join(",")}")
nonInputProperties.systemProperty('tests.clustername', "${-> testClusters."${baseName}".getName()}")
}
tasks.register("${baseName}#oneThirdUpgradedTest", RestTestRunnerTask) {
@ -120,8 +120,8 @@ for (Version bwcVersion : bwcVersions.wireCompatible) {
doFirst {
testClusters."${baseName}".nextNodeToNextVersion()
}
nonInputProperties.systemProperty('tests.rest.cluster', "${-> testClusters."${baseName}".allHttpSocketURI.join(",") }")
nonInputProperties.systemProperty('tests.clustername', "${-> testClusters."${baseName}".getName() }")
nonInputProperties.systemProperty('tests.rest.cluster', "${-> testClusters."${baseName}".allHttpSocketURI.join(",")}")
nonInputProperties.systemProperty('tests.clustername', "${-> testClusters."${baseName}".getName()}")
systemProperty 'tests.rest.suite', 'mixed_cluster'
systemProperty 'tests.first_round', 'true'
systemProperty 'tests.upgrade_from_version', bwcVersion.toString().replace('-SNAPSHOT', '')
@ -144,8 +144,8 @@ for (Version bwcVersion : bwcVersions.wireCompatible) {
doFirst {
testClusters."${baseName}".nextNodeToNextVersion()
}
nonInputProperties.systemProperty('tests.rest.cluster', "${-> testClusters."${baseName}".allHttpSocketURI.join(",") }")
nonInputProperties.systemProperty('tests.clustername', "${-> testClusters."${baseName}".getName() }")
nonInputProperties.systemProperty('tests.rest.cluster', "${-> testClusters."${baseName}".allHttpSocketURI.join(",")}")
nonInputProperties.systemProperty('tests.clustername', "${-> testClusters."${baseName}".getName()}")
systemProperty 'tests.rest.suite', 'mixed_cluster'
systemProperty 'tests.first_round', 'false'
systemProperty 'tests.upgrade_from_version', bwcVersion.toString().replace('-SNAPSHOT', '')
@ -157,8 +157,8 @@ for (Version bwcVersion : bwcVersions.wireCompatible) {
doFirst {
testClusters."${baseName}".nextNodeToNextVersion()
}
nonInputProperties.systemProperty('tests.rest.cluster', "${-> testClusters."${baseName}".allHttpSocketURI.join(",") }")
nonInputProperties.systemProperty('tests.clustername', "${-> testClusters."${baseName}".getName() }")
nonInputProperties.systemProperty('tests.rest.cluster', "${-> testClusters."${baseName}".allHttpSocketURI.join(",")}")
nonInputProperties.systemProperty('tests.clustername', "${-> testClusters."${baseName}".getName()}")
systemProperty 'tests.rest.suite', 'upgraded_cluster'
systemProperty 'tests.upgrade_from_version', bwcVersion.toString().replace('-SNAPSHOT', '')
}

View file

@ -92,7 +92,7 @@ forbiddenPatterns {
}
thirdPartyAudit {
ignoreViolations (
ignoreViolations(
// uses internal java api: sun.misc.Unsafe
'com.google.common.cache.Striped64',
'com.google.common.cache.Striped64$1',
@ -101,7 +101,7 @@ thirdPartyAudit {
'com.google.common.primitives.UnsignedBytes$LexicographicalComparatorHolder$UnsafeComparator$1'
)
ignoreMissingClasses (
ignoreMissingClasses(
'com.ibm.icu.lang.UCharacter'
)
}

View file

@ -59,7 +59,7 @@ def jiraIssues(projectKey) {
// See https://docs.atlassian.com/jira/REST/cloud/#api/2/search-search
def response = jiraHttpRequest("search?maxResults=100&fields=id,self,key&jql=project%3D${projectKey}", "GET", 200)
assert response.issues instanceof List
return response.issues.findAll {it.key.startsWith(projectKey)}.collect {it.key}
return response.issues.findAll { it.key.startsWith(projectKey) }.collect { it.key }
}
/** Execute an HTTP request against the Jira server instance **/

View file

@ -41,7 +41,7 @@ def encodedCredentials = {
Base64.encoder.encodeToString(Files.readAllBytes(file(gcsServiceAccount).toPath()))
}
task thirdPartyTest (type: Test) {
task thirdPartyTest(type: Test) {
include '**/GCSCleanupTests.class'
systemProperty 'tests.security.manager', false

View file

@ -36,7 +36,7 @@ if (!s3PermanentAccessKey && !s3PermanentSecretKey && !s3PermanentBucket && !s3P
throw new IllegalArgumentException("not all options specified to run against external S3 service as permanent credentials are present")
}
task thirdPartyTest (type: Test) {
task thirdPartyTest(type: Test) {
include '**/*.class'
systemProperty 'tests.security.manager', false
@ -83,7 +83,7 @@ if (useS3Fixture) {
thirdPartyTest {
dependsOn tasks.postProcessFixture
nonInputProperties.systemProperty 'test.s3.endpoint', "${ -> minioAddress.call() }"
nonInputProperties.systemProperty 'test.s3.endpoint', "${-> minioAddress.call()}"
}
gradle.taskGraph.whenReady {