Skip to content

Commit

Permalink
Fix ES|QL mixed cluster YAML tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mark-vieira committed Jan 4, 2024
1 parent 588ab0b commit 6461c0d
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 11 deletions.
19 changes: 16 additions & 3 deletions x-pack/plugin/esql/qa/server/mixed-cluster/build.gradle
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@

import org.elasticsearch.gradle.Version
import org.elasticsearch.gradle.VersionProperties
import org.elasticsearch.gradle.util.GradleUtils
import org.elasticsearch.gradle.internal.info.BuildParams
import org.elasticsearch.gradle.testclusters.StandaloneRestIntegTestTask

apply plugin: 'elasticsearch.internal-java-rest-test'
apply plugin: 'elasticsearch.internal-yaml-rest-test'
apply plugin: 'elasticsearch.bwc-test'

restResources {
Expand All @@ -21,15 +22,27 @@ dependencies {
javaRestTestImplementation project(xpackModule('esql:qa:server'))
}

GradleUtils.extendSourceSet(project, "javaRestTest", "yamlRestTest")

def supportedVersion = bwcVersion -> {
// ESQL is available in 8.11 or later
return bwcVersion.onOrAfter(Version.fromString("8.11.0"));
}

BuildParams.bwcVersions.withWireCompatible(supportedVersion) { bwcVersion, baseName ->
tasks.register(bwcTaskName(bwcVersion), StandaloneRestIntegTestTask) {
def javaRestTest = tasks.register("v${bwcVersion}#javaRestTest", StandaloneRestIntegTestTask) {
usesBwcDistribution(bwcVersion)
systemProperty("tests.old_cluster_version", bwcVersion)
maxParallelForks = 1
}

def yamlRestTest = tasks.register("v${bwcVersion}#yamlRestTest", StandaloneRestIntegTestTask) {
usesBwcDistribution(bwcVersion)
systemProperty("tests.old_cluster_version", bwcVersion)
testClassesDirs = sourceSets.yamlRestTest.output.classesDirs
classpath = sourceSets.yamlRestTest.runtimeClasspath
}

tasks.register(bwcTaskName(bwcVersion)) {
dependsOn javaRestTest, yamlRestTest
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ public static ElasticsearchCluster mixedVersionCluster() {
.setting("xpack.security.enabled", "false")
.setting("xpack.license.self_generated.type", "trial")
.setting("cluster.routing.rebalance.enable", "none") // disable relocation until we have retry in ESQL
.shared(true)
.build();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,14 @@

package org.elasticsearch.xpack.esql.qa.mixed;

import com.carrotsearch.randomizedtesting.annotations.ThreadLeakFilters;

import org.elasticsearch.Version;
import org.elasticsearch.test.TestClustersThreadFilter;
import org.elasticsearch.test.cluster.ElasticsearchCluster;
import org.elasticsearch.xpack.esql.qa.rest.EsqlSpecTestCase;
import org.elasticsearch.xpack.ql.CsvSpecReader.CsvTestCase;
import org.junit.ClassRule;

import static org.elasticsearch.xpack.esql.CsvTestUtils.isEnabled;

@ThreadLeakFilters(filters = TestClustersThreadFilter.class)
public class MixedClusterEsqlSpecIT extends EsqlSpecTestCase {
@ClassRule
public static ElasticsearchCluster cluster = Clusters.mixedVersionCluster();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@
package org.elasticsearch.xpack.esql.qa.mixed;

import com.carrotsearch.randomizedtesting.annotations.ParametersFactory;
import com.carrotsearch.randomizedtesting.annotations.ThreadLeakFilters;

import org.elasticsearch.test.TestClustersThreadFilter;
import org.elasticsearch.test.cluster.ElasticsearchCluster;
import org.elasticsearch.test.rest.yaml.ClientYamlTestCandidate;
import org.elasticsearch.test.rest.yaml.ESClientYamlSuiteTestCase;
Expand All @@ -19,7 +17,6 @@
import org.junit.Before;
import org.junit.ClassRule;

@ThreadLeakFilters(filters = TestClustersThreadFilter.class)
public class EsqlClientYamlIT extends ESClientYamlSuiteTestCase {
@ClassRule
public static ElasticsearchCluster cluster = Clusters.mixedVersionCluster();
Expand Down

0 comments on commit 6461c0d

Please sign in to comment.