Browse Source

improve e2e m1 chip local mode (#16130)

Co-authored-by: Rick Cheng <rickchengx@gmail.com>
upstream-dev
xiangzihao 6 months ago committed by GitHub
parent
commit
d8011d857a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 24
      dolphinscheduler-e2e/README.md
  2. 9
      dolphinscheduler-e2e/dolphinscheduler-e2e-core/src/main/java/org/apache/dolphinscheduler/e2e/core/DolphinSchedulerExtension.java
  3. 4
      dolphinscheduler-e2e/pom.xml

24
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 - 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. 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`

9
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() { private void setBrowserContainerByOsName() {
DockerImageName imageName; DockerImageName imageName;
if (LOCAL_MODE && M1_CHIP_FLAG) { if (M1_CHIP_FLAG) {
imageName = DockerImageName.parse("seleniarm/standalone-chromium:4.1.2-20220227") imageName = DockerImageName.parse("seleniarm/standalone-chromium:124.0-chromedriver-124.0")
.asCompatibleSubstituteFor("selenium/standalone-chrome"); .asCompatibleSubstituteFor("selenium/standalone-chrome");
browser = new BrowserWebDriverContainer<>(imageName) browser = new BrowserWebDriverContainer<>(imageName)
@ -143,6 +143,7 @@ final class DolphinSchedulerExtension implements BeforeAllCallback, AfterAllCall
.withCreateContainerCmdModifier(cmd -> cmd.withUser("root")) .withCreateContainerCmdModifier(cmd -> cmd.withUser("root"))
.withFileSystemBind(Constants.HOST_CHROME_DOWNLOAD_PATH.toFile().getAbsolutePath(), .withFileSystemBind(Constants.HOST_CHROME_DOWNLOAD_PATH.toFile().getAbsolutePath(),
Constants.SELENIUM_CONTAINER_CHROME_DOWNLOAD_PATH) Constants.SELENIUM_CONTAINER_CHROME_DOWNLOAD_PATH)
.withRecordingMode(RECORD_ALL, record.toFile(), MP4)
.withStartupTimeout(Duration.ofSeconds(300)); .withStartupTimeout(Duration.ofSeconds(300));
} else { } else {
browser = new BrowserWebDriverContainer<>() browser = new BrowserWebDriverContainer<>()
@ -203,7 +204,7 @@ final class DolphinSchedulerExtension implements BeforeAllCallback, AfterAllCall
.map(URL::getPath) .map(URL::getPath)
.map(File::new) .map(File::new)
.collect(Collectors.toList()); .collect(Collectors.toList());
ComposeContainer compose = new ComposeContainer(files) ComposeContainer compose = new ComposeContainer(files)
.withPull(true) .withPull(true)
.withTailChildContainers(true) .withTailChildContainers(true)
@ -213,7 +214,7 @@ final class DolphinSchedulerExtension implements BeforeAllCallback, AfterAllCall
DOCKER_PORT, Wait.forListeningPort().withStartupTimeout(Duration.ofSeconds(300))) DOCKER_PORT, Wait.forListeningPort().withStartupTimeout(Duration.ofSeconds(300)))
.withLogConsumer(serviceName, outputFrame -> LOGGER.info(outputFrame.getUtf8String())) .withLogConsumer(serviceName, outputFrame -> LOGGER.info(outputFrame.getUtf8String()))
.waitingFor(serviceName, Wait.forHealthcheck().withStartupTimeout(Duration.ofSeconds(300))); .waitingFor(serviceName, Wait.forHealthcheck().withStartupTimeout(Duration.ofSeconds(300)));
return compose; return compose;
} }

4
dolphinscheduler-e2e/pom.xml

@ -36,7 +36,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<junit.version>5.8.1</junit.version> <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> <lombok.version>1.18.20</lombok.version>
<assertj-core.version>3.20.2</assertj-core.version> <assertj-core.version>3.20.2</assertj-core.version>
<kotlin.version>1.5.30</kotlin.version> <kotlin.version>1.5.30</kotlin.version>
@ -119,7 +119,7 @@
<dependency> <dependency>
<groupId>org.testcontainers</groupId> <groupId>org.testcontainers</groupId>
<artifactId>testcontainers-bom</artifactId> <artifactId>testcontainers-bom</artifactId>
<version>1.19.3</version> <version>1.19.8</version>
<scope>import</scope> <scope>import</scope>
<type>pom</type> <type>pom</type>
</dependency> </dependency>

Loading…
Cancel
Save