Skip to content

Commit

Permalink
Update analysis-common module to use new rest test framework (elastic…
Browse files Browse the repository at this point in the history
  • Loading branch information
brianseeders authored Oct 30, 2023
1 parent 057e36f commit eb39d6f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
11 changes: 4 additions & 7 deletions modules/analysis-common/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
*/
import org.elasticsearch.gradle.Version

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 All @@ -23,13 +23,10 @@ restResources {
}
}

testClusters.configureEach {
module ':modules:reindex'
module ':modules:mapper-extras'
}

dependencies {
compileOnly project(':modules:lang-painless:spi')
clusterModules project(':modules:reindex')
clusterModules project(':modules:mapper-extras')
}

tasks.named("yamlRestTestV7CompatTransform").configure { task ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@
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;

public class CommonAnalysisClientYamlTestSuiteIT extends ESClientYamlSuiteTestCase {
public CommonAnalysisClientYamlTestSuiteIT(@Name("yaml") ClientYamlTestCandidate testCandidate) {
Expand All @@ -22,4 +24,16 @@ public CommonAnalysisClientYamlTestSuiteIT(@Name("yaml") ClientYamlTestCandidate
public static Iterable<Object[]> parameters() throws Exception {
return ESClientYamlSuiteTestCase.createParameters();
}

@ClassRule
public static ElasticsearchCluster cluster = ElasticsearchCluster.local()
.module("reindex")
.module("mapper-extras")
.module("analysis-common")
.build();

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

0 comments on commit eb39d6f

Please sign in to comment.