From 74fd24b091d073572da1545574309a2ff91c33d4 Mon Sep 17 00:00:00 2001 From: lizhenglei <127465317+jackyyyyyssss@users.noreply.github.com> Date: Wed, 27 Dec 2023 15:35:05 +0800 Subject: [PATCH] [Improvement][E2E] support e2e compose v2 fix code style (#15325) * support e2e compose v2 fix code stystle * fix * fix * fix version * Revert "fix version" This reverts commit 4f1c1963 * fix version * fix blank --------- Co-authored-by: 80597928 <673421862@qq.com> Co-authored-by: David Zollo --- dolphinscheduler-bom/pom.xml | 2 +- .../e2e/core/DolphinSchedulerExtension.java | 26 +++++++++++-------- dolphinscheduler-e2e/pom.xml | 2 +- 3 files changed, 17 insertions(+), 13 deletions(-) diff --git a/dolphinscheduler-bom/pom.xml b/dolphinscheduler-bom/pom.xml index d4d4ee828f..c15fc164a7 100644 --- a/dolphinscheduler-bom/pom.xml +++ b/dolphinscheduler-bom/pom.xml @@ -119,7 +119,7 @@ 3.23.3 1.2.1 0.10.1 - 1.17.6 + 1.19.3 3.19.0 0.10.1 2.1.4 diff --git a/dolphinscheduler-e2e/dolphinscheduler-e2e-core/src/main/java/org/apache/dolphinscheduler/e2e/core/DolphinSchedulerExtension.java b/dolphinscheduler-e2e/dolphinscheduler-e2e-core/src/main/java/org/apache/dolphinscheduler/e2e/core/DolphinSchedulerExtension.java index ce96044777..21c740952c 100644 --- a/dolphinscheduler-e2e/dolphinscheduler-e2e-core/src/main/java/org/apache/dolphinscheduler/e2e/core/DolphinSchedulerExtension.java +++ b/dolphinscheduler-e2e/dolphinscheduler-e2e-core/src/main/java/org/apache/dolphinscheduler/e2e/core/DolphinSchedulerExtension.java @@ -46,7 +46,7 @@ import org.openqa.selenium.chrome.ChromeOptions; import org.openqa.selenium.remote.RemoteWebDriver; import org.testcontainers.Testcontainers; import org.testcontainers.containers.BrowserWebDriverContainer; -import org.testcontainers.containers.DockerComposeContainer; +import org.testcontainers.containers.ComposeContainer; import org.testcontainers.containers.wait.strategy.Wait; import org.testcontainers.shaded.org.awaitility.Awaitility; import org.testcontainers.utility.DockerImageName; @@ -67,14 +67,14 @@ final class DolphinSchedulerExtension implements BeforeAllCallback, AfterAllCall private final int DOCKER_PORT = 12345; private RemoteWebDriver driver; - private DockerComposeContainer compose; + private ComposeContainer compose; private BrowserWebDriverContainer browser; private HostAndPort address; private String rootPath; private Path record; - private final String serviceName = "dolphinscheduler_1"; + private final String serviceName = "dolphinscheduler"; @Override @SuppressWarnings("UnstableApiUsage") @@ -194,7 +194,7 @@ final class DolphinSchedulerExtension implements BeforeAllCallback, AfterAllCall } } - private DockerComposeContainer createDockerCompose(ExtensionContext context) { + private ComposeContainer createDockerCompose(ExtensionContext context) { final Class clazz = context.getRequiredTestClass(); final DolphinScheduler annotation = clazz.getAnnotation(DolphinScheduler.class); final List files = Stream.of(annotation.composeFiles()) @@ -203,13 +203,17 @@ final class DolphinSchedulerExtension implements BeforeAllCallback, AfterAllCall .map(URL::getPath) .map(File::new) .collect(Collectors.toList()); - compose = new DockerComposeContainer<>(files) - .withPull(true) - .withTailChildContainers(true) - .withLocalCompose(true) - .withExposedService(serviceName, DOCKER_PORT, Wait.forListeningPort().withStartupTimeout(Duration.ofSeconds(300))) - .withLogConsumer(serviceName, outputFrame -> LOGGER.info(outputFrame.getUtf8String())) - .waitingFor(serviceName, Wait.forHealthcheck().withStartupTimeout(Duration.ofSeconds(300))); + + ComposeContainer compose = new ComposeContainer(files) + .withPull(true) + .withTailChildContainers(true) + .withLocalCompose(true) + .withExposedService( + serviceName, + DOCKER_PORT, Wait.forListeningPort().withStartupTimeout(Duration.ofSeconds(300))) + .withLogConsumer(serviceName, outputFrame -> LOGGER.info(outputFrame.getUtf8String())) + .waitingFor(serviceName, Wait.forHealthcheck().withStartupTimeout(Duration.ofSeconds(300))); + return compose; } diff --git a/dolphinscheduler-e2e/pom.xml b/dolphinscheduler-e2e/pom.xml index ee831be1d7..c7ce90b1a6 100644 --- a/dolphinscheduler-e2e/pom.xml +++ b/dolphinscheduler-e2e/pom.xml @@ -119,7 +119,7 @@ org.testcontainers testcontainers-bom - 1.18.3 + 1.19.3 import pom