Skip to content

Commit

Permalink
change SslPythonTaskE2ETest
Browse files Browse the repository at this point in the history
  • Loading branch information
xdu-chenrj committed Oct 17, 2024
1 parent be8df43 commit a4ed1d0
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 13 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,8 @@ jobs:
class: org.apache.dolphinscheduler.e2e.cases.SqlServerDataSourceE2ETest
- name: HiveDataSourceE2ETest
class: org.apache.dolphinscheduler.e2e.cases.HiveDataSourceE2ETest
- name: SslShellTaskE2ETest
class: org.apache.dolphinscheduler.e2e.cases.ssl.SslShellTaskE2ETest
- name: SslPythonTaskE2ETest
class: org.apache.dolphinscheduler.e2e.cases.ssl.SslPythonTaskE2ETest
env:
RECORDING_PATH: /tmp/recording-${{ matrix.case.name }}
steps:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,27 +22,29 @@
import org.apache.dolphinscheduler.e2e.cases.workflow.BaseWorkflowE2ETest;
import org.apache.dolphinscheduler.e2e.core.DolphinScheduler;
import org.apache.dolphinscheduler.e2e.core.WebDriverHolder;
import org.apache.dolphinscheduler.e2e.models.environment.PythonEnvironment;
import org.apache.dolphinscheduler.e2e.pages.LoginPage;
import org.apache.dolphinscheduler.e2e.pages.project.ProjectPage;
import org.apache.dolphinscheduler.e2e.pages.project.workflow.TaskInstanceTab;
import org.apache.dolphinscheduler.e2e.pages.project.workflow.WorkflowDefinitionTab;
import org.apache.dolphinscheduler.e2e.pages.project.workflow.WorkflowForm;
import org.apache.dolphinscheduler.e2e.pages.project.workflow.WorkflowInstanceTab;
import org.apache.dolphinscheduler.e2e.pages.project.workflow.task.ShellTaskForm;
import org.apache.dolphinscheduler.e2e.pages.project.workflow.task.PythonTaskForm;
import org.apache.dolphinscheduler.e2e.pages.security.EnvironmentPage;
import org.apache.dolphinscheduler.e2e.pages.security.SecurityPage;
import org.apache.dolphinscheduler.e2e.pages.security.TenantPage;
import org.apache.dolphinscheduler.e2e.pages.security.UserPage;

import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.MethodOrderer;
import org.junit.jupiter.api.Order;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestMethodOrder;
import org.junitpioneer.jupiter.DisableIfTestFails;

@TestMethodOrder(MethodOrderer.MethodName.class)
@DolphinScheduler(composeFiles = "docker/ssl-test/docker-compose.yml")
@DolphinScheduler(composeFiles = "docker/ssl-task/docker-compose.yml")
@DisableIfTestFails
public class SslShellTaskE2ETest extends BaseWorkflowE2ETest {
public class SslPythonTaskE2ETest extends BaseWorkflowE2ETest {

private static final PythonEnvironment pythonEnvironment = new PythonEnvironment();

@BeforeAll
public static void setup() {
Expand All @@ -60,27 +62,36 @@ public static void setup() {
.goToTab(UserPage.class)
.update(adminUser);
}
tenantPage
.goToNav(SecurityPage.class)
.goToTab(EnvironmentPage.class)
.createEnvironmentUntilSuccess(pythonEnvironment.getEnvironmentName(),
pythonEnvironment.getEnvironmentConfig(),
pythonEnvironment.getEnvironmentDesc(),
pythonEnvironment.getEnvironmentWorkerGroup());

tenantPage
.goToNav(ProjectPage.class)
.createProjectUntilSuccess(projectName);
}

@Test
void testRunShellTasks_SuccessCase() {
@Order(10)
void testRunPythonTasks_SuccessCase() {
WorkflowDefinitionTab workflowDefinitionPage =
new ProjectPage(browser)
.goToNav(ProjectPage.class)
.goTo(projectName)
.goToTab(WorkflowDefinitionTab.class);

// todo: use yaml to define the workflow
String workflowName = "SslSuccessCase";
String taskName = "SslShellSuccess";
String workflowName = "SslPythonSuccessCase";
String taskName = "SslPythonSuccessTask";
String pythonScripts = "print(\"success\")";
workflowDefinitionPage
.createWorkflow()
.<ShellTaskForm>addTask(WorkflowForm.TaskType.SHELL)
.script("echo hello world\n")
.<PythonTaskForm>addTask(WorkflowForm.TaskType.PYTHON)
.script(pythonScripts)
.name(taskName)
.submit()

Expand Down

0 comments on commit a4ed1d0

Please sign in to comment.