ruanwenjun commented on code in PR #16715:
URL: 
https://github.com/apache/dolphinscheduler/pull/16715#discussion_r1810604851


##########
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/TaskExecutionContextFactory.java:
##########
@@ -108,8 +112,10 @@ public TaskExecutionContext 
createTaskExecutionContext(TaskExecutionContextCreat
 
         AbstractParameters baseParam =
                 
TaskPluginManager.parseTaskParameters(taskInstance.getTaskType(), 
taskInstance.getTaskParams());
+
         Map<String, Property> propertyMap =
-                curingParamsService.paramParsingPreparation(taskInstance, 
baseParam, workflowInstance);
+                curingParamsService.paramParsingPreparation(taskInstance, 
baseParam, workflowInstance,
+                        project.getName(), workflowDefinition.getName());

Review Comment:
   Directly transport project and workflowDefinition is better, then we can 
avoid to change this method in the future once we want to inject new parameter.



##########
dolphinscheduler-master/src/test/java/org/apache/dolphinscheduler/server/master/integration/cases/WorkflowStartTestCase.java:
##########
@@ -709,4 +709,30 @@ public void 
testStartWorkflowFromStartNodes_with_threeParallelSuccessTask() {
 
         assertThat(workflowRepository.getAll()).isEmpty();
     }
+
+    @Test
+    @DisplayName("Test start a workflow with one fake task success")
+    public void testStartWorkflow_with_oneSuccessFakeTask() {
+        final String yaml = 
"/it/start/workflow_with_one_fake_task_success.yaml";
+        final WorkflowTestCaseContext context = 
workflowTestCaseContextFactory.initializeContextFromYaml(yaml);
+
+        final WorkflowOperator.WorkflowTriggerDTO workflowTriggerDTO = 
WorkflowOperator.WorkflowTriggerDTO.builder()
+                .workflowDefinition(context.getWorkflows().get(0))
+                .project(context.getProject())
+                .runWorkflowCommandParam(new RunWorkflowCommandParam())
+                .build();
+        workflowOperator.manualTriggerWorkflow(workflowTriggerDTO);
+
+        await()
+                .atMost(Duration.ofMinutes(1))
+                .untilAsserted(() -> {
+                    Assertions
+                            
.assertThat(workflowTriggerDTO.getProject().getName())
+                            .isEqualTo("MasterIntegrationTest");
+                    Assertions
+                            
.assertThat(workflowTriggerDTO.getWorkflowDefinition().getName())
+                            .isEqualTo("workflow_with_one_fake_task_success");
+                });

Review Comment:
   You need to add a new yaml and do assertion at the content of LogicFakeTask, 
the current assertion is meanless.



-- 
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