mirror of
https://github.com/elastic/elasticsearch.git
synced 2025-04-24 15:17:30 -04:00
This commit adds a new test framework for configuring and orchestrating test clusters for both Java and YAML REST testing. This will eventually replace the existing "test-clusters" Gradle plugin and the build-time cluster orchestration.
52 lines
1.5 KiB
Groovy
52 lines
1.5 KiB
Groovy
|
|
|
|
apply plugin: 'elasticsearch.build'
|
|
apply plugin: 'elasticsearch.publish'
|
|
apply plugin: 'elasticsearch.rest-resources'
|
|
apply plugin: 'elasticsearch.validate-rest-spec'
|
|
apply plugin: 'elasticsearch.internal-yaml-rest-test'
|
|
|
|
restResources {
|
|
restTests {
|
|
includeCore '*'
|
|
}
|
|
}
|
|
|
|
// REST API specifications are published under the Apache 2.0 License
|
|
ext.projectLicenses.set(['The Apache Software License, Version 2.0': 'http://www.apache.org/licenses/LICENSE-2.0'])
|
|
licenseFile.set(rootProject.file('licenses/APACHE-LICENSE-2.0.txt'))
|
|
|
|
configurations {
|
|
// configuration to make use by external yaml rest test plugin in our examples
|
|
// easy and efficient
|
|
basicRestSpecs {
|
|
attributes {
|
|
attribute(ArtifactTypeDefinition.ARTIFACT_TYPE_ATTRIBUTE, ArtifactTypeDefinition.DIRECTORY_TYPE)
|
|
}
|
|
}
|
|
}
|
|
|
|
artifacts {
|
|
basicRestSpecs(new File(projectDir, "src/main/resources"))
|
|
restSpecs(new File(projectDir, "src/main/resources/rest-api-spec/api"))
|
|
restTests(new File(projectDir, "src/yamlRestTest/resources/rest-api-spec/test"))
|
|
}
|
|
|
|
dependencies {
|
|
clusterModules project(":modules:mapper-extras")
|
|
}
|
|
|
|
tasks.named("test").configure {enabled = false }
|
|
tasks.named("jarHell").configure {enabled = false }
|
|
|
|
tasks.register('enforceYamlTestConvention').configure {
|
|
doLast {
|
|
if (fileTree('src/main/resources/rest-api-spec/test').files) {
|
|
throw new GradleException("There are YAML tests in src/main source set. These should be moved to src/yamlRestTest.")
|
|
}
|
|
}
|
|
}
|
|
|
|
tasks.named("precommit").configure {
|
|
dependsOn 'enforceYamlTestConvention'
|
|
}
|