Skip to content

Commit

Permalink
Migrate painless and runtime fields common tests to new test clusters (
Browse files Browse the repository at this point in the history
  • Loading branch information
mark-vieira committed Oct 18, 2023
1 parent cdb13f4 commit 6854c7f
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 4 deletions.
5 changes: 3 additions & 2 deletions modules/lang-painless/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
import org.elasticsearch.gradle.testclusters.DefaultTestClustersTask;

apply plugin: 'elasticsearch.validate-rest-spec'
apply plugin: 'elasticsearch.legacy-yaml-rest-test'
apply plugin: 'elasticsearch.legacy-yaml-rest-compat-test'
apply plugin: 'elasticsearch.internal-yaml-rest-test'
apply plugin: 'elasticsearch.yaml-rest-compat-test'
apply plugin: 'elasticsearch.internal-cluster-test'

esplugin {
Expand Down Expand Up @@ -42,6 +42,7 @@ dependencies {
api 'org.ow2.asm:asm-analysis:7.2'
api 'org.ow2.asm:asm:7.2'
spi project('spi')
clusterModules project(':modules:mapper-extras')
}

tasks.named("dependencyLicenses").configure {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,22 @@
import com.carrotsearch.randomizedtesting.annotations.Name;
import com.carrotsearch.randomizedtesting.annotations.ParametersFactory;

import org.elasticsearch.test.cluster.ElasticsearchCluster;
import org.elasticsearch.test.rest.yaml.ClientYamlTestCandidate;
import org.elasticsearch.test.rest.yaml.ESClientYamlSuiteTestCase;
import org.junit.ClassRule;

/** Runs yaml rest tests */
public class LangPainlessClientYamlTestSuiteIT extends ESClientYamlSuiteTestCase {

@ClassRule
public static ElasticsearchCluster cluster = ElasticsearchCluster.local()
.module("lang-painless")
.module("mapper-extras")
.systemProperty("es.scripting.update.ctx_in_params", "false")
.systemProperty("es.transport.cname_in_publish_address", "true")
.build();

public LangPainlessClientYamlTestSuiteIT(@Name("yaml") ClientYamlTestCandidate testCandidate) {
super(testCandidate);
}
Expand All @@ -25,4 +35,9 @@ public LangPainlessClientYamlTestSuiteIT(@Name("yaml") ClientYamlTestCandidate t
public static Iterable<Object[]> parameters() throws Exception {
return ESClientYamlSuiteTestCase.createParameters();
}

@Override
protected String getTestRestCluster() {
return cluster.getHttpAddresses();
}
}
4 changes: 2 additions & 2 deletions modules/runtime-fields-common/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
*/

apply plugin: 'elasticsearch.validate-rest-spec'
apply plugin: 'elasticsearch.legacy-yaml-rest-test'
apply plugin: 'elasticsearch.legacy-yaml-rest-compat-test'
apply plugin: 'elasticsearch.internal-yaml-rest-test'
apply plugin: 'elasticsearch.yaml-rest-compat-test'

esplugin {
description 'Module for runtime fields features and extensions that have large dependencies'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,17 @@
import com.carrotsearch.randomizedtesting.annotations.Name;
import com.carrotsearch.randomizedtesting.annotations.ParametersFactory;

import org.elasticsearch.test.cluster.ElasticsearchCluster;
import org.elasticsearch.test.rest.yaml.ClientYamlTestCandidate;
import org.elasticsearch.test.rest.yaml.ESClientYamlSuiteTestCase;
import org.junit.ClassRule;

/** Runs yaml rest tests */
public class RuntimeFieldsClientYamlTestSuiteIT extends ESClientYamlSuiteTestCase {

@ClassRule
public static ElasticsearchCluster cluster = ElasticsearchCluster.local().module("runtime-fields-common").build();

public RuntimeFieldsClientYamlTestSuiteIT(@Name("yaml") ClientYamlTestCandidate testCandidate) {
super(testCandidate);
}
Expand All @@ -25,4 +30,9 @@ public RuntimeFieldsClientYamlTestSuiteIT(@Name("yaml") ClientYamlTestCandidate
public static Iterable<Object[]> parameters() throws Exception {
return ESClientYamlSuiteTestCase.createParameters();
}

@Override
protected String getTestRestCluster() {
return cluster.getHttpAddresses();
}
}

0 comments on commit 6854c7f

Please sign in to comment.