From af2f4c8f73673ecba663c6bfa52409d9790861ac Mon Sep 17 00:00:00 2001 From: Boaz Leskes Date: Thu, 24 Jan 2019 12:15:05 +0100 Subject: [PATCH] enable bwc tests and bump versions after backporting https://github.com/elastic/elasticsearch/pull/37639 --- build.gradle | 4 ++-- .../test/resources/rest-api-spec/test/11_parent_child.yml | 6 ------ .../test/search.aggregation/200_top_hits_metric.yml | 3 --- .../rest-api-spec/test/search/300_sequence_numbers.yml | 8 -------- .../org/elasticsearch/index/query/InnerHitBuilder.java | 4 ++-- .../src/main/java/org/elasticsearch/search/SearchHit.java | 4 ++-- .../aggregations/metrics/TopHitsAggregationBuilder.java | 4 ++-- .../elasticsearch/search/builder/SearchSourceBuilder.java | 4 ++-- 8 files changed, 10 insertions(+), 27 deletions(-) diff --git a/build.gradle b/build.gradle index d4e2616c202..c5611e8b453 100644 --- a/build.gradle +++ b/build.gradle @@ -159,8 +159,8 @@ task verifyVersions { * the enabled state of every bwc task. It should be set back to true * after the backport of the backcompat code is complete. */ -final boolean bwc_tests_enabled = false -final String bwc_tests_disabled_issue = "backporting https://github.com/elastic/elasticsearch/pull/37639" /* place a PR link here when committing bwc changes */ +final boolean bwc_tests_enabled = true +final String bwc_tests_disabled_issue = "" /* place a PR link here when committing bwc changes */ if (bwc_tests_enabled == false) { if (bwc_tests_disabled_issue.isEmpty()) { throw new GradleException("bwc_tests_disabled_issue must be set when bwc_tests_enabled == false") diff --git a/modules/parent-join/src/test/resources/rest-api-spec/test/11_parent_child.yml b/modules/parent-join/src/test/resources/rest-api-spec/test/11_parent_child.yml index 61af4ab1acb..d120504f18c 100644 --- a/modules/parent-join/src/test/resources/rest-api-spec/test/11_parent_child.yml +++ b/modules/parent-join/src/test/resources/rest-api-spec/test/11_parent_child.yml @@ -44,17 +44,11 @@ setup: --- "Parent/child inner hits with seq no": - - skip: - version: " - 6.99.99" - reason: support was added in 7.0 - - do: search: - rest_total_hits_as_int: true body: { "query" : { "has_child" : { "type" : "child", "query" : { "match_all" : {} }, "inner_hits" : { "seq_no_primary_term": true} } } } - - match: { hits.total: 1 } - match: { hits.hits.0._index: "test" } - match: { hits.hits.0._id: "1" } - match: { hits.hits.0.inner_hits.child.hits.hits.0._index: "test"} diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/search.aggregation/200_top_hits_metric.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/search.aggregation/200_top_hits_metric.yml index 775475e01a5..82207fe9b39 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/search.aggregation/200_top_hits_metric.yml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/search.aggregation/200_top_hits_metric.yml @@ -87,9 +87,6 @@ setup: --- "top_hits aggregation with sequence numbers": - - skip: - version: " - 6.99.99" - reason: support was added in 7.0 - do: search: diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/search/300_sequence_numbers.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/search/300_sequence_numbers.yml index 9e838d1c58f..71674065311 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/search/300_sequence_numbers.yml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/search/300_sequence_numbers.yml @@ -24,10 +24,6 @@ setup: --- "sequence numbers are returned if requested from body": - - skip: - version: " - 6.99.99" - reason: sequence numbers were added in 7.0.0 - - do: search: index: _all @@ -43,10 +39,6 @@ setup: --- "sequence numbers are returned if requested from url": - - skip: - version: " - 6.99.99" - reason: sequence numbers were added in 7.0.0 - - do: search: index: _all diff --git a/server/src/main/java/org/elasticsearch/index/query/InnerHitBuilder.java b/server/src/main/java/org/elasticsearch/index/query/InnerHitBuilder.java index f5be9650b8d..d72134198b8 100644 --- a/server/src/main/java/org/elasticsearch/index/query/InnerHitBuilder.java +++ b/server/src/main/java/org/elasticsearch/index/query/InnerHitBuilder.java @@ -156,7 +156,7 @@ public final class InnerHitBuilder implements Writeable, ToXContentObject { size = in.readVInt(); explain = in.readBoolean(); version = in.readBoolean(); - if (in.getVersion().onOrAfter(Version.V_7_0_0)){ + if (in.getVersion().onOrAfter(Version.V_6_7_0)){ seqNoAndPrimaryTerm = in.readBoolean(); } else { seqNoAndPrimaryTerm = false; @@ -205,7 +205,7 @@ public final class InnerHitBuilder implements Writeable, ToXContentObject { out.writeVInt(size); out.writeBoolean(explain); out.writeBoolean(version); - if (out.getVersion().onOrAfter(Version.V_7_0_0)) { + if (out.getVersion().onOrAfter(Version.V_6_7_0)) { out.writeBoolean(seqNoAndPrimaryTerm); } out.writeBoolean(trackScores); diff --git a/server/src/main/java/org/elasticsearch/search/SearchHit.java b/server/src/main/java/org/elasticsearch/search/SearchHit.java index 42f96e52fb1..df82bbec599 100644 --- a/server/src/main/java/org/elasticsearch/search/SearchHit.java +++ b/server/src/main/java/org/elasticsearch/search/SearchHit.java @@ -784,7 +784,7 @@ public final class SearchHit implements Streamable, ToXContentObject, Iterable