improve e2e m1 chip local mode (#16130)
Co-authored-by: Rick Cheng <rickchengx@gmail.com>
This commit is contained in:
parent
fd5a182cd6
commit
d8011d857a
|
|
@ -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`
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
Loading…
Reference in New Issue