You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@streampark.apache.org by "zzzk1 (via GitHub)" <gi...@apache.org> on 2024/07/24 16:29:53 UTC
[PR] [Feature] Introduce environment e2e test [incubator-streampark]
zzzk1 opened a new pull request, #3911:
URL: https://github.com/apache/incubator-streampark/pull/3911
<!--
Thank you for contributing to StreamPark! Please make sure that your code changes
are covered with tests. And in case of new features or big changes
remember to adjust the documentation.
## Contribution Checklist
- If this is your first time, please read our contributor guidelines: [Submit Code](https://streampark.apache.org/community/submit_guide/submit_code).
- Make sure that the pull request corresponds to a [GITHUB issue](https://github.com/apache/incubator-streampark/issues).
- Name the pull request in the form "[Feature] Title of the pull request", where *Feature* can be replaced by `Hotfix`, `Bug`, etc.
- Fill out the template below to describe the changes contributed by the pull request. That will give reviewers the context they need to do the review.
- If the PR is unfinished, add `[WIP]` in your PR title, e.g., `[WIP][Feature] Title of the pull request`.
-->
## What changes were proposed in this pull request
Issue Number: close #3853 <!-- REMOVE this line if no issue to close -->
- Add basic environment e2e test cases.
<!--(For example: This pull request proposed to add checkstyle plugin).-->
## Brief change log
<!--*(for example:)*
- *Add maven-checkstyle-plugin to root pom.xml*
-->
## Verifying this change
<!--*(Please pick either of the following options)*-->
This change is a trivial rework / code cleanup without any test coverage.
*(or)*
This change is already covered by existing tests, such as *(please describe tests)*.
*(or)*
This change added tests and can be verified as follows:
<!--*(example:)*
- *Added integration tests for end-to-end.*
- *Added *Test to verify the change.*
- *Manually verified the change by testing locally.* -->
## Does this pull request potentially affect one of the following parts
- Dependencies (does it add or upgrade a dependency): (no)
--
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: issues-unsubscribe@streampark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature] Introduce environment e2e test [incubator-streampark]
Posted by "sonarcloud[bot] (via GitHub)" <gi...@apache.org>.
sonarcloud[bot] commented on PR #3911:
URL: https://github.com/apache/incubator-streampark/pull/3911#issuecomment-2265751031
## [](https://sonarcloud.io/dashboard?id=apache_incubator-streampark&pullRequest=3911) **Quality Gate passed**
Issues
 [8 New issues](https://sonarcloud.io/project/issues?id=apache_incubator-streampark&pullRequest=3911&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_incubator-streampark&pullRequest=3911&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_incubator-streampark&pullRequest=3911&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_incubator-streampark&pullRequest=3911&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_incubator-streampark&pullRequest=3911&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarCloud](https://sonarcloud.io/dashboard?id=apache_incubator-streampark&pullRequest=3911)
--
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: issues-unsubscribe@streampark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature] Introduce environment e2e test [incubator-streampark]
Posted by "SbloodyS (via GitHub)" <gi...@apache.org>.
SbloodyS commented on PR #3911:
URL: https://github.com/apache/incubator-streampark/pull/3911#issuecomment-2249148412
> @SbloodyS Some issues causing the test to fail and I'm really confused. Can you take a look?
You can find it in https://github.com/apache/incubator-streampark/actions/runs/10080467441/job/27885329088?pr=3911
```
Error: testCreateDockerSettingFailed Time elapsed: 11.657 s <<< ERROR!
org.openqa.selenium.TimeoutException:
Expected condition failed: waiting for element to be clickable: [[RemoteWebDriver: chrome on linux (6f4d768734238798ce49c409cf2a7d10)] -> xpath: //button[contains(@class, 'ant-btn')]//span[contains(text(), 'OK')]] (tried for 10 second(s) with 500 milliseconds interval)
```
--
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: issues-unsubscribe@streampark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature] Introduce environment e2e test [incubator-streampark]
Posted by "SbloodyS (via GitHub)" <gi...@apache.org>.
SbloodyS merged PR #3911:
URL: https://github.com/apache/incubator-streampark/pull/3911
--
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: issues-unsubscribe@streampark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature] Introduce environment e2e test [incubator-streampark]
Posted by "sonarcloud[bot] (via GitHub)" <gi...@apache.org>.
sonarcloud[bot] commented on PR #3911:
URL: https://github.com/apache/incubator-streampark/pull/3911#issuecomment-2267572608
## [](https://sonarcloud.io/dashboard?id=apache_incubator-streampark&pullRequest=3911) **Quality Gate passed**
Issues
 [8 New issues](https://sonarcloud.io/project/issues?id=apache_incubator-streampark&pullRequest=3911&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_incubator-streampark&pullRequest=3911&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_incubator-streampark&pullRequest=3911&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_incubator-streampark&pullRequest=3911&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_incubator-streampark&pullRequest=3911&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarCloud](https://sonarcloud.io/dashboard?id=apache_incubator-streampark&pullRequest=3911)
--
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: issues-unsubscribe@streampark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature] Introduce environment e2e test [incubator-streampark]
Posted by "sonarcloud[bot] (via GitHub)" <gi...@apache.org>.
sonarcloud[bot] commented on PR #3911:
URL: https://github.com/apache/incubator-streampark/pull/3911#issuecomment-2258364925
## [](https://sonarcloud.io/dashboard?id=apache_incubator-streampark&pullRequest=3911) **Quality Gate passed**
Issues
 [8 New issues](https://sonarcloud.io/project/issues?id=apache_incubator-streampark&pullRequest=3911&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_incubator-streampark&pullRequest=3911&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_incubator-streampark&pullRequest=3911&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_incubator-streampark&pullRequest=3911&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_incubator-streampark&pullRequest=3911&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarCloud](https://sonarcloud.io/dashboard?id=apache_incubator-streampark&pullRequest=3911)
--
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: issues-unsubscribe@streampark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature] Introduce environment e2e test [incubator-streampark]
Posted by "SbloodyS (via GitHub)" <gi...@apache.org>.
SbloodyS commented on code in PR #3911:
URL: https://github.com/apache/incubator-streampark/pull/3911#discussion_r1696885733
##########
streampark-e2e/streampark-e2e-case/src/test/java/org/apache/streampark/e2e/pages/setting/env/EnvironmentPage.java:
##########
@@ -0,0 +1,87 @@
+/*
+ * 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.streampark.e2e.pages.setting.env;
+
+import org.apache.streampark.e2e.pages.common.Constants;
+import org.apache.streampark.e2e.pages.common.NavBarPage;
+import org.apache.streampark.e2e.pages.setting.SettingPage;
+
+import lombok.Getter;
+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.ui.ExpectedConditions;
+import org.openqa.selenium.support.ui.WebDriverWait;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.List;
+
+import static org.apache.streampark.e2e.pages.common.CommonFactory.WebElementClick;
+
+@Getter
+public class EnvironmentPage extends NavBarPage implements SettingPage.Tab {
+
+ private static final Logger log = LoggerFactory.getLogger(EnvironmentPage.class);
+
+ public EnvironmentPage(RemoteWebDriver driver) {
+ super(driver);
+ }
+
+ @FindBys({
+ @FindBy(xpath = "//h4[text()='Docker Setting']"),
+ @FindBy(xpath = "./ancestor::li[@class='ant-list-item']//button[contains(@class, 'ant-btn') and contains(@class, 'ant-btn-primary') and contains(@class, 'ant-btn-circle')]")
+ })
+ private WebElement btnCreateDockerSetting;
+
+ @FindBys({
+ @FindBy(xpath = "//h4[text()='Alert Mailbox Setting']"),
+ @FindBy(xpath = "./ancestor::li[@class='ant-list-item']//button[contains(@class, 'ant-btn') and contains(@class, 'ant-btn-primary') and contains(@class, 'ant-btn-circle')]")
+ })
+ private WebElement btnCreateEmailSetting;
+
+ @FindBy(xpath = "//div[contains(@class, 'system-setting')]")
+ private List<WebElement> settingList;
+
+ @FindBy(className = "swal2-container")
+ private List<WebElement> errorMessageList;
+
+ @FindBy(xpath = "//button[contains(@class, 'swal2-confirm') and contains(@class, 'swal2-styled') and text()='OK']")
+ private WebElement errorMessageConfirmButton;
+
+ public EnvironmentDetailForm createEnvironment(EnvironmentDetailForm.EnvSettingTypeEnum envSettingTypeEnum) {
+ waitForPageLoading();
+ switch (envSettingTypeEnum) {
+ case Docker:
+ WebElementClick(driver, btnCreateDockerSetting);
+ break;
+ case Email:
+ WebElementClick(driver, btnCreateEmailSetting);
+ break;
+ default:
+ // ignore
Review Comment:
It's better throw exception here.
##########
streampark-console/streampark-console-webapp/src/views/setting/system/SettingForm.vue:
##########
@@ -102,15 +102,13 @@
icon: 'error',
title: t('setting.system.update.dockerNotStart'),
showConfirmButton: true,
- timer: 3500,
Review Comment:
Why remove this?
##########
streampark-e2e/streampark-e2e-case/src/test/resources/docker/environment/docker-compose.yaml:
##########
@@ -0,0 +1,62 @@
+#
+# 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.
+#
+
+services:
+ streampark:
+ image: apache/streampark:ci-basic
+ command: bash bin/streampark.sh start_docker
+ build:
+ context: ./
+ dockerfile: ./Dockerfile
+ ports:
+ - 10000:10000
+ - 10030:10030
+ environment:
+ - SPRING_PROFILES_ACTIVE=h2
+ - TZ=Asia/Shanghai
+ - DOCKER_HOST=tcp://dind:2375
+ privileged: true
+ restart: unless-stopped
+ networks:
+ - e2e
+ volumes:
+ - ${HOME}/streampark_build_logs:/tmp/streampark/logs/build_logs/
+ healthcheck:
+ test: [ "CMD", "curl", "http://localhost:10000" ]
+ interval: 5s
+ timeout: 5s
+ retries: 120
+
+ dind:
+ image: docker:latest
+ privileged: true
+ environment:
+ - DOCKER_TLS_CERTDIR=/certs
+ command: ["dockerd", "--host=tcp://0.0.0.0:2375"]
+ volumes:
+ - dind-certs:/certs
+ - dind-var-lib-docker:/var/lib/docker
+ ports:
+ - "2375:2375"
+ networks:
+ - e2e
Review Comment:
We don't need this since we already have docker in docker in the default image. We just need a simple mount local docker to container. You can refer to https://github.com/apache/incubator-streampark/blob/1c3b89095d6eec6ac6f28078c66d8f7f60db1d2e/docker/docker-compose.yaml#L33-L36
--
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: issues-unsubscribe@streampark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature] Introduce environment e2e test [incubator-streampark]
Posted by "zzzk1 (via GitHub)" <gi...@apache.org>.
zzzk1 commented on PR #3911:
URL: https://github.com/apache/incubator-streampark/pull/3911#issuecomment-2248466750
@SbloodyS Some issues causing the test to fail and I'm really confused. Can you take a look?
--
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: issues-unsubscribe@streampark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature] Introduce environment e2e test [incubator-streampark]
Posted by "sonarcloud[bot] (via GitHub)" <gi...@apache.org>.
sonarcloud[bot] commented on PR #3911:
URL: https://github.com/apache/incubator-streampark/pull/3911#issuecomment-2270268663
## [](https://sonarcloud.io/dashboard?id=apache_incubator-streampark&pullRequest=3911) **Quality Gate passed**
Issues
 [8 New issues](https://sonarcloud.io/project/issues?id=apache_incubator-streampark&pullRequest=3911&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_incubator-streampark&pullRequest=3911&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_incubator-streampark&pullRequest=3911&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_incubator-streampark&pullRequest=3911&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_incubator-streampark&pullRequest=3911&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarCloud](https://sonarcloud.io/dashboard?id=apache_incubator-streampark&pullRequest=3911)
--
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: issues-unsubscribe@streampark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature] Introduce environment e2e test [incubator-streampark]
Posted by "sonarcloud[bot] (via GitHub)" <gi...@apache.org>.
sonarcloud[bot] commented on PR #3911:
URL: https://github.com/apache/incubator-streampark/pull/3911#issuecomment-2276963104
## [](https://sonarcloud.io/dashboard?id=apache_incubator-streampark&pullRequest=3911) **Quality Gate passed**
Issues
 [8 New issues](https://sonarcloud.io/project/issues?id=apache_incubator-streampark&pullRequest=3911&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_incubator-streampark&pullRequest=3911&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_incubator-streampark&pullRequest=3911&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_incubator-streampark&pullRequest=3911&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_incubator-streampark&pullRequest=3911&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarCloud](https://sonarcloud.io/dashboard?id=apache_incubator-streampark&pullRequest=3911)
--
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: issues-unsubscribe@streampark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature] Introduce environment e2e test [incubator-streampark]
Posted by "sonarcloud[bot] (via GitHub)" <gi...@apache.org>.
sonarcloud[bot] commented on PR #3911:
URL: https://github.com/apache/incubator-streampark/pull/3911#issuecomment-2258373512
## [](https://sonarcloud.io/dashboard?id=apache_incubator-streampark&pullRequest=3911) **Quality Gate passed**
Issues
 [8 New issues](https://sonarcloud.io/project/issues?id=apache_incubator-streampark&pullRequest=3911&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_incubator-streampark&pullRequest=3911&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_incubator-streampark&pullRequest=3911&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_incubator-streampark&pullRequest=3911&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_incubator-streampark&pullRequest=3911&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarCloud](https://sonarcloud.io/dashboard?id=apache_incubator-streampark&pullRequest=3911)
--
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: issues-unsubscribe@streampark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature] Introduce environment e2e test [incubator-streampark]
Posted by "sonarcloud[bot] (via GitHub)" <gi...@apache.org>.
sonarcloud[bot] commented on PR #3911:
URL: https://github.com/apache/incubator-streampark/pull/3911#issuecomment-2258189430
## [](https://sonarcloud.io/dashboard?id=apache_incubator-streampark&pullRequest=3911) **Quality Gate passed**
Issues
 [8 New issues](https://sonarcloud.io/project/issues?id=apache_incubator-streampark&pullRequest=3911&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_incubator-streampark&pullRequest=3911&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_incubator-streampark&pullRequest=3911&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_incubator-streampark&pullRequest=3911&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_incubator-streampark&pullRequest=3911&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarCloud](https://sonarcloud.io/dashboard?id=apache_incubator-streampark&pullRequest=3911)
--
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: issues-unsubscribe@streampark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature] Introduce environment e2e test [incubator-streampark]
Posted by "sonarcloud[bot] (via GitHub)" <gi...@apache.org>.
sonarcloud[bot] commented on PR #3911:
URL: https://github.com/apache/incubator-streampark/pull/3911#issuecomment-2266370486
## [](https://sonarcloud.io/dashboard?id=apache_incubator-streampark&pullRequest=3911) **Quality Gate passed**
Issues
 [8 New issues](https://sonarcloud.io/project/issues?id=apache_incubator-streampark&pullRequest=3911&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_incubator-streampark&pullRequest=3911&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_incubator-streampark&pullRequest=3911&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_incubator-streampark&pullRequest=3911&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_incubator-streampark&pullRequest=3911&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarCloud](https://sonarcloud.io/dashboard?id=apache_incubator-streampark&pullRequest=3911)
--
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: issues-unsubscribe@streampark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature] Introduce environment e2e test [incubator-streampark]
Posted by "zzzk1 (via GitHub)" <gi...@apache.org>.
zzzk1 commented on code in PR #3911:
URL: https://github.com/apache/incubator-streampark/pull/3911#discussion_r1690125206
##########
streampark-e2e/streampark-e2e-case/src/test/java/org/apache/streampark/e2e/pages/setting/env/EmailSettingForm.java:
##########
@@ -0,0 +1,100 @@
+/*
+ * 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.streampark.e2e.pages.setting.env;
+
+import lombok.Getter;
+import org.openqa.selenium.WebDriver;
+import org.openqa.selenium.WebElement;
+import org.openqa.selenium.support.FindBy;
+
+import static org.apache.streampark.e2e.pages.common.CommonFactory.WebElementClick;
+import static org.apache.streampark.e2e.pages.common.CommonFactory.WebElementDeleteAndInput;
+
+@Getter
+public class EmailSettingForm extends CommonForm {
+
+ private WebDriver driver;
+
+ @FindBy(id = "SettingForm_host")
+ private WebElement inputSmtpHost;
+
+ @FindBy(xpath = "//input[@placeholder='Smtp Port']")
+ private WebElement inputSmtpPort;
+
+ @FindBy(id = "SettingForm_from")
+ private WebElement inputAddress;
+
+ @FindBy(id = "SettingForm_userName")
+ private WebElement inputUsername;
+
+ @FindBy(xpath = "//input[@placeholder='Email Password']")
+ private WebElement inputPassword;
+
+ @FindBy(id = "SettingForm_ssl")
+ private WebElement btnEnableSSL;
+
+ @FindBy(xpath = "//button[contains(@class, 'ant-btn')]//span[contains(text(), 'OK')]")
+ private WebElement buttonOk;
+
+ @FindBy(xpath = "//button[contains(@class, 'ant-btn')]//span[contains(text(), 'Cancel')]")
+ private WebElement buttonCancel;
Review Comment:
cause test case failed.
##########
streampark-e2e/streampark-e2e-case/src/test/java/org/apache/streampark/e2e/pages/setting/env/DockerSettingForm.java:
##########
@@ -0,0 +1,85 @@
+/*
+ * 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.streampark.e2e.pages.setting.env;
+
+import lombok.Getter;
+import org.openqa.selenium.WebDriver;
+import org.openqa.selenium.WebElement;
+import org.openqa.selenium.support.FindBy;
+
+import static org.apache.streampark.e2e.pages.common.CommonFactory.WebElementClick;
+import static org.apache.streampark.e2e.pages.common.CommonFactory.WebElementDeleteAndInput;
+
+@Getter
+public class DockerSettingForm extends CommonForm {
+
+ private WebDriver driver;
+
+ @FindBy(id = "SettingForm_address")
+ private WebElement inputAddress;
+
+ @FindBy(id = "SettingForm_namespace")
+ private WebElement inputNamespace;
+
+ @FindBy(id = "SettingForm_username")
+ private WebElement inputUsername;
+
+ @FindBy(xpath = "//input[@placeholder='Docker Password']")
+ private WebElement inputPassword;
+
+ @FindBy(xpath = "//button[contains(@class, 'ant-btn')]//span[contains(text(), 'OK')]")
+ private WebElement buttonOk;
+
+ @FindBy(xpath = "//button[contains(@class, 'ant-btn')]//span[contains(text(), 'Cancel')]")
+ private WebElement buttonCancel;
Review Comment:
cause test case failed.
##########
streampark-e2e/streampark-e2e-case/src/test/java/org/apache/streampark/e2e/cases/EnvironmentTest.java:
##########
@@ -0,0 +1,176 @@
+/*
+ * 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.streampark.e2e.cases;
+
+import org.apache.streampark.e2e.core.StreamPark;
+import org.apache.streampark.e2e.pages.LoginPage;
+import org.apache.streampark.e2e.pages.common.Constants;
+import org.apache.streampark.e2e.pages.setting.SettingPage;
+import org.apache.streampark.e2e.pages.setting.env.DockerSettingForm;
+import org.apache.streampark.e2e.pages.setting.env.EmailSettingForm;
+import org.apache.streampark.e2e.pages.setting.env.EnvironmentDetailForm;
+import org.apache.streampark.e2e.pages.setting.env.EnvironmentPage;
+import org.apache.streampark.e2e.pages.setting.env.IngressSettingForm;
+import org.apache.streampark.e2e.pages.setting.env.MavenSettingForm;
+
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Order;
+import org.junit.jupiter.api.Test;
+import org.openqa.selenium.WebElement;
+import org.openqa.selenium.remote.RemoteWebDriver;
+import org.openqa.selenium.support.ui.ExpectedConditions;
+import org.openqa.selenium.support.ui.WebDriverWait;
+import org.testcontainers.shaded.org.awaitility.Awaitility;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+@StreamPark(composeFiles = "docker/basic/docker-compose.yaml")
+public class EnvironmentTest {
+
+ private static RemoteWebDriver browser;
+
+ private static final String userName = "admin";
+
+ private static final String password = "streampark";
+
+ private static final String teamName = "default";
+
+ // maven
+ final String mavenFilePath = "/maven/file/path";
+ final String mavenCentralRepository = "https://mvnrepository.com/";
+ final String mavenAuthUser = "maven_user";
+ final String mavenAuthPassword = "maven_password";
+
+ // ingress
+ final String ingressDomainAddress = "https://localhost";
+
+ // docker
+ final String dockerAddress = "https://hub.docker.com/v2/";
+ final String dockerNamespace = "hello";
+ final String dockerUser = "docker_user";
+ final String dockerPassword = "docker_password";
+
+ // email
+ final String emailHost = "smtp.163.com";
+ final String emailPort = "25";
+ final String emailAddress = "hello@163.com";
+ final String emailUser = "email_password";
+ final String emailPassword = "email_password";
+
+ final @BeforeAll public static void setup() {
+ new LoginPage(browser)
+ .login(userName, password, teamName)
+ .goToNav(SettingPage.class)
+ .goToTab(EnvironmentPage.class);
+ }
+
+ @Test
+ @Order(10)
+ public void testCreateEnvironment() {
+ final EnvironmentPage environmentPage = new EnvironmentPage(browser);
+
+ environmentPage.createEnvironment(EnvironmentDetailForm.EnvSettingTypeEnum.Maven)
+ .<MavenSettingForm>addSetting(EnvironmentDetailForm.EnvSettingTypeEnum.Maven)
+ .filePath(mavenFilePath)
+ .centralRepository(mavenCentralRepository)
+ .authUser(mavenAuthUser)
+ .authPassword(mavenAuthPassword);
+
+ environmentPage.createEnvironment(EnvironmentDetailForm.EnvSettingTypeEnum.Ingress)
+ .<IngressSettingForm>addSetting(EnvironmentDetailForm.EnvSettingTypeEnum.Ingress)
+ .domainAddress(ingressDomainAddress);
+
+ Awaitility.await()
+ .untilAsserted(
+ () -> assertThat(environmentPage.settingList())
+ .as("Setting list should contain newly-created setting")
+ .extracting(WebElement::getText)
+ .anyMatch(it -> it.contains(mavenFilePath))
+ .anyMatch(it -> it.contains(mavenCentralRepository))
+ .anyMatch(it -> it.contains(mavenAuthUser))
+ .anyMatch(it -> it.contains(ingressDomainAddress)));
+ }
+
+ @Test
+ @Order(20)
+ public void testCreateEmailSettingFailedWithAuth() {
+ final EnvironmentPage environmentPage = new EnvironmentPage(browser);
+
+ EmailSettingForm emailSettingForm =
+ environmentPage.createEnvironment(EnvironmentDetailForm.EnvSettingTypeEnum.Email)
+ .<EmailSettingForm>addSetting(EnvironmentDetailForm.EnvSettingTypeEnum.Email)
+ .host(emailHost)
+ .port(emailPort)
+ .address(emailAddress)
+ .user(emailUser)
+ .password(emailPassword)
+ .ok();
+
+ String expectedErrorMessage =
+ "connect to target mail server failed: 535 Error: authentication failed";
+ Awaitility.await()
+
+ .untilAsserted(
+ () -> {
+ new WebDriverWait(browser, Constants.DEFAULT_WEBDRIVER_WAIT_DURATION);
+ assertThat(environmentPage.errorMessageList())
+ .as("Connect failed error message should be displayed")
+ .extracting(WebElement::getText)
+ .anyMatch(it -> it.contains(expectedErrorMessage));
+ });
+
+ new WebDriverWait(browser, Constants.DEFAULT_WEBDRIVER_WAIT_DURATION)
+ .until(ExpectedConditions.elementToBeClickable(environmentPage.errorMessageConfirmButton()));
+ environmentPage.errorMessageConfirmButton().click();
+ emailSettingForm.cancel();
+ }
+
+ @Test
+ @Order(130)
+ public void testCreateDockerSettingFailed() {
+ final EnvironmentPage environmentPage = new EnvironmentPage(browser);
+
+ DockerSettingForm dockerSettingForm =
+ environmentPage.createEnvironment(EnvironmentDetailForm.EnvSettingTypeEnum.Docker)
+ .<DockerSettingForm>addSetting(EnvironmentDetailForm.EnvSettingTypeEnum.Docker)
+ .address(dockerAddress)
+ .namespace(dockerNamespace)
+ .user(dockerUser)
+ .password(dockerPassword)
+ .ok();
+
+ String expectedErrorMessage = String.format(
+ "Failed to validate Docker registry, error: Status 500: {\"message\":\"login attempt to %s failed with status: 404 Not Found\"}",
+ dockerAddress);
+ Awaitility.await()
+
+ .untilAsserted(
+ () -> {
+ new WebDriverWait(browser, Constants.DEFAULT_WEBDRIVER_WAIT_DURATION);
+ assertThat(environmentPage.errorMessageList())
+ .as("Failed to validate docker registry error message should be displayed")
+ .extracting(WebElement::getText)
+ .anyMatch(it -> it.contains(expectedErrorMessage));
+ });
+
+ new WebDriverWait(browser, Constants.DEFAULT_WEBDRIVER_WAIT_DURATION)
+ .until(ExpectedConditions.elementToBeClickable(environmentPage.errorMessageConfirmButton()));
+ environmentPage.errorMessageConfirmButton().click();
+ dockerSettingForm.cancel();
+ }
+}
Review Comment:
Can't pass at the same time because `EmailSettingForm#buttonOk()` and `DockerSettingForm#buttonOk()` are unstable?
--
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: issues-unsubscribe@streampark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature] Introduce environment e2e test [incubator-streampark]
Posted by "sonarcloud[bot] (via GitHub)" <gi...@apache.org>.
sonarcloud[bot] commented on PR #3911:
URL: https://github.com/apache/incubator-streampark/pull/3911#issuecomment-2249680142
## [](https://sonarcloud.io/dashboard?id=apache_incubator-streampark&pullRequest=3911) **Quality Gate passed**
Issues
 [10 New issues](https://sonarcloud.io/project/issues?id=apache_incubator-streampark&pullRequest=3911&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_incubator-streampark&pullRequest=3911&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_incubator-streampark&pullRequest=3911&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_incubator-streampark&pullRequest=3911&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_incubator-streampark&pullRequest=3911&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarCloud](https://sonarcloud.io/dashboard?id=apache_incubator-streampark&pullRequest=3911)
--
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: issues-unsubscribe@streampark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature] Introduce environment e2e test [incubator-streampark]
Posted by "sonarcloud[bot] (via GitHub)" <gi...@apache.org>.
sonarcloud[bot] commented on PR #3911:
URL: https://github.com/apache/incubator-streampark/pull/3911#issuecomment-2248447594
## [](https://sonarcloud.io/dashboard?id=apache_incubator-streampark&pullRequest=3911) **Quality Gate passed**
Issues
 [9 New issues](https://sonarcloud.io/project/issues?id=apache_incubator-streampark&pullRequest=3911&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_incubator-streampark&pullRequest=3911&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_incubator-streampark&pullRequest=3911&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_incubator-streampark&pullRequest=3911&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_incubator-streampark&pullRequest=3911&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarCloud](https://sonarcloud.io/dashboard?id=apache_incubator-streampark&pullRequest=3911)
--
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: issues-unsubscribe@streampark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature] Introduce environment e2e test [incubator-streampark]
Posted by "sonarcloud[bot] (via GitHub)" <gi...@apache.org>.
sonarcloud[bot] commented on PR #3911:
URL: https://github.com/apache/incubator-streampark/pull/3911#issuecomment-2250767784
## [](https://sonarcloud.io/dashboard?id=apache_incubator-streampark&pullRequest=3911) **Quality Gate passed**
Issues
 [10 New issues](https://sonarcloud.io/project/issues?id=apache_incubator-streampark&pullRequest=3911&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_incubator-streampark&pullRequest=3911&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_incubator-streampark&pullRequest=3911&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_incubator-streampark&pullRequest=3911&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_incubator-streampark&pullRequest=3911&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarCloud](https://sonarcloud.io/dashboard?id=apache_incubator-streampark&pullRequest=3911)
--
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: issues-unsubscribe@streampark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org