fix(ci): correct workflow unit test (#780)
This commit is contained in:
parent
ee03b41ad5
commit
a9b87c188b
File diff suppressed because it is too large
Load Diff
|
|
@ -292,7 +292,7 @@ func (w *ApplicationService) DeleteWorkflow(ctx context.Context, req *workflow.D
|
||||||
}
|
}
|
||||||
|
|
||||||
func (w *ApplicationService) deleteWorkflowResource(ctx context.Context, policy *vo.DeletePolicy) error {
|
func (w *ApplicationService) deleteWorkflowResource(ctx context.Context, policy *vo.DeletePolicy) error {
|
||||||
ids, err := w.DomainSVC.Delete(ctx, policy)
|
ids, err := GetWorkflowDomainSVC().Delete(ctx, policy)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
@ -991,7 +991,7 @@ func (w *ApplicationService) CopyWorkflowFromAppToLibrary(ctx context.Context, w
|
||||||
}
|
}
|
||||||
|
|
||||||
func (w *ApplicationService) copyWorkflowFromAppToLibrary(ctx context.Context, workflowID int64, appID int64, related vo.ExternalResourceRelated) (map[int64]entity.IDVersionPair, []*vo.ValidateIssue, error) {
|
func (w *ApplicationService) copyWorkflowFromAppToLibrary(ctx context.Context, workflowID int64, appID int64, related vo.ExternalResourceRelated) (map[int64]entity.IDVersionPair, []*vo.ValidateIssue, error) {
|
||||||
resp, err := w.DomainSVC.CopyWorkflowFromAppToLibrary(ctx, workflowID, appID, related)
|
resp, err := GetWorkflowDomainSVC().CopyWorkflowFromAppToLibrary(ctx, workflowID, appID, related)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, nil, err
|
return nil, nil, err
|
||||||
}
|
}
|
||||||
|
|
@ -1096,7 +1096,7 @@ func (w *ApplicationService) CopyWorkflowFromLibraryToApp(ctx context.Context, w
|
||||||
}
|
}
|
||||||
|
|
||||||
func (w *ApplicationService) copyWorkflow(ctx context.Context, workflowID int64, policy vo.CopyWorkflowPolicy) (*entity.Workflow, error) {
|
func (w *ApplicationService) copyWorkflow(ctx context.Context, workflowID int64, policy vo.CopyWorkflowPolicy) (*entity.Workflow, error) {
|
||||||
wf, err := w.DomainSVC.CopyWorkflow(ctx, workflowID, policy)
|
wf, err := GetWorkflowDomainSVC().CopyWorkflow(ctx, workflowID, policy)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
@ -3351,7 +3351,7 @@ func (w *ApplicationService) CopyWkTemplateApi(ctx context.Context, req *workflo
|
||||||
}
|
}
|
||||||
|
|
||||||
func (w *ApplicationService) publishWorkflowResource(ctx context.Context, policy *vo.PublishPolicy) error {
|
func (w *ApplicationService) publishWorkflowResource(ctx context.Context, policy *vo.PublishPolicy) error {
|
||||||
err := w.DomainSVC.Publish(ctx, policy)
|
err := GetWorkflowDomainSVC().Publish(ctx, policy)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -84,7 +84,11 @@ type Entry struct {
|
||||||
outputTypes map[string]*vo.TypeInfo
|
outputTypes map[string]*vo.TypeInfo
|
||||||
}
|
}
|
||||||
|
|
||||||
func (e *Entry) Invoke(_ context.Context, in map[string]any) (out map[string]any, err error) {
|
func (e *Entry) Invoke(_ context.Context, input map[string]any) (out map[string]any, err error) {
|
||||||
|
in := make(map[string]any, len(input))
|
||||||
|
for k, v := range input {
|
||||||
|
in[k] = v
|
||||||
|
}
|
||||||
for k, v := range e.defaultValues {
|
for k, v := range e.defaultValues {
|
||||||
if val, ok := in[k]; ok {
|
if val, ok := in[k]; ok {
|
||||||
tInfo := e.outputTypes[k]
|
tInfo := e.outputTypes[k]
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,7 @@ import (
|
||||||
|
|
||||||
"github.com/cloudwego/eino/compose"
|
"github.com/cloudwego/eino/compose"
|
||||||
"github.com/cloudwego/eino/schema"
|
"github.com/cloudwego/eino/schema"
|
||||||
|
"github.com/mohae/deepcopy"
|
||||||
|
|
||||||
"github.com/coze-dev/coze-studio/backend/domain/workflow/entity"
|
"github.com/coze-dev/coze-studio/backend/domain/workflow/entity"
|
||||||
"github.com/coze-dev/coze-studio/backend/domain/workflow/entity/vo"
|
"github.com/coze-dev/coze-studio/backend/domain/workflow/entity/vo"
|
||||||
|
|
@ -632,7 +633,14 @@ func concatVACallbackInputs(vs [][]vaCallbackInput) ([]vaCallbackInput, error) {
|
||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
init := slices.Clone(vs[0])
|
init := make([]vaCallbackInput, len(vs[0]))
|
||||||
|
for i, v := range vs[0] {
|
||||||
|
init[i] = vaCallbackInput{
|
||||||
|
Name: v.Name,
|
||||||
|
Variables: deepcopy.Copy(v.Variables).([]any),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for i := 1; i < len(vs); i++ {
|
for i := 1; i < len(vs); i++ {
|
||||||
next := vs[i]
|
next := vs[i]
|
||||||
for j := 0; j < len(next); j++ {
|
for j := 0; j < len(next); j++ {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue