This is an automated email from the ASF dual-hosted git repository.
benjobs pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/incubator-streampark.git
The following commit(s) were added to refs/heads/dev by this push:
new 34c270543 [Feature-3831] Add resource project e2e test cases (#3852)
34c270543 is described below
commit 34c2705436b5c86448548bd2db759144d3614d5b
Author: xiangzihao <[email protected]>
AuthorDate: Fri Jul 12 08:34:22 2024 +0800
[Feature-3831] Add resource project e2e test cases (#3852)
* add feature 3851
---
.github/actions/paths-filter | 1 -
.github/actions/workflow-telemetry-action | 1 +
.github/workflows/e2e.yml | 32 ++-
.gitmodules | 7 +-
...ApplicationsFlink116OnYarnWithFlinkSQLTest.java | 14 +-
...ApplicationsFlink117OnYarnWithFlinkSQLTest.java | 14 +-
...ApplicationsFlink118OnYarnWithFlinkSQLTest.java | 20 +-
.../e2e/cases/ProjectsManagementTest.java | 133 ++++++++++++
.../{resource => }/VariableManagementTest.java | 2 +-
.../streampark/e2e/pages/common/Constants.java | 4 +-
.../pages/flink/applications/ApplicationForm.java | 2 +-
.../e2e/pages/resource/ProjectsPage.java | 236 +++++++++++++++++++++
.../e2e/pages/resource/ResourcePage.java | 10 +
.../resources/docker/basic/docker-compose.yaml | 4 +-
.../resources/docker/flink-1.16-on-yarn/Dockerfile | 15 ++
.../docker/flink-1.16-on-yarn/docker-compose.yaml | 11 +-
.../resources/docker/flink-1.17-on-yarn/Dockerfile | 15 ++
.../docker/flink-1.17-on-yarn/docker-compose.yaml | 11 +-
.../resources/docker/flink-1.18-on-yarn/Dockerfile | 15 ++
.../docker/flink-1.18-on-yarn/docker-compose.yaml | 11 +-
.../streampark/e2e/core/StreamParkExtension.java | 4 +-
21 files changed, 513 insertions(+), 49 deletions(-)
diff --git a/.github/actions/paths-filter b/.github/actions/paths-filter
deleted file mode 160000
index de90cc6fb..000000000
--- a/.github/actions/paths-filter
+++ /dev/null
@@ -1 +0,0 @@
-Subproject commit de90cc6fb38fc0963ad72b210f1f284cd68cea36
diff --git a/.github/actions/workflow-telemetry-action
b/.github/actions/workflow-telemetry-action
new file mode 160000
index 000000000..f974e0c59
--- /dev/null
+++ b/.github/actions/workflow-telemetry-action
@@ -0,0 +1 @@
+Subproject commit f974e0c5942f8f37973c4cc395704165fbe629ba
diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml
index 6a5d088ca..359026edd 100644
--- a/.github/workflows/e2e.yml
+++ b/.github/workflows/e2e.yml
@@ -77,6 +77,11 @@ jobs:
- uses: actions/checkout@v4
with:
submodules: true
+ - name: Set up JDK 8
+ uses: actions/setup-java@v4
+ with:
+ java-version: 8
+ distribution: 'adopt'
- name: Cache local Maven repository
uses: actions/cache@v4
with:
@@ -107,20 +112,22 @@ jobs:
case:
- name: MemberManagementTest
class: org.apache.streampark.e2e.cases.MemberManagementTest
+ - name: ProjectsManagementTest
+ class: org.apache.streampark.e2e.cases.ProjectsManagementTest
- name: VariableManagementTest
- class:
org.apache.streampark.e2e.pages.resource.VariableManagementTest
+ class: org.apache.streampark.e2e.cases.VariableManagementTest
- name: RoleManagementTest
class: org.apache.streampark.e2e.cases.RoleManagementTest
- name: UserManagementTest
class: org.apache.streampark.e2e.cases.UserManagementTest
- name: TeamManagementTest
class: org.apache.streampark.e2e.cases.TeamManagementTest
- - name: ApplicationsFlink116OnYarnTest
- class:
org.apache.streampark.e2e.cases.ApplicationsFlink116OnYarnTest
- - name: ApplicationsFlink117OnYarnTest
- class:
org.apache.streampark.e2e.cases.ApplicationsFlink117OnYarnTest
- - name: ApplicationsFlink118OnYarnTest
- class:
org.apache.streampark.e2e.cases.ApplicationsFlink118OnYarnTest
+ - name: ApplicationsFlink116OnYarnWithFlinkSQLTest
+ class:
org.apache.streampark.e2e.cases.ApplicationsFlink116OnYarnWithFlinkSQLTest
+ - name: ApplicationsFlink117OnYarnWithFlinkSQLTest
+ class:
org.apache.streampark.e2e.cases.ApplicationsFlink117OnYarnWithFlinkSQLTest
+ - name: ApplicationsFlink118OnYarnWithFlinkSQLTest
+ class:
org.apache.streampark.e2e.cases.ApplicationsFlink118OnYarnWithFlinkSQLTest
env:
RECORDING_PATH: /tmp/recording-${{ matrix.case.name }}
steps:
@@ -142,6 +149,10 @@ jobs:
with:
java-version: 11
distribution: 'adopt'
+ - name: Collect Workflow Telemetry
+ uses: ./.github/actions/workflow-telemetry-action
+ with:
+ comment_on_pr: false
- name: Cache local Maven repository
uses: actions/cache@v4
with:
@@ -169,6 +180,13 @@ jobs:
name: recording-${{ matrix.case.name }}
path: ${{ env.RECORDING_PATH }}
retention-days: 1
+ - uses: actions/upload-artifact@v4
+ if: always()
+ name: Upload Projects Build Logs
+ with:
+ name: ${{ matrix.case.name }}-projects-build-logs
+ path: ~/streampark_build_logs
+ retention-days: 1
result:
name: E2E - Result
runs-on: ubuntu-latest
diff --git a/.gitmodules b/.gitmodules
index c12608082..6b963ad9b 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -15,7 +15,6 @@
# specific language governing permissions and limitations
# under the License.
-[submodule ".github/actions/paths-filter"]
- path = .github/actions/paths-filter
- url = https://github.com/dorny/paths-filter
- branch = de90cc6fb38fc0963ad72b210f1f284cd68cea36
+[submodule ".github/actions/workflow-telemetry-action"]
+ path = .github/actions/workflow-telemetry-action
+ url = https://github.com/catchpoint/workflow-telemetry-action
diff --git
a/streampark-e2e/streampark-e2e-case/src/test/java/org/apache/streampark/e2e/cases/ApplicationsFlink116OnYarnWithFlinkSQLTest.java
b/streampark-e2e/streampark-e2e-case/src/test/java/org/apache/streampark/e2e/cases/ApplicationsFlink116OnYarnWithFlinkSQLTest.java
index e639972c8..2b0427016 100644
---
a/streampark-e2e/streampark-e2e-case/src/test/java/org/apache/streampark/e2e/cases/ApplicationsFlink116OnYarnWithFlinkSQLTest.java
+++
b/streampark-e2e/streampark-e2e-case/src/test/java/org/apache/streampark/e2e/cases/ApplicationsFlink116OnYarnWithFlinkSQLTest.java
@@ -106,8 +106,8 @@ public class ApplicationsFlink116OnYarnWithFlinkSQLTest {
.anyMatch(it -> it.contains("SUCCESS")));
}
- @Test
- @Order(30)
+ // @Test
+ // @Order(30)
void testStartFlinkApplicationOnYarnApplicationMode() {
final ApplicationsPage applicationsPage = new
ApplicationsPage(browser);
@@ -128,11 +128,11 @@ public class ApplicationsFlink116OnYarnWithFlinkSQLTest {
.anyMatch(it -> it.contains("FINISHED")));
}
- @Test
- @Order(31)
+ // @Test
+ // @Order(31)
@SneakyThrows
void testRestartAndCancelFlinkApplicationOnYarnApplicationMode() {
- Thread.sleep(Constants.DEFAULT_SLEEP_SECONDS);
+ Thread.sleep(Constants.DEFAULT_SLEEP_MILLISECONDS);
final ApplicationsPage applicationsPage = new
ApplicationsPage(browser);
applicationsPage.startApplication(applicationName);
@@ -210,8 +210,8 @@ public class ApplicationsFlink116OnYarnWithFlinkSQLTest {
.anyMatch(it -> it.contains("SUCCESS")));
}
- @Test
- @Order(70)
+ // @Test
+ // @Order(70)
void testStartFlinkApplicationOnYarnPerJobMode() {
final ApplicationsPage applicationsPage = new
ApplicationsPage(browser);
diff --git
a/streampark-e2e/streampark-e2e-case/src/test/java/org/apache/streampark/e2e/cases/ApplicationsFlink117OnYarnWithFlinkSQLTest.java
b/streampark-e2e/streampark-e2e-case/src/test/java/org/apache/streampark/e2e/cases/ApplicationsFlink117OnYarnWithFlinkSQLTest.java
index 6063d0ac5..9fb19880e 100644
---
a/streampark-e2e/streampark-e2e-case/src/test/java/org/apache/streampark/e2e/cases/ApplicationsFlink117OnYarnWithFlinkSQLTest.java
+++
b/streampark-e2e/streampark-e2e-case/src/test/java/org/apache/streampark/e2e/cases/ApplicationsFlink117OnYarnWithFlinkSQLTest.java
@@ -106,8 +106,8 @@ public class ApplicationsFlink117OnYarnWithFlinkSQLTest {
.anyMatch(it -> it.contains("SUCCESS")));
}
- @Test
- @Order(30)
+ // @Test
+ // @Order(30)
void testStartFlinkApplicationOnYarnApplicationMode() {
final ApplicationsPage applicationsPage = new
ApplicationsPage(browser);
@@ -128,11 +128,11 @@ public class ApplicationsFlink117OnYarnWithFlinkSQLTest {
.anyMatch(it -> it.contains("FINISHED")));
}
- @Test
- @Order(31)
+ // @Test
+ // @Order(31)
@SneakyThrows
void testRestartAndCancelFlinkApplicationOnYarnApplicationMode() {
- Thread.sleep(Constants.DEFAULT_SLEEP_SECONDS);
+ Thread.sleep(Constants.DEFAULT_SLEEP_MILLISECONDS);
final ApplicationsPage applicationsPage = new
ApplicationsPage(browser);
applicationsPage.startApplication(applicationName);
@@ -211,8 +211,8 @@ public class ApplicationsFlink117OnYarnWithFlinkSQLTest {
.anyMatch(it -> it.contains("SUCCESS")));
}
- @Test
- @Order(70)
+ // @Test
+ // @Order(70)
void testStartFlinkApplicationOnYarnPerJobMode() {
final ApplicationsPage applicationsPage = new
ApplicationsPage(browser);
diff --git
a/streampark-e2e/streampark-e2e-case/src/test/java/org/apache/streampark/e2e/cases/ApplicationsFlink118OnYarnWithFlinkSQLTest.java
b/streampark-e2e/streampark-e2e-case/src/test/java/org/apache/streampark/e2e/cases/ApplicationsFlink118OnYarnWithFlinkSQLTest.java
index 75e58af0e..c252fb089 100644
---
a/streampark-e2e/streampark-e2e-case/src/test/java/org/apache/streampark/e2e/cases/ApplicationsFlink118OnYarnWithFlinkSQLTest.java
+++
b/streampark-e2e/streampark-e2e-case/src/test/java/org/apache/streampark/e2e/cases/ApplicationsFlink118OnYarnWithFlinkSQLTest.java
@@ -106,8 +106,8 @@ public class ApplicationsFlink118OnYarnWithFlinkSQLTest {
.anyMatch(it -> it.contains("SUCCESS")));
}
- @Test
- @Order(30)
+ // @Test
+ // @Order(30)
void testStartFlinkApplicationOnYarnApplicationMode() {
final ApplicationsPage applicationsPage = new
ApplicationsPage(browser);
@@ -128,11 +128,11 @@ public class ApplicationsFlink118OnYarnWithFlinkSQLTest {
.anyMatch(it -> it.contains("FINISHED")));
}
- @Test
- @Order(31)
+ // @Test
+ // @Order(31)
@SneakyThrows
void testRestartAndCancelFlinkApplicationOnYarnApplicationMode() {
- Thread.sleep(Constants.DEFAULT_SLEEP_SECONDS);
+ Thread.sleep(Constants.DEFAULT_SLEEP_MILLISECONDS);
final ApplicationsPage applicationsPage = new
ApplicationsPage(browser);
applicationsPage.startApplication(applicationName);
@@ -211,8 +211,8 @@ public class ApplicationsFlink118OnYarnWithFlinkSQLTest {
.anyMatch(it -> it.contains("SUCCESS")));
}
- @Test
- @Order(70)
+ // @Test
+ // @Order(70)
void testStartFlinkApplicationOnYarnPerJobMode() {
final ApplicationsPage applicationsPage = new
ApplicationsPage(browser);
@@ -233,11 +233,11 @@ public class ApplicationsFlink118OnYarnWithFlinkSQLTest {
.anyMatch(it -> it.contains("FINISHED")));
}
- @Test
- @Order(71)
+ // @Test
+ // @Order(71)
@SneakyThrows
void testRestartAndCancelFlinkApplicationOnYarnPerJobMode() {
- Thread.sleep(Constants.DEFAULT_SLEEP_SECONDS);
+ Thread.sleep(Constants.DEFAULT_SLEEP_MILLISECONDS);
final ApplicationsPage applicationsPage = new
ApplicationsPage(browser);
applicationsPage.startApplication(applicationName);
diff --git
a/streampark-e2e/streampark-e2e-case/src/test/java/org/apache/streampark/e2e/cases/ProjectsManagementTest.java
b/streampark-e2e/streampark-e2e-case/src/test/java/org/apache/streampark/e2e/cases/ProjectsManagementTest.java
new file mode 100644
index 000000000..39ad65705
--- /dev/null
+++
b/streampark-e2e/streampark-e2e-case/src/test/java/org/apache/streampark/e2e/cases/ProjectsManagementTest.java
@@ -0,0 +1,133 @@
+/*
+ * 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.resource.ProjectsPage;
+import org.apache.streampark.e2e.pages.resource.ResourcePage;
+
+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 java.time.Duration;
+
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.testcontainers.shaded.org.awaitility.Awaitility.await;
+
+@StreamPark(composeFiles = "docker/basic/docker-compose.yaml")
+public class ProjectsManagementTest {
+
+ private static RemoteWebDriver browser;
+
+ private static final String userName = "admin";
+
+ private static final String password = "streampark";
+
+ private static final String teamName = "default";
+
+ private static final String projectName = "e2e_test_project";
+
+ private static final String editedProjectName = "e2e_test_project_edited";
+
+ private static final String cvs = "GitHub/GitLab";
+
+ private static final String url =
"https://github.com/apache/incubator-streampark-quickstart";
+
+ private static final String branch = "dev";
+
+ private static final String buildArgument =
+ "-pl quickstart-flink/quickstart-apacheflink/apacheflinksql_1.16 -am
-Dmaven.test.skip=true";
+
+ private static final String description = "e2e test project description";
+
+ @BeforeAll
+ public static void setup() {
+ ProjectsPage projectsPage = new LoginPage(browser)
+ .login(userName, password, teamName)
+ .goToNav(ResourcePage.class)
+ .goToTab(ProjectsPage.class);
+ }
+
+ @Test
+ @Order(10)
+ void testCreateProject() {
+ final ProjectsPage projectsPage = new ProjectsPage(browser);
+
+ projectsPage.createProject(projectName, cvs, url, branch,
buildArgument, description);
+
+ await()
+ .untilAsserted(
+ () -> assertThat(projectsPage.projectList())
+ .as("Projects list should contain newly-created project")
+ .extracting(WebElement::getText)
+ .anyMatch(it -> it.contains(projectName)));
+ }
+
+ @Test
+ @Order(20)
+ void testEditProject() {
+ final ProjectsPage projectsPage = new ProjectsPage(browser);
+
+ projectsPage.editProject(projectName, editedProjectName, cvs, url,
branch, buildArgument, description);
+
+ await()
+ .untilAsserted(
+ () -> assertThat(projectsPage.projectList())
+ .as("Projects list should contain edited project")
+ .extracting(WebElement::getText)
+ .anyMatch(it -> it.contains(editedProjectName)));
+ }
+
+ @Test
+ @Order(30)
+ void testBuildProject() {
+ final ProjectsPage projectsPage = new ProjectsPage(browser);
+
+ projectsPage.buildProject(editedProjectName);
+
+
await().timeout(Duration.ofMinutes(Constants.DEFAULT_PROJECT_BUILD_TIMEOUT_MINUTES))
+ .untilAsserted(
+ () -> assertThat(projectsPage.projectList())
+ .as("Projects list should contain build successful
project")
+ .extracting(WebElement::getText)
+ .anyMatch(it -> it.contains("SUCCESSFUL")));
+ }
+
+ @Test
+ @Order(40)
+ void testDeleteProject() {
+ final ProjectsPage projectsPage = new ProjectsPage(browser);
+
+ projectsPage.deleteProject(editedProjectName);
+
+ await()
+ .untilAsserted(
+ () -> {
+ browser.navigate().refresh();
+ Thread.sleep(Constants.DEFAULT_SLEEP_MILLISECONDS);
+
+ assertThat(projectsPage.projectList())
+ .noneMatch(it ->
it.getText().contains(editedProjectName));
+ });
+ }
+}
diff --git
a/streampark-e2e/streampark-e2e-case/src/test/java/org/apache/streampark/e2e/cases/resource/VariableManagementTest.java
b/streampark-e2e/streampark-e2e-case/src/test/java/org/apache/streampark/e2e/cases/VariableManagementTest.java
similarity index 98%
rename from
streampark-e2e/streampark-e2e-case/src/test/java/org/apache/streampark/e2e/cases/resource/VariableManagementTest.java
rename to
streampark-e2e/streampark-e2e-case/src/test/java/org/apache/streampark/e2e/cases/VariableManagementTest.java
index 1ce4121c1..c6e0ee787 100644
---
a/streampark-e2e/streampark-e2e-case/src/test/java/org/apache/streampark/e2e/cases/resource/VariableManagementTest.java
+++
b/streampark-e2e/streampark-e2e-case/src/test/java/org/apache/streampark/e2e/cases/VariableManagementTest.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.streampark.e2e.cases.resource;
+package org.apache.streampark.e2e.cases;
import org.apache.streampark.e2e.core.StreamPark;
import org.apache.streampark.e2e.pages.LoginPage;
diff --git
a/streampark-e2e/streampark-e2e-case/src/test/java/org/apache/streampark/e2e/pages/common/Constants.java
b/streampark-e2e/streampark-e2e-case/src/test/java/org/apache/streampark/e2e/pages/common/Constants.java
index 3acf115c6..bc9787ad7 100644
---
a/streampark-e2e/streampark-e2e-case/src/test/java/org/apache/streampark/e2e/pages/common/Constants.java
+++
b/streampark-e2e/streampark-e2e-case/src/test/java/org/apache/streampark/e2e/pages/common/Constants.java
@@ -22,5 +22,7 @@ import lombok.experimental.UtilityClass;
@UtilityClass
public class Constants {
- public static final Integer DEFAULT_SLEEP_SECONDS = 1000;
+ public static final Integer DEFAULT_SLEEP_MILLISECONDS = 2000;
+
+ public static final Integer DEFAULT_PROJECT_BUILD_TIMEOUT_MINUTES = 5;
}
diff --git
a/streampark-e2e/streampark-e2e-case/src/test/java/org/apache/streampark/e2e/pages/flink/applications/ApplicationForm.java
b/streampark-e2e/streampark-e2e-case/src/test/java/org/apache/streampark/e2e/pages/flink/applications/ApplicationForm.java
index 981c9bc40..953480982 100644
---
a/streampark-e2e/streampark-e2e-case/src/test/java/org/apache/streampark/e2e/pages/flink/applications/ApplicationForm.java
+++
b/streampark-e2e/streampark-e2e-case/src/test/java/org/apache/streampark/e2e/pages/flink/applications/ApplicationForm.java
@@ -78,7 +78,7 @@ public final class ApplicationForm {
String applicationName,
String flinkVersion,
ApplicationsDynamicParams
applicationsDynamicParams) {
- Thread.sleep(Constants.DEFAULT_SLEEP_SECONDS);
+ Thread.sleep(Constants.DEFAULT_SLEEP_MILLISECONDS);
new WebDriverWait(driver, Duration.ofSeconds(10))
.until(ExpectedConditions.elementToBeClickable(buttonDevelopmentModeDropdown));
buttonDevelopmentModeDropdown.click();
diff --git
a/streampark-e2e/streampark-e2e-case/src/test/java/org/apache/streampark/e2e/pages/resource/ProjectsPage.java
b/streampark-e2e/streampark-e2e-case/src/test/java/org/apache/streampark/e2e/pages/resource/ProjectsPage.java
new file mode 100644
index 000000000..236fe267e
--- /dev/null
+++
b/streampark-e2e/streampark-e2e-case/src/test/java/org/apache/streampark/e2e/pages/resource/ProjectsPage.java
@@ -0,0 +1,236 @@
+/*
+ * 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.resource;
+
+import org.apache.streampark.e2e.pages.common.Constants;
+import org.apache.streampark.e2e.pages.common.NavBarPage;
+
+import lombok.Getter;
+import lombok.SneakyThrows;
+import org.openqa.selenium.By;
+import org.openqa.selenium.Keys;
+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.WebDriverWait;
+
+import java.time.Duration;
+import java.util.List;
+
+@Getter
+public class ProjectsPage extends NavBarPage implements ResourcePage.Tab {
+
+ @FindBy(xpath = "//button[contains(@class,
'ant-btn-dashed')]/span[contains(text(), 'Add New')]")
+ private WebElement buttonCreateProject;
+
+ @FindBy(xpath = "//div[contains(@class, 'ant-list')]")
+ private List<WebElement> projectList;
+
+ @FindBy(xpath = "//button[contains(@class, 'ant-btn')]/span[contains(.,
'OK')]")
+ private WebElement popupConfirmButton;
+
+ private CreateProjectForm createProjectForm;
+
+ public ProjectsPage(RemoteWebDriver driver) {
+ super(driver);
+ createProjectForm = new CreateProjectForm();
+ }
+
+ @SneakyThrows
+ public ProjectsPage createProject(String projectName,
+ String projectCvs,
+ String projectUrl,
+ String projectBranch,
+ String projectBuildArgument,
+ String projectDescription) {
+ waitForPageLoading();
+ buttonCreateProject.click();
+ new WebDriverWait(driver, Duration.ofSeconds(10))
+ .until(ExpectedConditions.urlContains("/project/add"));
+
+ createProjectForm.inputProjectName().sendKeys(projectName);
+ createProjectForm.selectCveDropdown().click();
+ createProjectForm.selectCveText().stream()
+ .filter(e -> e.getText().equalsIgnoreCase(projectCvs))
+ .findFirst()
+ .orElseThrow(() -> new Exception(String.format("Cvs not found:
%s", projectCvs)))
+ .click();
+
+ createProjectForm.inputProjectUrl().sendKeys(projectUrl);
+ createProjectForm.selectBranchDropdown().click();
+ new WebDriverWait(driver, Duration.ofSeconds(10))
+
.until(ExpectedConditions.visibilityOfAllElements(createProjectForm.selectBranchText()));
+ createProjectForm.selectBranchText().stream()
+ .filter(e -> e.getText().equalsIgnoreCase(projectBranch))
+ .findFirst()
+ .orElseThrow(() -> new Exception(String.format("Branch not found:
%s", projectBranch)))
+ .click();
+
+ createProjectForm.inputBuildArgument().sendKeys(projectBuildArgument);
+ createProjectForm.inputDescription().sendKeys(projectDescription);
+ createProjectForm.buttonSubmit().click();
+
+ return this;
+ }
+
+ @SneakyThrows
+ public ProjectsPage editProject(String oldProjectName,
+ String newProjectName,
+ String projectCvs,
+ String projectUrl,
+ String projectBranch,
+ String projectBuildArgument,
+ String projectDescription) {
+ waitForPageLoading();
+ projectList().stream()
+ .filter(project -> project.getText().contains(oldProjectName))
+ .findFirst()
+ .orElseThrow(() -> new Exception("Project edit button not found"))
+ .findElement(
+ By.xpath("//..//li[contains(@class,
'ant-list-item')]//button[contains(@class, 'ant-btn')][3]"))
+ .click();
+ new WebDriverWait(driver, Duration.ofSeconds(10))
+ .until(ExpectedConditions.urlContains("/project/edit"));
+
+ createProjectForm.inputProjectName().sendKeys(Keys.CONTROL + "a");
+ createProjectForm.inputProjectName().sendKeys(Keys.BACK_SPACE);
+ createProjectForm.inputProjectName().sendKeys(newProjectName);
+ createProjectForm.selectCveDropdown().click();
+ new WebDriverWait(driver, Duration.ofSeconds(10))
+
.until(ExpectedConditions.visibilityOfAllElements(createProjectForm.selectCveText()));
+ createProjectForm.selectCveText().stream()
+ .filter(e -> e.getText().equalsIgnoreCase(projectCvs))
+ .findFirst()
+ .orElseThrow(() -> new Exception(String.format("Cvs not found:
%s", projectCvs)))
+ .click();
+
+ createProjectForm.inputProjectUrl().sendKeys(Keys.CONTROL + "a");
+ createProjectForm.inputProjectUrl().sendKeys(Keys.BACK_SPACE);
+ createProjectForm.inputProjectUrl().sendKeys(projectUrl);
+ createProjectForm.selectBranchDropdown().click();
+ new WebDriverWait(driver, Duration.ofSeconds(10))
+
.until(ExpectedConditions.visibilityOfAllElements(createProjectForm.selectBranchText()));
+ createProjectForm.selectBranchText().stream()
+ .filter(e -> e.getText().equalsIgnoreCase(projectBranch))
+ .findFirst()
+ .orElseThrow(() -> new Exception(String.format("Branch not found:
%s", projectBranch)))
+ .click();
+
+ createProjectForm.inputBuildArgument().sendKeys(Keys.CONTROL + "a");
+ createProjectForm.inputBuildArgument().sendKeys(Keys.BACK_SPACE);
+ createProjectForm.inputBuildArgument().sendKeys(projectBuildArgument);
+ createProjectForm.inputDescription().sendKeys(Keys.CONTROL + "a");
+ createProjectForm.inputDescription().sendKeys(Keys.BACK_SPACE);
+ createProjectForm.inputDescription().sendKeys(projectDescription);
+ createProjectForm.buttonSubmit().click();
+
+ return this;
+ }
+
+ @SneakyThrows
+ public ProjectsPage buildProject(String projectName) {
+ waitForPageLoading();
+ projectList().stream()
+ .filter(project -> project.getText().contains(projectName))
+ .findFirst()
+ .orElseThrow(() -> new Exception("Project build button not found"))
+ .findElement(
+ By.xpath("//..//li[contains(@class,
'ant-list-item')]//button[contains(@class, 'ant-btn')][2]"))
+ .click();
+ popupConfirmButton.click();
+ return this;
+ }
+
+ @SneakyThrows
+ public ProjectsPage deleteProject(String projectName) {
+ waitForPageLoading();
+ projectList().stream()
+ .filter(project -> project.getText().contains(projectName))
+ .findFirst()
+ .orElseThrow(() -> new Exception("Project delete button not
found"))
+ .findElement(
+ By.xpath("//..//li[contains(@class,
'ant-list-item')]//button[contains(@class, 'ant-btn')][4]"))
+ .click();
+ popupConfirmButton.click();
+ String deletePopUpMessage = "delete successful";
+ new WebDriverWait(driver, Duration.ofSeconds(10))
+ .until(
+ ExpectedConditions.visibilityOfElementLocated(
+ By.xpath(String.format("//*[contains(text(),'%s')]",
+ deletePopUpMessage))));
+ new WebDriverWait(driver, Duration.ofSeconds(10))
+ .until(
+ ExpectedConditions.invisibilityOfElementLocated(
+ By.xpath(String.format("//*[contains(text(),'%s')]",
+ deletePopUpMessage))));
+ Thread.sleep(Constants.DEFAULT_SLEEP_MILLISECONDS);
+ return this;
+ }
+
+ private void waitForPageLoading() {
+ new WebDriverWait(driver, Duration.ofSeconds(10))
+ .until(ExpectedConditions.urlContains("/resource/project"));
+ }
+
+ @Getter
+ private class CreateProjectForm {
+
+ CreateProjectForm() {
+ PageFactory.initElements(driver, this);
+ }
+
+ @FindBy(id = "form_item_name")
+ private WebElement inputProjectName;
+
+ @FindBy(xpath = "//div[contains(@codefield,
'repository')]//div[contains(@class, 'ant-select-selector')]")
+ private WebElement selectCveDropdown;
+
+ @FindBys({
+ @FindBy(css = "[codefield=repository]"),
+ @FindBy(className = "ant-select-item-option-content")
+ })
+ private List<WebElement> selectCveText;
+
+ @FindBy(name = "url")
+ private WebElement inputProjectUrl;
+
+ @FindBy(xpath = "//div[contains(@codefield,
'branches')]//div[contains(@class, 'ant-select-selector')]")
+ private WebElement selectBranchDropdown;
+
+ @FindBys({
+ @FindBy(css = "[codefield=branches]"),
+ @FindBy(className = "ant-select-item-option-content")
+ })
+ private List<WebElement> selectBranchText;
+
+ @FindBy(id = "form_item_buildArgs")
+ private WebElement inputBuildArgument;
+
+ @FindBy(id = "form_item_description")
+ private WebElement inputDescription;
+
+ @FindBy(xpath = "//button[contains(@class,
'ant-btn')]//span[contains(text(), 'Submit')]")
+ private WebElement buttonSubmit;
+
+ @FindBy(xpath = "//button[contains(@class,
'ant-btn')]//span[contains(text(), 'Cancel')]")
+ private WebElement buttonCancel;
+ }
+}
diff --git
a/streampark-e2e/streampark-e2e-case/src/test/java/org/apache/streampark/e2e/pages/resource/ResourcePage.java
b/streampark-e2e/streampark-e2e-case/src/test/java/org/apache/streampark/e2e/pages/resource/ResourcePage.java
index 8fa429aac..ac0f784da 100644
---
a/streampark-e2e/streampark-e2e-case/src/test/java/org/apache/streampark/e2e/pages/resource/ResourcePage.java
+++
b/streampark-e2e/streampark-e2e-case/src/test/java/org/apache/streampark/e2e/pages/resource/ResourcePage.java
@@ -35,6 +35,9 @@ public final class ResourcePage extends NavBarPage implements
NavBarItem {
@FindBy(xpath = "//span[contains(@class,
'streampark-simple-menu-sub-title') and contains(text(), 'Variables')]//..")
private WebElement resourceVariableManagement;
+ @FindBy(xpath = "//span[contains(@class,
'streampark-simple-menu-sub-title') and contains(text(), 'Projects')]//..")
+ private WebElement resourceProjectsManagement;
+
public ResourcePage(RemoteWebDriver driver) {
super(driver);
}
@@ -47,6 +50,13 @@ public final class ResourcePage extends NavBarPage
implements NavBarItem {
return tab.cast(new VariableManagementPage(driver));
}
+ if (tab == ProjectsPage.class) {
+ new WebDriverWait(driver, Duration.ofSeconds(10))
+
.until(ExpectedConditions.elementToBeClickable(resourceProjectsManagement));
+ resourceProjectsManagement.click();
+ return tab.cast(new ProjectsPage(driver));
+ }
+
throw new UnsupportedOperationException("Unknown tab: " +
tab.getName());
}
diff --git
a/streampark-e2e/streampark-e2e-case/src/test/resources/docker/basic/docker-compose.yaml
b/streampark-e2e/streampark-e2e-case/src/test/resources/docker/basic/docker-compose.yaml
index 536cdc469..30b77fe55 100644
---
a/streampark-e2e/streampark-e2e-case/src/test/resources/docker/basic/docker-compose.yaml
+++
b/streampark-e2e/streampark-e2e-case/src/test/resources/docker/basic/docker-compose.yaml
@@ -15,8 +15,6 @@
# limitations under the License.
#
-version: "3.8"
-
services:
streampark:
image: apache/streampark:ci-basic
@@ -34,6 +32,8 @@ services:
restart: unless-stopped
networks:
- e2e
+ volumes:
+ - ${HOME}/streampark_build_logs:/tmp/streampark/logs/build_logs/
healthcheck:
test: [ "CMD", "curl", "http://localhost:10000" ]
interval: 5s
diff --git
a/streampark-e2e/streampark-e2e-case/src/test/resources/docker/flink-1.16-on-yarn/Dockerfile
b/streampark-e2e/streampark-e2e-case/src/test/resources/docker/flink-1.16-on-yarn/Dockerfile
index 0afc19a73..1f65cde46 100644
---
a/streampark-e2e/streampark-e2e-case/src/test/resources/docker/flink-1.16-on-yarn/Dockerfile
+++
b/streampark-e2e/streampark-e2e-case/src/test/resources/docker/flink-1.16-on-yarn/Dockerfile
@@ -30,3 +30,18 @@ RUN sudo wget --no-check-certificate -O
/flink-${FLINK_VERSION}-bin-scala_2.12.t
&& cd / \
&& sudo tar -zxf flink-${FLINK_VERSION}-bin-scala_2.12.tgz \
&& sudo chown -R hadoop.hadoop /flink-${FLINK_VERSION}
+
+# Install javac
+ARG TARGETPLATFORM
+RUN echo "TARGETPLATFORM: $TARGETPLATFORM"
+RUN \
+ if [ "$TARGETPLATFORM" = "linux/arm64" ];then \
+ sudo rm -f /etc/yum.repos.d/*.repo; \
+ sudo wget http://mirrors.aliyun.com/repo/Centos-altarch-7.repo -O
/etc/yum.repos.d/CentOS-Base.repo; \
+ sudo yum install -y java-1.8.0-openjdk-devel; \
+ elif [ "$TARGETPLATFORM" = "linux/amd64" ];then \
+ sudo yum install -y java-1.8.0-openjdk-devel; \
+ else \
+ echo "unknown TARGETPLATFORM: $TARGETPLATFORM"; \
+ exit 2; \
+ fi
diff --git
a/streampark-e2e/streampark-e2e-case/src/test/resources/docker/flink-1.16-on-yarn/docker-compose.yaml
b/streampark-e2e/streampark-e2e-case/src/test/resources/docker/flink-1.16-on-yarn/docker-compose.yaml
index 6ea5912e7..0412171f4 100644
---
a/streampark-e2e/streampark-e2e-case/src/test/resources/docker/flink-1.16-on-yarn/docker-compose.yaml
+++
b/streampark-e2e/streampark-e2e-case/src/test/resources/docker/flink-1.16-on-yarn/docker-compose.yaml
@@ -13,8 +13,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-version: "3"
-
services:
namenode:
image: apache/streampark-flink-1.16.3-on-yarn:ci
@@ -146,6 +144,15 @@ services:
tty: true
stdin_open: true
restart: always
+ depends_on:
+ namenode:
+ condition: service_healthy
+ datanode:
+ condition: service_healthy
+ resourcemanager:
+ condition: service_healthy
+ nodemanager:
+ condition: service_healthy
healthcheck:
test: [ "CMD", "curl", "http://streampark:10000" ]
interval: 5s
diff --git
a/streampark-e2e/streampark-e2e-case/src/test/resources/docker/flink-1.17-on-yarn/Dockerfile
b/streampark-e2e/streampark-e2e-case/src/test/resources/docker/flink-1.17-on-yarn/Dockerfile
index 6ed96f988..34d4bfaef 100644
---
a/streampark-e2e/streampark-e2e-case/src/test/resources/docker/flink-1.17-on-yarn/Dockerfile
+++
b/streampark-e2e/streampark-e2e-case/src/test/resources/docker/flink-1.17-on-yarn/Dockerfile
@@ -30,3 +30,18 @@ RUN sudo wget --no-check-certificate -O
/flink-${FLINK_VERSION}-bin-scala_2.12.t
&& cd / \
&& sudo tar -zxf flink-${FLINK_VERSION}-bin-scala_2.12.tgz \
&& sudo chown -R hadoop.hadoop /flink-${FLINK_VERSION}
+
+# Install javac
+ARG TARGETPLATFORM
+RUN echo "TARGETPLATFORM: $TARGETPLATFORM"
+RUN \
+ if [ "$TARGETPLATFORM" = "linux/arm64" ];then \
+ sudo rm -f /etc/yum.repos.d/*.repo; \
+ sudo wget http://mirrors.aliyun.com/repo/Centos-altarch-7.repo -O
/etc/yum.repos.d/CentOS-Base.repo; \
+ sudo yum install -y java-1.8.0-openjdk-devel; \
+ elif [ "$TARGETPLATFORM" = "linux/amd64" ];then \
+ sudo yum install -y java-1.8.0-openjdk-devel; \
+ else \
+ echo "unknown TARGETPLATFORM: $TARGETPLATFORM"; \
+ exit 2; \
+ fi
diff --git
a/streampark-e2e/streampark-e2e-case/src/test/resources/docker/flink-1.17-on-yarn/docker-compose.yaml
b/streampark-e2e/streampark-e2e-case/src/test/resources/docker/flink-1.17-on-yarn/docker-compose.yaml
index 74d0b85e8..3f4a68b71 100644
---
a/streampark-e2e/streampark-e2e-case/src/test/resources/docker/flink-1.17-on-yarn/docker-compose.yaml
+++
b/streampark-e2e/streampark-e2e-case/src/test/resources/docker/flink-1.17-on-yarn/docker-compose.yaml
@@ -13,8 +13,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-version: "3"
-
services:
namenode:
image: apache/streampark-flink-1.17.2-on-yarn:ci
@@ -146,6 +144,15 @@ services:
tty: true
stdin_open: true
restart: always
+ depends_on:
+ namenode:
+ condition: service_healthy
+ datanode:
+ condition: service_healthy
+ resourcemanager:
+ condition: service_healthy
+ nodemanager:
+ condition: service_healthy
healthcheck:
test: [ "CMD", "curl", "http://streampark:10000" ]
interval: 5s
diff --git
a/streampark-e2e/streampark-e2e-case/src/test/resources/docker/flink-1.18-on-yarn/Dockerfile
b/streampark-e2e/streampark-e2e-case/src/test/resources/docker/flink-1.18-on-yarn/Dockerfile
index 530f8bfc4..5f0773e22 100644
---
a/streampark-e2e/streampark-e2e-case/src/test/resources/docker/flink-1.18-on-yarn/Dockerfile
+++
b/streampark-e2e/streampark-e2e-case/src/test/resources/docker/flink-1.18-on-yarn/Dockerfile
@@ -30,3 +30,18 @@ RUN sudo wget --no-check-certificate -O
/flink-${FLINK_VERSION}-bin-scala_2.12.t
&& cd / \
&& sudo tar -zxf flink-${FLINK_VERSION}-bin-scala_2.12.tgz \
&& sudo chown -R hadoop.hadoop /flink-${FLINK_VERSION}
+
+# Install javac
+ARG TARGETPLATFORM
+RUN echo "TARGETPLATFORM: $TARGETPLATFORM"
+RUN \
+ if [ "$TARGETPLATFORM" = "linux/arm64" ];then \
+ sudo rm -f /etc/yum.repos.d/*.repo; \
+ sudo wget http://mirrors.aliyun.com/repo/Centos-altarch-7.repo -O
/etc/yum.repos.d/CentOS-Base.repo; \
+ sudo yum install -y java-1.8.0-openjdk-devel; \
+ elif [ "$TARGETPLATFORM" = "linux/amd64" ];then \
+ sudo yum install -y java-1.8.0-openjdk-devel; \
+ else \
+ echo "unknown TARGETPLATFORM: $TARGETPLATFORM"; \
+ exit 2; \
+ fi
diff --git
a/streampark-e2e/streampark-e2e-case/src/test/resources/docker/flink-1.18-on-yarn/docker-compose.yaml
b/streampark-e2e/streampark-e2e-case/src/test/resources/docker/flink-1.18-on-yarn/docker-compose.yaml
index ad92f84c0..a867ac172 100644
---
a/streampark-e2e/streampark-e2e-case/src/test/resources/docker/flink-1.18-on-yarn/docker-compose.yaml
+++
b/streampark-e2e/streampark-e2e-case/src/test/resources/docker/flink-1.18-on-yarn/docker-compose.yaml
@@ -13,8 +13,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-version: "3"
-
services:
namenode:
image: apache/streampark-flink-1.18.1-on-yarn:ci
@@ -146,6 +144,15 @@ services:
tty: true
stdin_open: true
restart: always
+ depends_on:
+ namenode:
+ condition: service_healthy
+ datanode:
+ condition: service_healthy
+ resourcemanager:
+ condition: service_healthy
+ nodemanager:
+ condition: service_healthy
healthcheck:
test: [ "CMD", "curl", "http://streampark:10000" ]
interval: 5s
diff --git
a/streampark-e2e/streampark-e2e-core/src/main/java/org/apache/streampark/e2e/core/StreamParkExtension.java
b/streampark-e2e/streampark-e2e-core/src/main/java/org/apache/streampark/e2e/core/StreamParkExtension.java
index 610c6d416..8b5d51d67 100644
---
a/streampark-e2e/streampark-e2e-core/src/main/java/org/apache/streampark/e2e/core/StreamParkExtension.java
+++
b/streampark-e2e/streampark-e2e-core/src/main/java/org/apache/streampark/e2e/core/StreamParkExtension.java
@@ -100,8 +100,8 @@ final class StreamParkExtension implements
BeforeAllCallback, AfterAllCallback,
driver
.manage()
.timeouts()
- .implicitlyWait(Duration.ofSeconds(10))
- .pageLoadTimeout(Duration.ofSeconds(10));
+ .implicitlyWait(Duration.ofSeconds(2))
+ .pageLoadTimeout(Duration.ofSeconds(5));
driver.manage().window().maximize();
driver.get(new URL("http", address.getHost(), address.getPort(),
rootPath).toString());