Skip to content

Commit

Permalink
sync from main (#125)
Browse files Browse the repository at this point in the history
* sync from main
  • Loading branch information
v1r3n authored Nov 12, 2023
1 parent 4d69012 commit d1508c5
Show file tree
Hide file tree
Showing 28 changed files with 3,865 additions and 248 deletions.
3 changes: 2 additions & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
### [Workflow Management](executor.md)
### [Task Worker](worker.md)
### [Workflow Authoring](workflow.md)
### [Settings](settings.md)
### [Settings](settings.md)
### [Conductor Client](client.md)
1,840 changes: 1,840 additions & 0 deletions docs/client.md

Large diffs are not rendered by default.

15 changes: 14 additions & 1 deletion internal/testdata/kitchensink.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,18 @@ func NewKitchenSinkWorkflow(executor *executor.WorkflowExecutor) *workflow.Condu
workflow.NewSimpleTask("simple_task", "simple_task_5"),
},
)
join := workflow.NewJoinTask("new_join_ref", "simple_task_fork_ref2", "simple_task_fork_ref4")
join.InputMap(map[string]interface{}{
"param1": "value",
})
forkWithJoin := workflow.NewForkTaskWithJoin("fork_with_join_fork_ref", join,
[]workflow.TaskInterface{
workflow.NewSimpleTask("simple_task", "simple_task_fork_ref1"),
workflow.NewSimpleTask("simple_task", "simple_task_fork_ref2"),
}, []workflow.TaskInterface{
workflow.NewSimpleTask("simple_task", "simple_task_fork_ref3"),
workflow.NewSimpleTask("simple_task", "simple_task_fork_ref4"),
})
dynamicFork := workflow.NewDynamicForkTask(
"dynamic_fork",
workflow.NewSimpleTask("dynamic_fork_prep", "dynamic_fork_prep"),
Expand Down Expand Up @@ -90,7 +102,8 @@ func NewKitchenSinkWorkflow(executor *executor.WorkflowExecutor) *workflow.Condu
Add(setVariable).
Add(subWorkflow).
Add(dynamicFork).
Add(fork)
Add(fork).
Add(forkWithJoin)

return workflow
}
Expand Down
18 changes: 17 additions & 1 deletion internal/testdata/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ var (
EventClient = client.EventResourceApiService{
APIClient: apiClient,
}
TagsClient = client.TagsApiService{
APIClient: apiClient,
}
)

var TaskRunner = worker.NewTaskRunnerWithApiClient(apiClient)
Expand All @@ -59,7 +62,7 @@ var WorkflowExecutor = executor.NewWorkflowExecutor(apiClient)
func init() {
log.SetFormatter(&log.JSONFormatter{})
log.SetOutput(os.Stdout)
log.SetLevel(log.DebugLevel)
log.SetLevel(log.ErrorLevel)
}

func ValidateWorkflowDaemon(waitTime time.Duration, outputChannel chan error, workflowId string, expectedOutput map[string]interface{}, expectedStatus model.WorkflowStatus) {
Expand Down Expand Up @@ -224,6 +227,19 @@ func ValidateWorkflowRegistration(workflow *workflow.ConductorWorkflow) error {
return fmt.Errorf("exhausted retries")
}

func ValidateWorkflowDeletion(workflow *workflow.ConductorWorkflow) error {
for attempt := 0; attempt < 5; attempt += 1 {
err := workflow.UnRegister()
if err != nil {
time.Sleep(time.Duration(attempt+2) * time.Second)
fmt.Println("Failed to validate workflow deletion, reason: " + err.Error())
continue
}
return nil
}
return fmt.Errorf("exhausted retries")
}

func isWorkflowCompleted(workflow *model.Workflow, expectedStatus model.WorkflowStatus) bool {
return workflow.Status == expectedStatus
}
Loading

0 comments on commit d1508c5

Please sign in to comment.