mirror of
https://github.com/elastic/elasticsearch.git
synced 2025-04-24 23:27:25 -04:00
[7.17] Use internal-java-rest-test in high level rest client (#86837)
This is 7.17 specific change before we can backport the deletion of the elasticsearch.rest-test plugin
This commit is contained in:
parent
41369f1594
commit
448ab34957
2 changed files with 37 additions and 7 deletions
|
@ -8,9 +8,8 @@ import org.elasticsearch.gradle.internal.info.BuildParams
|
|||
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
||||
* Side Public License, v 1.
|
||||
*/
|
||||
apply plugin: 'elasticsearch.internal-testclusters'
|
||||
apply plugin: 'elasticsearch.build'
|
||||
apply plugin: 'elasticsearch.rest-test'
|
||||
apply plugin: 'elasticsearch.internal-java-rest-test'
|
||||
apply plugin: 'elasticsearch.publish'
|
||||
apply plugin: 'elasticsearch.rest-resources'
|
||||
|
||||
|
@ -27,6 +26,25 @@ restResources {
|
|||
}
|
||||
}
|
||||
|
||||
configurations {
|
||||
javaRestTestImplementation {
|
||||
extendsFrom testImplementation
|
||||
}
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
javaRestTest {
|
||||
java {
|
||||
srcDir 'src/test/java'
|
||||
}
|
||||
resources {
|
||||
srcDir 'src/test/resources'
|
||||
}
|
||||
compileClasspath = main.output + compileClasspath
|
||||
runtimeClasspath = main.output + runtimeClasspath
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
api project(':server')
|
||||
api project(':client:rest')
|
||||
|
@ -71,20 +89,22 @@ def clusterUserNameProvider = providers.systemProperty('tests.rest.cluster.usern
|
|||
def clusterPasswordProvider = providers.systemProperty('tests.rest.cluster.password')
|
||||
.orElse('test-user-password')
|
||||
|
||||
tasks.named("integTest").configure {
|
||||
tasks.named("javaRestTest").configure {
|
||||
systemProperty 'tests.rest.async', 'false'
|
||||
systemProperty 'tests.rest.cluster.username', clusterUserNameProvider.get()
|
||||
systemProperty 'tests.rest.cluster.password', clusterPasswordProvider.get()
|
||||
}
|
||||
|
||||
TaskProvider<RestIntegTestTask> asyncIntegTest = tasks.register("asyncIntegTest", RestIntegTestTask) {
|
||||
TaskProvider<RestIntegTestTask> asyncJavaRestTest = tasks.register("asyncJavaRestTest", RestIntegTestTask) {
|
||||
systemProperty 'tests.rest.async', 'true'
|
||||
systemProperty 'tests.rest.cluster.username', clusterUserNameProvider.get()
|
||||
systemProperty 'tests.rest.cluster.password', clusterPasswordProvider.get()
|
||||
testClassesDirs = sourceSets.javaRestTest.output.classesDirs
|
||||
classpath = sourceSets.javaRestTest.runtimeClasspath
|
||||
}
|
||||
|
||||
tasks.named("check").configure {
|
||||
dependsOn(asyncIntegTest)
|
||||
dependsOn(asyncJavaRestTest)
|
||||
}
|
||||
|
||||
testClusters.configureEach {
|
||||
|
@ -129,3 +149,13 @@ tasks.named('splitPackagesAudit').configure {
|
|||
// the client package should be owned by the client, but server has some classes there too
|
||||
ignoreClasses 'org.elasticsearch.client.*'
|
||||
}
|
||||
|
||||
tasks.named('checkstyleJavaRestTest').configure {
|
||||
enabled = false
|
||||
}
|
||||
|
||||
// this check is incompatible with the internal-java-rest-test setup we did here
|
||||
// to not need to change the docs repo too. fine for 7.17
|
||||
tasks.named('testingConventions').configure {
|
||||
enabled = false
|
||||
}
|
||||
|
|
|
@ -450,9 +450,9 @@ public class SnapshotClientDocumentationIT extends ESRestHighLevelClientTestCase
|
|||
assertThat(1, equalTo(repositoryMetadataResponse.size()));
|
||||
final boolean async = Booleans.parseBoolean(System.getProperty("tests.rest.async", "false"));
|
||||
if (async) {
|
||||
assertThat("asyncIntegTest-0", equalTo(repositoryMetadataResponse.get(0).getName()));
|
||||
assertThat("asyncJavaRestTest-0", equalTo(repositoryMetadataResponse.get(0).getName()));
|
||||
} else {
|
||||
assertThat("integTest-0", equalTo(repositoryMetadataResponse.get(0).getName()));
|
||||
assertThat("javaRestTest-0", equalTo(repositoryMetadataResponse.get(0).getName()));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue