mirror of
https://github.com/elastic/elasticsearch.git
synced 2025-04-19 04:45:07 -04:00
63 lines
2.4 KiB
Groovy
63 lines
2.4 KiB
Groovy
/*
|
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
* or more contributor license agreements. Licensed under the "Elastic License
|
|
* 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side
|
|
* Public License v 1"; you may not use this file except in compliance with, at
|
|
* your election, the "Elastic License 2.0", the "GNU Affero General Public
|
|
* License v3.0 only", or the "Server Side Public License, v 1".
|
|
*/
|
|
|
|
import org.elasticsearch.gradle.VersionProperties
|
|
import org.elasticsearch.gradle.testclusters.StandaloneRestIntegTestTask
|
|
|
|
apply plugin: 'elasticsearch.internal-testclusters'
|
|
apply plugin: 'elasticsearch.standalone-rest-test'
|
|
apply plugin: 'elasticsearch.bwc-test'
|
|
|
|
dependencies {
|
|
testImplementation project(':modules:rest-root')
|
|
}
|
|
|
|
buildParams.bwcVersions.withIndexCompatible { bwcVersion, baseName ->
|
|
def baseCluster = testClusters.register(baseName) {
|
|
version = bwcVersion.toString()
|
|
setting 'xpack.security.enabled', 'true'
|
|
user username: 'admin', password: 'admin-password', role: 'superuser'
|
|
}
|
|
|
|
tasks.register("${baseName}#integTest", StandaloneRestIntegTestTask) {
|
|
useCluster baseCluster
|
|
nonInputProperties.systemProperty('tests.rest.cluster', baseCluster.map(c -> c.allHttpSocketURI.join(",")))
|
|
nonInputProperties.systemProperty('tests.clustername', "${->baseCluster.get().getName()}")
|
|
}
|
|
|
|
tasks.register(bwcTaskName(bwcVersion)) {
|
|
dependsOn "${baseName}#integTest"
|
|
}
|
|
}
|
|
|
|
tasks.register("verifyDocsLuceneVersion") {
|
|
doFirst {
|
|
File docsVersionsFile = layout.settingsDirectory.file('docs/Versions.asciidoc').asFile
|
|
List<String> versionLines = docsVersionsFile.readLines('UTF-8')
|
|
String docsLuceneVersion = null
|
|
for (String line : versionLines) {
|
|
if (line.startsWith(':lucene_version:')) {
|
|
docsLuceneVersion = line.split()[1]
|
|
}
|
|
}
|
|
if (docsLuceneVersion == null) {
|
|
throw new GradleException('Could not find lucene version in docs version file')
|
|
}
|
|
String expectedLuceneVersion = VersionProperties.lucene
|
|
// remove potential -snapshot-{gitrev} suffix
|
|
expectedLuceneVersion -= ~/-snapshot-[0-9a-f]+$/
|
|
if (docsLuceneVersion != expectedLuceneVersion) {
|
|
throw new GradleException("Lucene version in docs [${docsLuceneVersion}] does not match version.properties [${expectedLuceneVersion}]")
|
|
}
|
|
}
|
|
}
|
|
|
|
tasks.named("check").configure {
|
|
dependsOn "verifyDocsLuceneVersion"
|
|
}
|