Skip to content

Commit 9f51137

Browse files
authored
Add enrich qa module for rest tests and (#41568)
move put policy api yaml test to this rest module. The main benefit is that all tests will then be run when running: `./gradlew -p x-pack/plugin/enrich check` The rest qa module starts a node with default distribution and basic license. This qa module will also be used for adding different rest tests (not yaml), for example rest tests needed for #41532 Also when we are going to work on security integration then we can add a security qa module under the qa folder. Also at some point we should add a multi node qa module.
1 parent 1c28f30 commit 9f51137

File tree

5 files changed

+69
-0
lines changed

5 files changed

+69
-0
lines changed

x-pack/plugin/enrich/build.gradle

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,12 @@ run {
2222

2323
// No tests yet:
2424
integTest.enabled = false
25+
26+
// add all sub-projects of the qa sub-project
27+
gradle.projectsEvaluated {
28+
project.subprojects
29+
.find { it.path == project.path + ":qa" }
30+
.subprojects
31+
.findAll { it.path.startsWith(project.path + ":qa") }
32+
.each { check.dependsOn it.check }
33+
}

x-pack/plugin/enrich/qa/build.gradle

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import org.elasticsearch.gradle.test.RestIntegTestTask
2+
3+
apply plugin: 'elasticsearch.build'
4+
test.enabled = false
5+
6+
dependencies {
7+
compile project(':test:framework')
8+
}
9+
10+
subprojects {
11+
project.tasks.withType(RestIntegTestTask) {
12+
final File xPackResources = new File(xpackProject('plugin').projectDir, 'src/test/resources')
13+
project.copyRestSpec.from(xPackResources) {
14+
include 'rest-api-spec/api/**'
15+
}
16+
}
17+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import org.elasticsearch.gradle.test.RestIntegTestTask
2+
3+
apply plugin: 'elasticsearch.standalone-test'
4+
5+
dependencies {
6+
testCompile project(path: xpackModule('enrich'), configuration: 'runtime')
7+
}
8+
9+
task restTest(type: RestIntegTestTask) {
10+
mustRunAfter(precommit)
11+
}
12+
13+
restTestCluster {
14+
distribution 'default'
15+
setting 'xpack.license.self_generated.type', 'basic'
16+
}
17+
18+
check.dependsOn restTest
19+
test.enabled = false
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/*
2+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3+
* or more contributor license agreements. Licensed under the Elastic License;
4+
* you may not use this file except in compliance with the Elastic License.
5+
*/
6+
7+
package org.elasticsearch.xpack.enrich;
8+
9+
import com.carrotsearch.randomizedtesting.annotations.ParametersFactory;
10+
import org.elasticsearch.test.rest.yaml.ClientYamlTestCandidate;
11+
import org.elasticsearch.test.rest.yaml.ESClientYamlSuiteTestCase;
12+
13+
public class EnrichRestIT extends ESClientYamlSuiteTestCase {
14+
15+
public EnrichRestIT(final ClientYamlTestCandidate testCandidate) {
16+
super(testCandidate);
17+
}
18+
19+
@ParametersFactory
20+
public static Iterable<Object[]> parameters() throws Exception {
21+
return ESClientYamlSuiteTestCase.createParameters();
22+
}
23+
24+
}

0 commit comments

Comments
 (0)