Skip to content

Commit

Permalink
Test fallout
Browse files Browse the repository at this point in the history
  • Loading branch information
droberts195 committed Sep 25, 2023
1 parent 27c477f commit 99eb232
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ public final class SourceDestValidator {
+ "alias [{0}], license is not active";
public static final String REMOTE_SOURCE_INDICES_NOT_SUPPORTED = "remote source indices are not supported";
public static final String REMOTE_CLUSTERS_TOO_OLD =
"remote clusters are expected to run at least version [{0}] (reason: [{1}]), but the following clusters were too old: [{2}]";
"remote clusters are expected to run at least transport version [{0}] (reason: [{1}]),"
+ " but the following clusters were too old: [{2}]";
public static final String PIPELINE_MISSING = "Pipeline with id [{0}] could not be found";

private final IndexNameExpressionResolver indexNameExpressionResolver;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ public static TransformConfigVersion fromVersion(Version version) {
}
return fromId(version.id);
}

public static TransformConfigVersion getMinTransformConfigVersion(DiscoveryNodes nodes) {
return getMinMaxTransformConfigVersion(nodes).v1();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ public void testValidate_OneRemoteClusterVersionTooLow() {
ctx -> assertThat(
ctx.getValidationException().validationErrors(),
contains(
"remote clusters are expected to run at least version [7.11.0] (reason: [some reason]), "
+ "but the following clusters were too old: [cluster-A (7.10.2)]"
"remote clusters are expected to run at least transport version [7110099] (reason: [some reason]), "
+ "but the following clusters were too old: [cluster-A (7100099)]"
)
)
)
Expand All @@ -100,8 +100,8 @@ public void testValidate_TwoRemoteClusterVersionsTooLow() {
ctx -> assertThat(
ctx.getValidationException().validationErrors(),
contains(
"remote clusters are expected to run at least version [7.11.2] (reason: [some reason]), "
+ "but the following clusters were too old: [cluster-A (7.10.2), cluster-B (7.11.0)]"
"remote clusters are expected to run at least transport version [7120099] (reason: [some reason]), "
+ "but the following clusters were too old: [cluster-A (7100099), cluster-B (7110099)]"
)
)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

package org.elasticsearch.xpack.core.transform.transforms;

import org.elasticsearch.Version;
import org.elasticsearch.TransportVersions;
import org.elasticsearch.common.Strings;
import org.elasticsearch.common.bytes.BytesReference;
import org.elasticsearch.common.io.stream.BytesStreamOutput;
Expand Down Expand Up @@ -603,7 +603,7 @@ public void testRewriteForUpdate() throws IOException {
"max_page_search_size": 111
},
"version": "%s"
}""", Version.V_7_6_0.toString());
}""", TransformConfigVersion.V_7_6_0.toString());

TransformConfig transformConfig = createTransformConfigFromString(pivotTransform, "body_id", true);
TransformConfig transformConfigRewritten = TransformConfig.rewriteForUpdate(transformConfig);
Expand Down Expand Up @@ -645,7 +645,7 @@ public void testRewriteForUpdateAlignCheckpoints() throws IOException {
}
},
"version": "%s"
}""", Version.V_7_12_0.toString());
}""", TransformConfigVersion.V_7_12_0.toString());

TransformConfig transformConfig = createTransformConfigFromString(pivotTransform, "body_id", true);
TransformConfig transformConfigRewritten = TransformConfig.rewriteForUpdate(transformConfig);
Expand Down Expand Up @@ -693,7 +693,7 @@ public void testRewriteForUpdateMaxPageSizeSearchConflicting() throws IOExceptio
"max_page_search_size": 555
},
"version": "%s"
}""", Version.V_7_5_0.toString());
}""", TransformConfigVersion.V_7_5_0.toString());

TransformConfig transformConfig = createTransformConfigFromString(pivotTransform, "body_id", true);
TransformConfig transformConfigRewritten = TransformConfig.rewriteForUpdate(transformConfig);
Expand Down Expand Up @@ -828,7 +828,7 @@ public void testGetAdditionalSourceDestValidations_WithRuntimeMappings() throws
assertThat(additiionalValidations.get(0), is(instanceOf(RemoteClusterMinimumVersionValidation.class)));
RemoteClusterMinimumVersionValidation remoteClusterMinimumVersionValidation =
(RemoteClusterMinimumVersionValidation) additiionalValidations.get(0);
assertThat(remoteClusterMinimumVersionValidation.getMinExpectedTransportVersion(), is(equalTo(Version.V_7_12_0)));
assertThat(remoteClusterMinimumVersionValidation.getMinExpectedTransportVersion(), is(equalTo(TransportVersions.V_7_12_0)));
assertThat(remoteClusterMinimumVersionValidation.getReason(), is(equalTo("source.runtime_mappings field was set")));
}

Expand Down

0 comments on commit 99eb232

Please sign in to comment.