Skip to content

Commit

Permalink
Add enrich qa module for rest tests and
Browse files Browse the repository at this point in the history
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 elastic#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.
  • Loading branch information
martijnvg committed Apr 26, 2019
1 parent 1c28f30 commit adb9553
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 0 deletions.
9 changes: 9 additions & 0 deletions x-pack/plugin/enrich/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,12 @@ run {

// No tests yet:
integTest.enabled = false

// add all sub-projects of the qa sub-project
gradle.projectsEvaluated {
project.subprojects
.find { it.path == project.path + ":qa" }
.subprojects
.findAll { it.path.startsWith(project.path + ":qa") }
.each { check.dependsOn it.check }
}
17 changes: 17 additions & 0 deletions x-pack/plugin/enrich/qa/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import org.elasticsearch.gradle.test.RestIntegTestTask

apply plugin: 'elasticsearch.build'
test.enabled = false

dependencies {
compile project(':test:framework')
}

subprojects {
project.tasks.withType(RestIntegTestTask) {
final File xPackResources = new File(xpackProject('plugin').projectDir, 'src/test/resources')
project.copyRestSpec.from(xPackResources) {
include 'rest-api-spec/api/**'
}
}
}
19 changes: 19 additions & 0 deletions x-pack/plugin/enrich/qa/rest/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import org.elasticsearch.gradle.test.RestIntegTestTask

apply plugin: 'elasticsearch.standalone-test'

dependencies {
testCompile project(path: xpackModule('enrich'), configuration: 'runtime')
}

task restTest(type: RestIntegTestTask) {
mustRunAfter(precommit)
}

restTestCluster {
distribution 'default'
setting 'xpack.license.self_generated.type', 'basic'
}

check.dependsOn restTest
test.enabled = false
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/

package org.elasticsearch.xpack.enrich;

import com.carrotsearch.randomizedtesting.annotations.ParametersFactory;
import org.elasticsearch.test.rest.yaml.ClientYamlTestCandidate;
import org.elasticsearch.test.rest.yaml.ESClientYamlSuiteTestCase;

public class EnrichRestIT extends ESClientYamlSuiteTestCase {

public EnrichRestIT(final ClientYamlTestCandidate testCandidate) {
super(testCandidate);
}

@ParametersFactory
public static Iterable<Object[]> parameters() throws Exception {
return ESClientYamlSuiteTestCase.createParameters();
}

}

0 comments on commit adb9553

Please sign in to comment.