Skip to content

re-enable bwc tests and update geo-grid bounds version guard to 7.6 after #50996 #50997

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jan 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,8 @@ task verifyVersions {
* after the backport of the backcompat code is complete.
*/

boolean bwc_tests_enabled = false
final String bwc_tests_disabled_issue = "https://github.com/elastic/elasticsearch/pull/50996" /* place a PR link here when committing bwc changes */
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")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ static GeoTileGridValuesSourceBuilder parse(String name, XContentParser parser)
GeoTileGridValuesSourceBuilder(StreamInput in) throws IOException {
super(in);
this.precision = in.readInt();
if (in.getVersion().onOrAfter(Version.V_8_0_0)) {
if (in.getVersion().onOrAfter(Version.V_7_6_0)) {
this.geoBoundingBox = new GeoBoundingBox(in);
}
}
Expand All @@ -90,7 +90,7 @@ public GeoTileGridValuesSourceBuilder format(String format) {
@Override
protected void innerWriteTo(StreamOutput out) throws IOException {
out.writeInt(precision);
if (out.getVersion().onOrAfter(Version.V_8_0_0)) {
if (out.getVersion().onOrAfter(Version.V_7_6_0)) {
geoBoundingBox.writeTo(out);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public GeoGridAggregationBuilder(StreamInput in) throws IOException {
precision = in.readVInt();
requiredSize = in.readVInt();
shardSize = in.readVInt();
if (in.getVersion().onOrAfter(Version.V_8_0_0)) {
if (in.getVersion().onOrAfter(Version.V_7_6_0)) {
geoBoundingBox = new GeoBoundingBox(in);
}
}
Expand All @@ -108,7 +108,7 @@ protected void innerWriteTo(StreamOutput out) throws IOException {
out.writeVInt(precision);
out.writeVInt(requiredSize);
out.writeVInt(shardSize);
if (out.getVersion().onOrAfter(Version.V_8_0_0)) {
if (out.getVersion().onOrAfter(Version.V_7_6_0)) {
geoBoundingBox.writeTo(out);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@ protected GeoHashGridAggregationBuilder createTestAggregatorBuilder() {
}

public void testSerializationPreBounds() throws Exception {
Version noBoundsSupportVersion = VersionUtils.randomPreviousCompatibleVersion(random(), Version.V_8_0_0);
Version noBoundsSupportVersion = VersionUtils.randomVersionBetween(random(), Version.V_7_0_0, Version.V_7_5_0);
GeoHashGridAggregationBuilder builder = createTestAggregatorBuilder();
try (BytesStreamOutput output = new BytesStreamOutput()) {
output.setVersion(Version.V_8_0_0);
output.setVersion(Version.V_7_6_0);
builder.writeTo(output);
try (StreamInput in = new NamedWriteableAwareStreamInput(output.bytes().streamInput(),
new NamedWriteableRegistry(Collections.emptyList()))) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@ protected GeoTileGridAggregationBuilder createTestAggregatorBuilder() {
}

public void testSerializationPreBounds() throws Exception {
Version noBoundsSupportVersion = VersionUtils.randomPreviousCompatibleVersion(random(), Version.V_8_0_0);
Version noBoundsSupportVersion = VersionUtils.randomVersionBetween(random(), Version.V_7_0_0, Version.V_7_5_0);
GeoTileGridAggregationBuilder builder = createTestAggregatorBuilder();
try (BytesStreamOutput output = new BytesStreamOutput()) {
output.setVersion(Version.V_8_0_0);
output.setVersion(Version.V_7_6_0);
builder.writeTo(output);
try (StreamInput in = new NamedWriteableAwareStreamInput(output.bytes().streamInput(),
new NamedWriteableRegistry(Collections.emptyList()))) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@ public void testSetFormat() {
}

public void testBWCBounds() throws IOException {
Version noBoundsSupportVersion = VersionUtils.randomPreviousCompatibleVersion(random(), Version.V_8_0_0);
Version noBoundsSupportVersion = VersionUtils.randomVersionBetween(random(), Version.V_7_0_0, Version.V_7_5_0);
GeoTileGridValuesSourceBuilder builder = new GeoTileGridValuesSourceBuilder("name");
if (randomBoolean()) {
builder.geoBoundingBox(GeoBoundingBoxTests.randomBBox());
}
try (BytesStreamOutput output = new BytesStreamOutput()) {
output.setVersion(Version.V_8_0_0);
output.setVersion(Version.V_7_6_0);
builder.writeTo(output);
try (StreamInput in = new NamedWriteableAwareStreamInput(output.bytes().streamInput(),
new NamedWriteableRegistry(Collections.emptyList()))) {
Expand Down