This is an automated email from the ASF dual-hosted git repository.
zihaoxiang pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/dolphinscheduler.git
The following commit(s) were added to refs/heads/dev by this push:
new d8011d857a improve e2e m1 chip local mode (#16130)
d8011d857a is described below
commit d8011d857a699b1c366463ef3a0d4b33658bb020
Author: xiangzihao <[email protected]>
AuthorDate: Tue Jun 11 13:46:21 2024 +0800
improve e2e m1 chip local mode (#16130)
Co-authored-by: Rick Cheng <[email protected]>
---
dolphinscheduler-e2e/README.md | 24 ++++++++++++++++++++++
.../e2e/core/DolphinSchedulerExtension.java | 9 ++++----
dolphinscheduler-e2e/pom.xml | 4 ++--
3 files changed, 31 insertions(+), 6 deletions(-)
diff --git a/dolphinscheduler-e2e/README.md b/dolphinscheduler-e2e/README.md
index f2fbcead77..eb332de90e 100644
--- a/dolphinscheduler-e2e/README.md
+++ b/dolphinscheduler-e2e/README.md
@@ -97,3 +97,27 @@ class TenantE2ETest {
- For UI tests, it's common that the pages might need some time to load, or
the operations might need some time to
complete, we can use `await().untilAsserted(() -> {})` to wait for the
assertions.
+## Local development
+
+### Mac M1
+Add VM options to the test configuration in IntelliJ IDEA:
+```
+# In this mode you need to install docker desktop for mac and run it with
locally
+-Dm1_chip=true
+```
+
+### Running locally(without Docker)
+```
+# In this mode you need to start frontend and backend services locally
+-Dlocal=true
+```
+
+### Running locally(with Docker)
+```
+# In this mode you only need to install docker locally
+```
+
+- To run the tests locally, you need to have the DolphinScheduler running
locally. You should add `dolphinscheduler-e2e/pom.xml` to the maven project
+ Since it does not participate in project compilation, it is not in the main
project.
+- Running run test class `org.apache.dolphinscheduler.e2e.cases.UserE2ETest`
in the IDE. After execution, the test video will be saved as mp4 in a local
temporary directory. Such as
+
`/var/folders/hf/123/T/record-3123/PASSED-[engine:junit-jupiter]/[class:org.apache.dolphinscheduler.e2e.cases.UserE2ETest]-20240606-152333.mp4`
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 21c740952c..dcf22a2d6d 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
@@ -134,8 +134,8 @@ final class DolphinSchedulerExtension implements
BeforeAllCallback, AfterAllCall
private void setBrowserContainerByOsName() {
DockerImageName imageName;
- if (LOCAL_MODE && M1_CHIP_FLAG) {
- imageName =
DockerImageName.parse("seleniarm/standalone-chromium:4.1.2-20220227")
+ if (M1_CHIP_FLAG) {
+ imageName =
DockerImageName.parse("seleniarm/standalone-chromium:124.0-chromedriver-124.0")
.asCompatibleSubstituteFor("selenium/standalone-chrome");
browser = new BrowserWebDriverContainer<>(imageName)
@@ -143,6 +143,7 @@ final class DolphinSchedulerExtension implements
BeforeAllCallback, AfterAllCall
.withCreateContainerCmdModifier(cmd ->
cmd.withUser("root"))
.withFileSystemBind(Constants.HOST_CHROME_DOWNLOAD_PATH.toFile().getAbsolutePath(),
Constants.SELENIUM_CONTAINER_CHROME_DOWNLOAD_PATH)
+ .withRecordingMode(RECORD_ALL, record.toFile(), MP4)
.withStartupTimeout(Duration.ofSeconds(300));
} else {
browser = new BrowserWebDriverContainer<>()
@@ -203,7 +204,7 @@ final class DolphinSchedulerExtension implements
BeforeAllCallback, AfterAllCall
.map(URL::getPath)
.map(File::new)
.collect(Collectors.toList());
-
+
ComposeContainer compose = new ComposeContainer(files)
.withPull(true)
.withTailChildContainers(true)
@@ -213,7 +214,7 @@ final class DolphinSchedulerExtension implements
BeforeAllCallback, AfterAllCall
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 c7ce90b1a6..6731240486 100644
--- a/dolphinscheduler-e2e/pom.xml
+++ b/dolphinscheduler-e2e/pom.xml
@@ -36,7 +36,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<junit.version>5.8.1</junit.version>
- <selenium.version>4.6.0</selenium.version>
+ <selenium.version>4.13.0</selenium.version>
<lombok.version>1.18.20</lombok.version>
<assertj-core.version>3.20.2</assertj-core.version>
<kotlin.version>1.5.30</kotlin.version>
@@ -119,7 +119,7 @@
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>testcontainers-bom</artifactId>
- <version>1.19.3</version>
+ <version>1.19.8</version>
<scope>import</scope>
<type>pom</type>
</dependency>