Skip to content

Commit

Permalink
test: do not run percolator query builder bwc test against 5.x versions
Browse files Browse the repository at this point in the history
The percolator query format this bwc qa test is testing is only available from 6.x versions.

Closes #27510
  • Loading branch information
martijnvg committed Nov 24, 2017
1 parent 0ca12d7 commit c7ac8e5
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
13 changes: 9 additions & 4 deletions qa/query-builder-bwc/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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'
Expand Down Expand Up @@ -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"
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<Object[]> CANDIDATES = new ArrayList<>();
Expand Down

0 comments on commit c7ac8e5

Please sign in to comment.