Skip to content

Commit

Permalink
improve e2e m1 chip local mode (#16130)
Browse files Browse the repository at this point in the history
Co-authored-by: Rick Cheng <[email protected]>
  • Loading branch information
SbloodyS and rickchengx authored Jun 11, 2024
1 parent fd5a182 commit d8011d8
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 6 deletions.
24 changes: 24 additions & 0 deletions dolphinscheduler-e2e/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Original file line number Diff line number Diff line change
Expand Up @@ -134,15 +134,16 @@ private void runInDockerContainer(ExtensionContext context) {
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)
.withCapabilities(new ChromeOptions())
.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<>()
Expand Down Expand Up @@ -203,7 +204,7 @@ private ComposeContainer createDockerCompose(ExtensionContext context) {
.map(URL::getPath)
.map(File::new)
.collect(Collectors.toList());

ComposeContainer compose = new ComposeContainer(files)
.withPull(true)
.withTailChildContainers(true)
Expand All @@ -213,7 +214,7 @@ private ComposeContainer createDockerCompose(ExtensionContext context) {
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;
}
Expand Down
4 changes: 2 additions & 2 deletions dolphinscheduler-e2e/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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>
Expand Down

0 comments on commit d8011d8

Please sign in to comment.