Skip to content

Commit

Permalink
Merge branch 'faster-meta-e2e' into MetadataMultiType
Browse files Browse the repository at this point in the history
Signed-off-by: Andre Kurait <[email protected]>
  • Loading branch information
AndreKurait committed Dec 10, 2024
2 parents 3511cad + ec2bb14 commit 1b5c6a5
Showing 1 changed file with 5 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,8 @@ private static Stream<Arguments> scenarios() {
.collect(Collectors.toList());

return SupportedClusters.targets().stream()
.flatMap(targetCluster -> templateTypes.stream().flatMap(templateType -> {
// Generate arguments for both HTTP and SnapshotImage transfer mediums
Stream<Arguments> httpArgs = Arrays.stream(MetadataCommands.values())
.map(command -> Arguments.of(sourceCluster, targetCluster, TransferMedium.Http, command, templateType));

Stream<Arguments> snapshotArgs = Stream.of(
Arguments.of(sourceCluster, targetCluster, TransferMedium.SnapshotImage, MetadataCommands.MIGRATE, templateType)
);

return Stream.concat(httpArgs, snapshotArgs);
}));
.flatMap(targetCluster -> templateTypes.stream().flatMap(templateType -> Arrays.stream(TransferMedium.values())
.map(transferMedium -> Arguments.of(sourceCluster, targetCluster, transferMedium, templateType))));
});
}

Expand All @@ -60,15 +51,15 @@ private static Stream<Arguments> scenarios() {
void metadataCommand(SearchClusterContainer.ContainerVersion sourceVersion,
SearchClusterContainer.ContainerVersion targetVersion,
TransferMedium medium,
MetadataCommands command,
TemplateType templateType) {
try (
final var sourceCluster = new SearchClusterContainer(sourceVersion);
final var targetCluster = new SearchClusterContainer(targetVersion)
) {
this.sourceCluster = sourceCluster;
this.targetCluster = targetCluster;
metadataCommandOnClusters(medium, command, templateType);
metadataCommandOnClusters(medium, MetadataCommands.EVALUATE, templateType);
metadataCommandOnClusters(medium, MetadataCommands.MIGRATE, templateType);
}
}

Expand Down Expand Up @@ -110,7 +101,7 @@ private void metadataCommandOnClusters(TransferMedium medium,

switch (medium) {
case SnapshotImage:
var snapshotName = createSnapshot("my_snap");
var snapshotName = createSnapshot("my_snap_" + command.name().toLowerCase());
arguments = prepareSnapshotMigrationArgs(snapshotName);
break;

Expand Down

0 comments on commit 1b5c6a5

Please sign in to comment.