1
1
import org.elasticsearch.gradle.Version
2
2
import org.elasticsearch.gradle.VersionProperties
3
3
import org.elasticsearch.gradle.internal.info.BuildParams
4
+ import org.elasticsearch.gradle.testclusters.StandaloneRestIntegTestTask
4
5
import org.elasticsearch.gradle.util.GradleUtils
5
6
6
- apply plugin : ' elasticsearch.legacy -yaml-rest-test'
7
- apply plugin : ' elasticsearch.legacy- yaml-rest-compat-test'
7
+ apply plugin : ' elasticsearch.internal -yaml-rest-test'
8
+ apply plugin : ' elasticsearch.yaml-rest-compat-test'
8
9
apply plugin : ' elasticsearch.validate-rest-spec'
9
10
apply plugin : ' elasticsearch.internal-test-artifact'
10
11
15
16
dependencies {
16
17
testImplementation project(xpackModule(' core' ))
17
18
testImplementation(testArtifact(project(xpackModule(' core' ))))
19
+ testImplementation(testArtifact(project(" :x-pack:plugin:security:qa:service-account" ), " javaRestTest" ))
18
20
testImplementation project(' :test:yaml-rest-runner' )
19
21
}
20
22
@@ -33,32 +35,6 @@ artifacts {
33
35
restXpackTests(new File (projectDir, " src/yamlRestTest/resources/rest-api-spec/test" ))
34
36
}
35
37
36
- // location for keys and certificates
37
- File extraResourceDir = file(" $buildDir /extra_resource" )
38
- File nodeKey = file(" $extraResourceDir /testnode.pem" )
39
- File nodeCert = file(" $extraResourceDir /testnode.crt" )
40
- // location for service tokens
41
- File serviceTokens = file(" $extraResourceDir /service_tokens" )
42
-
43
- // Add key and certs to test classpath: it expects them there
44
- // User cert and key PEM files instead of a JKS Keystore for the cluster's trust material so that
45
- // it can run in a FIPS 140 JVM
46
- // TODO: Remove all existing uses of cross project file references when the new approach for referencing static files is available
47
- // https://github.com/elastic/elasticsearch/pull/32201
48
- tasks. register(" copyExtraResources" , Copy ) {
49
- from(project(' :x-pack:plugin:core' ). file(' src/test/resources/org/elasticsearch/xpack/security/transport/ssl/certs/simple/' )) {
50
- include ' testnode.crt' , ' testnode.pem'
51
- }
52
- from(project(' :x-pack:plugin:security:qa:service-account' ). file(' src/javaRestTest/resources/' )) {
53
- include ' service_tokens'
54
- }
55
- into extraResourceDir
56
- }
57
- // Add keystores to test classpath: it expects it there
58
- sourceSets. yamlRestTest. resources. srcDir(extraResourceDir)
59
- tasks. named(" processYamlRestTestResources" ). configure {
60
- dependsOn(" copyExtraResources" )
61
- }
62
38
def restTestBlacklist = []
63
39
// TODO: fix this rest test to not depend on a hardcoded port!
64
40
restTestBlacklist. addAll([' getting_started/10_monitor_cluster_health/*' ])
@@ -75,9 +51,12 @@ if (BuildParams.isSnapshotBuild() == false) {
75
51
restTestBlacklist. add(' privileges/11_builtin/Test get builtin privileges' )
76
52
}
77
53
54
+ tasks. withType(StandaloneRestIntegTestTask ). configureEach {
55
+ usesDefaultDistribution()
56
+ }
57
+
78
58
tasks. named(" yamlRestTest" ). configure {
79
59
systemProperty ' tests.rest.blacklist' , restTestBlacklist. join(' ,' )
80
- dependsOn " copyExtraResources"
81
60
}
82
61
83
62
tasks. named(" yamlRestTestV7CompatTest" ). configure {
@@ -196,38 +175,6 @@ tasks.named("yamlRestTestV7CompatTransform").configure { task ->
196
175
)
197
176
}
198
177
199
-
200
- testClusters. configureEach {
201
- testDistribution = ' DEFAULT' // this is important since we use the reindex module in ML
202
- setting ' xpack.ml.enabled' , ' true'
203
- setting ' xpack.security.enabled' , ' true'
204
- setting ' xpack.watcher.enabled' , ' false'
205
- // Integration tests are supposed to enable/disable exporters before/after each test
206
- setting ' xpack.security.authc.token.enabled' , ' true'
207
- setting ' xpack.security.authc.api_key.enabled' , ' true'
208
- setting ' xpack.security.transport.ssl.enabled' , ' true'
209
- setting ' xpack.security.transport.ssl.key' , nodeKey. name
210
- setting ' xpack.security.transport.ssl.certificate' , nodeCert. name
211
- setting ' xpack.security.transport.ssl.verification_mode' , ' certificate'
212
- setting ' xpack.security.audit.enabled' , ' true'
213
- setting ' xpack.license.self_generated.type' , ' trial'
214
- // disable ILM history, since it disturbs tests using _all
215
- setting ' indices.lifecycle.history_index_enabled' , ' false'
216
- keystore ' bootstrap.password' , ' x-pack-test-password'
217
- keystore ' xpack.security.transport.ssl.secure_key_passphrase' , ' testnode'
218
- setting ' xpack.searchable.snapshot.shared_cache.size' , ' 16MB'
219
- setting ' xpack.searchable.snapshot.shared_cache.region_size' , ' 256KB'
220
-
221
- user username : " x_pack_rest_user" , password : " x-pack-test-password"
222
- extraConfigFile nodeKey. name, nodeKey
223
- extraConfigFile nodeCert. name, nodeCert
224
- extraConfigFile serviceTokens. name, serviceTokens
225
-
226
- requiresFeature ' es.index_mode_feature_flag_registered' , Version . fromString(" 8.0.0" )
227
- requiresFeature ' es.inference_rescorer_feature_flag_enabled' , Version . fromString(" 8.10.0" )
228
- requiresFeature ' es.dlm_feature_flag_enabled' , Version . fromString(" 8.9.0" )
229
- }
230
-
231
178
tasks. register(' enforceApiSpecsConvention' ). configure {
232
179
doLast {
233
180
if (fileTree(' src/test/resources/rest-api-spec/api' ). files) {
0 commit comments