OpenSearch/x-pack/plugin/searchable-snapshots/qa/minio/build.gradle

54 lines
1.7 KiB
Groovy
Raw Normal View History

import org.elasticsearch.gradle.info.BuildParams
import static org.elasticsearch.gradle.PropertyNormalization.IGNORE_VALUE
apply plugin: 'elasticsearch.standalone-rest-test'
apply plugin: 'elasticsearch.rest-test'
apply plugin: 'elasticsearch.test.fixtures'
7.x - Create plugin for yamlTest task (#56841) (#59090) This commit creates a new Gradle plugin to provide a separate task name and source set for running YAML based REST tests. The only project converted to use the new plugin in this PR is distribution/archives/integ-test-zip. For which the testing has been moved to :rest-api-spec since it makes the most sense and it avoids a small but awkward change to the distribution plugin. The remaining cases in modules, plugins, and x-pack will be handled in followups. This plugin is distinctly different from the plugin introduced in #55896 since the YAML REST tests are intended to be black box tests over HTTP. As such they should not (by default) have access to the classpath for that which they are testing. The YAML based REST tests will be moved to separate source sets (yamlRestTest). The which source is the target for the test resources is dependent on if this new plugin is applied. If it is not applied, it will default to the test source set. Further, this introduces a breaking change for plugin developers that use the YAML testing framework. They will now need to either use the new source set and matching task, or configure the rest resources to use the old "test" source set that matches the old integTest task. (The former should be preferred). As part of this change (which is also breaking for plugin developers) the rest resources plugin has been removed from the build plugin and now requires either explicit application or application via the new YAML REST test plugin. Plugin developers should be able to fix the breaking changes to the YAML tests by adding apply plugin: 'elasticsearch.yaml-rest-test' and moving the YAML tests under a yamlRestTest folder (instead of test)
2020-07-06 15:16:26 -04:00
apply plugin: 'elasticsearch.rest-resources'
final Project fixture = project(':test:fixtures:minio-fixture')
final Project repositoryPlugin = project(':plugins:repository-s3')
dependencies {
testImplementation project(path: xpackModule('searchable-snapshots'), configuration: 'testArtifacts')
testImplementation repositoryPlugin
}
restResources {
restApi {
includeCore 'indices', 'search', 'bulk', 'snapshot', 'nodes', '_common'
includeXpack 'searchable_snapshots'
}
}
testFixtures.useFixture(fixture.path, 'minio-fixture-other')
def fixtureAddress = {
int ephemeralPort = fixture.postProcessFixture.ext."test.fixtures.minio-fixture-other.tcp.9000"
assert ephemeralPort > 0
'127.0.0.1:' + ephemeralPort
}
integTest {
dependsOn repositoryPlugin.bundlePlugin
runner {
systemProperty 'test.minio.bucket', 'bucket'
systemProperty 'test.minio.base_path', 'searchable_snapshots_tests'
}
}
testClusters.integTest {
testDistribution = 'DEFAULT'
plugin repositoryPlugin.bundlePlugin.archiveFile
if (BuildParams.isSnapshotBuild() == false) {
systemProperty 'es.searchable_snapshots_feature_enabled', 'true'
}
keystore 's3.client.searchable_snapshots.access_key', 'access_key'
keystore 's3.client.searchable_snapshots.secret_key', 'secret_key'
setting 'xpack.license.self_generated.type', 'trial'
setting 's3.client.searchable_snapshots.protocol', 'http'
setting 's3.client.searchable_snapshots.endpoint', { "${-> fixtureAddress()}" }, IGNORE_VALUE
}