kezhenxu94 commented on a change in pull request #8085:
URL: https://github.com/apache/dolphinscheduler/pull/8085#discussion_r787287400



##########
File path: 
dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/resources/docker/datasource-clickhouse/docker-compose.yaml
##########
@@ -0,0 +1,61 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+version: "2.1"
+
+services:
+  dolphinscheduler:
+    image: apache/dolphinscheduler-standalone-server:ci
+    environment:
+      MASTER_MAX_CPU_LOAD_AVG: 100
+      WORKER_TENANT_AUTO_CREATE: 'true'
+    expose:
+      - 12345
+    networks:
+      - e2e
+    healthcheck:
+      test: [ "CMD", "curl", "http://localhost:12345/actuator/health"; ]
+      interval: 5s
+      timeout: 60s
+      retries: 120
+    depends_on:
+      clickhouse:
+        condition: service_healthy
+  clickhouse:
+    image: yandex/clickhouse-server:latest

Review comment:
       Please never use `latest` tag in our test, because when they have newer 
Docker images that are incompatible we will face test failure without any clue. 
Pin it to a specific tag.

##########
File path: 
dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/resources/docker/datasource-mysql/docker-compose.yaml
##########
@@ -0,0 +1,57 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+version: "2.1"
+
+services:
+  dolphinscheduler:
+    image: apache/dolphinscheduler-standalone-server:ci
+    environment:
+      MASTER_MAX_CPU_LOAD_AVG: 100
+      WORKER_TENANT_AUTO_CREATE: 'true'
+    expose:
+      - 12345
+    networks:
+      - e2e
+    volumes:
+      - 
./mysql-connector-java-8.0.16.jar:/opt/dolphinscheduler/libs/mysql-connector-java-8.0.16.jar

Review comment:
       You put the `.jar` file in the codebase, but we cannot include this 
binary file in our releases (due to release policy and license issue), you have 
2 choices:
   
   1. modify our release script to exclude this binary file, but that causes 
E2E tests failed if users run the tests from our release.
   2. write a script to download the binary on the fly, like what we did in 
SkyWalking,
   
   
https://github.com/apache/skywalking/blob/master/test/e2e-v2/script/prepare/setup-oap/download-mysql.sh
   
   
https://github.com/apache/skywalking/blob/1eacba86fd60e5461b8d45e6a49a6e6636b3b1e1/test/e2e-v2/script/docker-compose/base-compose.yml#L29
   
   
https://github.com/apache/skywalking/blob/1eacba86fd60e5461b8d45e6a49a6e6636b3b1e1/test/e2e-v2/cases/storage/mysql/docker-compose.yml#L44
   
   

##########
File path: 
dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/pages/datasource/DataSourcePage.java
##########
@@ -0,0 +1,161 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.dolphinscheduler.e2e.pages.datasource;
+
+import lombok.Getter;
+
+import org.apache.dolphinscheduler.e2e.pages.common.NavBarPage;
+
+import java.util.List;
+
+import org.openqa.selenium.By;
+import org.openqa.selenium.WebElement;
+import org.openqa.selenium.remote.RemoteWebDriver;
+import org.openqa.selenium.support.FindBy;
+import org.openqa.selenium.support.FindBys;
+import org.openqa.selenium.support.PageFactory;
+import org.openqa.selenium.support.ui.ExpectedConditions;
+import org.openqa.selenium.support.ui.Select;
+import org.openqa.selenium.support.ui.WebDriverWait;
+
+
+@Getter
+public class DataSourcePage extends NavBarPage implements 
NavBarPage.NavBarItem {
+
+    @FindBy(id = "btnCreateDataSource")
+    private WebElement buttonCreateDataSource;
+
+    @FindBy(className = "dataSourceItems")
+    private List<WebElement> dataSourceItemsList;
+
+    @FindBys({
+        @FindBy(className = "el-popconfirm"),
+        @FindBy(className = "el-button--primary"),
+    })
+    private List<WebElement> buttonConfirm;
+
+    private final CreateDataSourceForm createDataSourceForm;
+
+    public DataSourcePage(RemoteWebDriver driver) {
+        super(driver);
+
+        createDataSourceForm = new CreateDataSourceForm();
+    }
+
+    public DataSourcePage createDataSource(String dataSourceType, String 
dataSourceName, String dataSourceDescription, String ip, String port, String 
userName, String password, String database,
+                                           String jdbcParams) {
+        buttonCreateDataSource().click();
+
+        createDataSourceForm().btnDataSourceTypeDropdown().click();
+
+        new WebDriverWait(driver, 
10).until(ExpectedConditions.visibilityOfElementLocated(new 
By.ById("dialogCreateDataSource")));
+
+        createDataSourceForm().selectDataSourceType()
+            .stream()
+            .filter(it -> it.getText().contains(dataSourceType.toUpperCase()))
+            .findFirst()
+            .orElseThrow(() -> new RuntimeException(String.format("No %s in 
data source type list", dataSourceType.toUpperCase())))
+            .click();
+
+        createDataSourceForm().inputDataSourceName().sendKeys(dataSourceName);
+        
createDataSourceForm().inputDataSourceDescription().sendKeys(dataSourceDescription);
+        createDataSourceForm().inputIP().sendKeys(ip);
+        createDataSourceForm().inputPort().clear();
+        createDataSourceForm().inputPort().sendKeys(port);
+        createDataSourceForm().inputUserName().sendKeys(userName);
+        createDataSourceForm().inputPassword().sendKeys(password);
+        createDataSourceForm().inputDataBase().sendKeys(database);
+
+        if (!"".equals(jdbcParams)) {
+            createDataSourceForm().inputJdbcParams().sendKeys(jdbcParams);
+        }
+
+        createDataSourceForm().buttonSubmit().click();
+
+        return this;
+    }
+
+    public DataSourcePage delete(String name) {
+        dataSourceItemsList()
+            .stream()
+            .filter(it -> it.getText().contains(name))
+            .flatMap(it -> it.findElements(By.id("btnDelete")).stream())
+            .filter(WebElement::isDisplayed)
+            .findFirst()
+            .orElseThrow(() -> new RuntimeException("No delete button in data 
source list"))
+            .click();
+
+        buttonConfirm()
+            .stream()
+            .filter(WebElement::isDisplayed)
+            .findFirst()
+            .orElseThrow(() -> new RuntimeException("No confirm button when 
deleting"))
+            .click();
+
+        return this;
+    }
+
+    @Getter
+    public class CreateDataSourceForm {
+        CreateDataSourceForm() {
+            PageFactory.initElements(driver, this);
+        }
+
+        @FindBy(className = "OptionsDataSourceType")

Review comment:
       According to the UI team, UI class names are kebab-case, like 
`options-datasource-type`, UI id names are camel-case (you are right in ID 
naming)

##########
File path: 
dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/resources/docker/datasource-postgresql/docker-compose.yaml
##########
@@ -0,0 +1,54 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+version: "2.1"
+
+services:
+  dolphinscheduler:
+    image: apache/dolphinscheduler-standalone-server:ci
+    environment:
+      MASTER_MAX_CPU_LOAD_AVG: 100
+      WORKER_TENANT_AUTO_CREATE: 'true'
+    expose:
+      - 12345
+    networks:
+      - e2e
+    healthcheck:
+      test: [ "CMD", "curl", "http://localhost:12345/actuator/health"; ]
+      interval: 5s
+      timeout: 60s
+      retries: 120
+    depends_on:
+      postgres:
+        condition: service_healthy
+  postgres:
+    image: postgres:latest

Review comment:
       Same here, don't use `latest` tag




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to