Skip to content

Commit a9c82fd

Browse files
committed
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
1 parent 8ab60b1 commit a9c82fd

File tree

2 files changed

+19
-4
lines changed

2 files changed

+19
-4
lines changed

qa/query-builder-bwc/build.gradle

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ task bwcTest {
3131
}
3232

3333
for (Version version : versionCollection.versionsIndexCompatibleWithCurrent) {
34+
if (version.getMajor() < 6) {
35+
continue
36+
}
37+
3438
String baseName = "v${version}"
3539

3640
Task oldQueryBuilderTest = tasks.create(name: "${baseName}#oldQueryBuilderTest", type: RestIntegTestTask) {
@@ -43,9 +47,8 @@ for (Version version : versionCollection.versionsIndexCompatibleWithCurrent) {
4347

4448
configure(extensions.findByName("${baseName}#oldQueryBuilderTestCluster")) {
4549
distribution = 'zip'
46-
// TODO: uncomment when there is a released version with: https://github.com/elastic/elasticsearch/pull/25456
47-
// bwcVersion = version
48-
// numBwcNodes = 1
50+
bwcVersion = version
51+
numBwcNodes = 1
4952
numNodes = 1
5053
clusterName = 'query_builder_bwc'
5154
setting 'http.content_type.required', 'true'
@@ -85,7 +88,9 @@ test.enabled = false // no unit tests for rolling upgrades, only the rest integr
8588
task integTest {
8689
if (project.bwc_tests_enabled) {
8790
for (final def version : versionCollection.basicIntegrationTestVersions) {
88-
dependsOn "v${version}#bwcTest"
91+
if (version.getMajor() >= 6) {
92+
dependsOn "v${version}#bwcTest"
93+
}
8994
}
9095
}
9196
}

qa/query-builder-bwc/src/test/java/org/elasticsearch/bwc/QueryBuilderBWCIT.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,16 @@
6161

6262
import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder;
6363

64+
/**
65+
* An integration test that tests whether percolator queries stored in older supported ES version can still be read by the
66+
* current ES version. Percolator queries are stored in the binary format in a dedicated doc values field (see
67+
* PercolatorFieldMapper#createQueryBuilderField(...) method). Using the query builders writable contract. This test
68+
* does best effort verifying that we don't break bwc for query builders between the first previous major version and
69+
* the latest current major release.
70+
*
71+
* The queries to test are specified in json format, which turns out to work because we tend break here rarely. If the
72+
* json format of a query being tested here then feel free to change this.
73+
*/
6474
public class QueryBuilderBWCIT extends ESRestTestCase {
6575

6676
private static final List<Object[]> CANDIDATES = new ArrayList<>();

0 commit comments

Comments
 (0)