Skip to content

Commit

Permalink
Test query builder bwc against previous supported versions instead of…
Browse files Browse the repository at this point in the history
… just the current version.

Relates to elastic#25456
  • Loading branch information
martijnvg committed Oct 9, 2017
1 parent a443619 commit 19dc629
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
14 changes: 4 additions & 10 deletions qa/query-builder-bwc/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,7 @@ task bwcTest {
group = 'verification'
}

// For now test against the current version:
Version currentVersion = Version.fromString(VersionProperties.elasticsearch.minus('-SNAPSHOT'))
Version[] versions = [currentVersion]
// TODO: uncomment when there is a released version with: https://github.com/elastic/elasticsearch/pull/25456
// versions = indexCompatVersions
for (Version version : versions) {
for (Version version : indexCompatVersions) {
String baseName = "v${version}"

Task oldQueryBuilderTest = tasks.create(name: "${baseName}#oldQueryBuilderTest", type: RestIntegTestTask) {
Expand All @@ -48,9 +43,8 @@ for (Version version : versions) {

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 @@ -89,7 +83,7 @@ test.enabled = false // no unit tests for rolling upgrades, only the rest integr
// basic integ tests includes testing bwc against the most recent version
task integTest {
if (project.bwc_tests_enabled) {
dependsOn = ["v${versions[-1]}#bwcTest"]
dependsOn = ["v${indexCompatVersions[-1]}#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 19dc629

Please sign in to comment.