shouwangyw commented on code in PR #16616:
URL:
https://github.com/apache/dolphinscheduler/pull/16616#discussion_r1795389306
##########
dolphinscheduler-master/src/test/java/org/apache/dolphinscheduler/server/master/integration/cases/WorkflowStartTestCase.java:
##########
@@ -121,7 +159,65 @@ public void
testStartWorkflow_with_subWorkflowTask_success() {
.matches(
workflowInstance ->
workflowInstance.getState() == WorkflowExecutionStatus.SUCCESS)
.matches(
- workflowInstance ->
workflowInstance.getIsSubWorkflow() == Flag.NO);
+ workflowInstance ->
workflowInstance.getIsSubWorkflow() == Flag.NO)
+ .matches(
+ workflowInstance ->
workflowInstance.getDryRun() == Flag.NO.getCode());
+
+ final List<WorkflowInstance> subWorkflowInstance =
+
repository.queryWorkflowInstance(context.getWorkflows().get(1));
+ Assertions
+ .assertThat(subWorkflowInstance)
+ .hasSize(1)
+ .satisfiesExactly(workflowInstance -> {
+
assertThat(workflowInstance.getState()).isEqualTo(WorkflowExecutionStatus.SUCCESS);
+
assertThat(workflowInstance.getIsSubWorkflow()).isEqualTo(Flag.YES);
+
assertThat(workflowInstance.getDryRun()).isEqualTo(Flag.NO.getCode());
+ });
+
+ Assertions
+
.assertThat(repository.queryTaskInstance(workflowInstanceId))
+ .satisfiesExactly(taskInstance -> {
+
assertThat(taskInstance.getName()).isEqualTo("sub_logic_task");
+
assertThat(taskInstance.getState()).isEqualTo(TaskExecutionStatus.SUCCESS);
+ });
+
+ Assertions
+
.assertThat(repository.queryTaskInstance(subWorkflowInstance.get(0).getId()))
+ .satisfiesExactly(taskInstance -> {
+
assertThat(taskInstance.getName()).isEqualTo("fake_task");
+
assertThat(taskInstance.getState()).isEqualTo(TaskExecutionStatus.SUCCESS);
+ });
+ });
+
+ assertThat(workflowRepository.getAll()).isEmpty();
+ }
+
+ @Test
+ @DisplayName("Test start a workflow with one sub workflow task(A) dry run
success")
+ public void testStartWorkflow_with_subWorkflowTask_dryRunSuccess() {
Review Comment:
> This might make confusion, since physical task dry run will not go into
the task plugin logic, you can find the implementation in `WorkerTaskExecutor`.
It's better to keep this consistent.
>
> You should do this change in `MasterTaskExecutor`, otherwise the other
logic task still doesn't support dry run.
Check whether it is dry run in AsyncMasterTaskDelayQueueLooper, it may also
be necessary!
--
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]