Skip to content

Commit

Permalink
CB-22402 Temporarly lock runtime version for the Marketplace e2e test…
Browse files Browse the repository at this point in the history
… to 7.2.15
  • Loading branch information
daszabo committed Jul 7, 2023
1 parent 343789b commit fa6318b
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,8 @@ public String getVariant() {
protected abstract DistroXClusterTestDto withCluster(DistroXClusterTestDto cluster);

@Override
public String getLatestMarketplacePreWarmedImageID(TestContext testContext, ImageCatalogTestDto imageCatalogTestDto, CloudbreakClient cloudbreakClient) {
public String getLatestMarketplacePreWarmedImageID(TestContext testContext, ImageCatalogTestDto imageCatalogTestDto, CloudbreakClient cloudbreakClient,
String runtimeVersion) {
throw new TestFailException("Marketplace images are not supported on this platform");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ public interface CloudProvider {

String getLatestPreWarmedImageID(TestContext testContext, ImageCatalogTestDto imageCatalogTestDto, CloudbreakClient cloudbreakClient);

String getLatestMarketplacePreWarmedImageID(TestContext testContext, ImageCatalogTestDto imageCatalogTestDto, CloudbreakClient cloudbreakClient);
String getLatestMarketplacePreWarmedImageID(TestContext testContext, ImageCatalogTestDto imageCatalogTestDto, CloudbreakClient cloudbreakClient,
String runtimeVersion);

String getLatestBaseImageID(TestContext testContext, ImageCatalogTestDto imageCatalogTestDto, CloudbreakClient cloudbreakClient);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,9 @@ public String getLatestPreWarmedImageID(TestContext testContext, ImageCatalogTes
}

@Override
public String getLatestMarketplacePreWarmedImageID(TestContext testContext, ImageCatalogTestDto imageCatalogTestDto, CloudbreakClient cloudbreakClient) {
return getDelegate(imageCatalogTestDto).getLatestMarketplacePreWarmedImageID(testContext, imageCatalogTestDto, cloudbreakClient);
public String getLatestMarketplacePreWarmedImageID(TestContext testContext, ImageCatalogTestDto imageCatalogTestDto, CloudbreakClient cloudbreakClient,
String runtimeVersion) {
return getDelegate(imageCatalogTestDto).getLatestMarketplacePreWarmedImageID(testContext, imageCatalogTestDto, cloudbreakClient, runtimeVersion);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,8 @@ public String getLatestPreWarmedImageID(TestContext testContext, ImageCatalogTes
}

@Override
public String getLatestMarketplacePreWarmedImageID(TestContext testContext, ImageCatalogTestDto imageCatalogTestDto, CloudbreakClient cloudbreakClient) {
public String getLatestMarketplacePreWarmedImageID(TestContext testContext, ImageCatalogTestDto imageCatalogTestDto, CloudbreakClient cloudbreakClient,
String runtimeVersion) {
try {
Optional<ImageV4Response> prewarmedImagesForRuntime = cloudbreakClient
.getDefaultClient()
Expand All @@ -441,13 +442,13 @@ public String getLatestMarketplacePreWarmedImageID(TestContext testContext, Imag
.stream()
.anyMatch(i -> i.getValue().containsKey(MARKETPLACE_REGION)))
.filter(image -> StringUtils.equalsIgnoreCase(image.getStackDetails().getVersion(),
commonClusterManagerProperties().getRuntimeVersion()))
runtimeVersion))
.max(Comparator.comparing(ImageV4Response::getPublished));

ImageV4Response latestPrewarmedImage = prewarmedImagesForRuntime
.orElseThrow(() ->
new IllegalStateException(format("Cannot find pre-warmed Azure Marketplace images at Azure provider for '%s' runtime version!",
commonClusterManagerProperties().getRuntimeVersion())));
runtimeVersion)));
Log.log(LOGGER, format(" Image Catalog Name: %s ", imageCatalogTestDto.getRequest().getName()));
Log.log(LOGGER, format(" Image Catalog URL: %s ", imageCatalogTestDto.getRequest().getUrl()));
Log.log(LOGGER, format(" Selected Pre-warmed Image Date: %s | ID: %s | Description: %s ", latestPrewarmedImage.getDate(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ public class DistroXMarketplaceImageTests extends PreconditionSdxE2ETest {

private static final int MARKETPLACE_IMAGE_PARTS_COUNT = 4;

private static final String RUNTIME_VERSION = "7.2.15";

@Inject
private SdxTestClient sdxTestClient;

Expand Down Expand Up @@ -120,6 +122,7 @@ public void testSDXAndDistroXWithMarketplaceImageCanBeCreatedSuccessfully(TestCo
.withCloudStorage(getCloudStorageRequest(testContext))
.withStackRequest(key(cluster), key(stack))
.withTelemetry(telemetry)
.withRuntimeVersion(RUNTIME_VERSION)
.when(sdxTestClient.createInternal(), key(sdxInternal))
.await(SdxClusterStatusResponse.RUNNING)
.awaitForHealthyInstances()
Expand Down Expand Up @@ -171,7 +174,7 @@ protected String getLatestMarketplacePrewarmedImageId(String imgCatalogKey, Test
testContext
.given(imgCatalogKey, ImageCatalogTestDto.class)
.when((tc, dto, client) -> {
selectedImageID.set(tc.getCloudProvider().getLatestMarketplacePreWarmedImageID(tc, dto, client));
selectedImageID.set(tc.getCloudProvider().getLatestMarketplacePreWarmedImageID(tc, dto, client, RUNTIME_VERSION));
return dto;
});
return selectedImageID.get();
Expand Down

0 comments on commit fa6318b

Please sign in to comment.