From c7ac8e5d8615e23761f4b6ad46d53f9d7fa93afa Mon Sep 17 00:00:00 2001 From: Martijn van Groningen Date: Fri, 24 Nov 2017 09:33:03 +0100 Subject: [PATCH] test: do not run percolator query builder bwc test against 5.x versions The percolator query format this bwc qa test is testing is only available from 6.x versions. Closes #27510 --- qa/query-builder-bwc/build.gradle | 13 +++++++++---- .../org/elasticsearch/bwc/QueryBuilderBWCIT.java | 10 ++++++++++ 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/qa/query-builder-bwc/build.gradle b/qa/query-builder-bwc/build.gradle index da767f4c8a83a..ca454316994c7 100644 --- a/qa/query-builder-bwc/build.gradle +++ b/qa/query-builder-bwc/build.gradle @@ -31,6 +31,10 @@ task bwcTest { } for (Version version : versionCollection.versionsIndexCompatibleWithCurrent) { + if (version.getMajor() < 6) { + continue + } + String baseName = "v${version}" Task oldQueryBuilderTest = tasks.create(name: "${baseName}#oldQueryBuilderTest", type: RestIntegTestTask) { @@ -43,9 +47,8 @@ for (Version version : versionCollection.versionsIndexCompatibleWithCurrent) { configure(extensions.findByName("${baseName}#oldQueryBuilderTestCluster")) { distribution = 'zip' - // TODO: uncomment when there is a released version with: https://github.com/elastic/elasticsearch/pull/25456 - // bwcVersion = version - // numBwcNodes = 1 + bwcVersion = version + numBwcNodes = 1 numNodes = 1 clusterName = 'query_builder_bwc' setting 'http.content_type.required', 'true' @@ -85,7 +88,9 @@ test.enabled = false // no unit tests for rolling upgrades, only the rest integr task integTest { if (project.bwc_tests_enabled) { for (final def version : versionCollection.basicIntegrationTestVersions) { - dependsOn "v${version}#bwcTest" + if (version.getMajor() >= 6) { + dependsOn "v${version}#bwcTest" + } } } } diff --git a/qa/query-builder-bwc/src/test/java/org/elasticsearch/bwc/QueryBuilderBWCIT.java b/qa/query-builder-bwc/src/test/java/org/elasticsearch/bwc/QueryBuilderBWCIT.java index eb35e32c7a06a..74878814f08df 100644 --- a/qa/query-builder-bwc/src/test/java/org/elasticsearch/bwc/QueryBuilderBWCIT.java +++ b/qa/query-builder-bwc/src/test/java/org/elasticsearch/bwc/QueryBuilderBWCIT.java @@ -61,6 +61,16 @@ import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +/** + * An integration test that tests whether percolator queries stored in older supported ES version can still be read by the + * current ES version. Percolator queries are stored in the binary format in a dedicated doc values field (see + * PercolatorFieldMapper#createQueryBuilderField(...) method). Using the query builders writable contract. This test + * does best effort verifying that we don't break bwc for query builders between the first previous major version and + * the latest current major release. + * + * The queries to test are specified in json format, which turns out to work because we tend break here rarely. If the + * json format of a query being tested here then feel free to change this. + */ public class QueryBuilderBWCIT extends ESRestTestCase { private static final List CANDIDATES = new ArrayList<>();