refactor: optimize app infra component initialization (#2294)

This commit is contained in:
Ryo
2025-09-29 16:11:49 +08:00
committed by GitHub
parent 6755ce02bc
commit 4789889b17
46 changed files with 982 additions and 754 deletions

View File

@ -83,7 +83,6 @@ import (
pluginmodel "github.com/coze-dev/coze-studio/backend/crossdomain/contract/plugin/model"
"github.com/coze-dev/coze-studio/backend/crossdomain/contract/plugin/pluginmock"
crossuser "github.com/coze-dev/coze-studio/backend/crossdomain/contract/user"
"github.com/coze-dev/coze-studio/backend/crossdomain/impl/code"
pluginImpl "github.com/coze-dev/coze-studio/backend/crossdomain/impl/plugin"
agententity "github.com/coze-dev/coze-studio/backend/domain/conversation/agentrun/entity"
conventity "github.com/coze-dev/coze-studio/backend/domain/conversation/conversation/entity"
@ -3837,7 +3836,7 @@ func TestNodeDebugLoop(t *testing.T) {
}, nil
}).AnyTimes()
code.SetCodeRunner(runner)
coderunner.SetCodeRunner(runner)
id := r.load("loop_with_object_input.json")
exeID := r.nodeDebug(id, "122149",
withNDInput(map[string]string{"input": `[{"a":"1"},{"a":"2"}]`}))
@ -4154,7 +4153,7 @@ func TestCodeExceptionBranch(t *testing.T) {
id := r.load("exception/code_exception_branch.json")
mockey.PatchConvey("exception branch", func() {
code.SetCodeRunner(direct.NewRunner())
coderunner.SetCodeRunner(direct.NewRunner())
exeID := r.testRun(id, map[string]string{"input": "hello"})
e := r.getProcess(id, exeID)
@ -4167,7 +4166,7 @@ func TestCodeExceptionBranch(t *testing.T) {
mockey.PatchConvey("normal branch", func() {
mockCodeRunner := mockcode.NewMockRunner(r.ctrl)
mockey.Mock(code.GetCodeRunner).Return(mockCodeRunner).Build()
mockey.Mock(coderunner.GetCodeRunner).Return(mockCodeRunner).Build()
mockCodeRunner.EXPECT().Run(gomock.Any(), gomock.Any()).Return(&coderunner.RunResponse{
Result: map[string]any{
"key0": "value0",
@ -4891,7 +4890,7 @@ func TestHttpImplicitDependencies(t *testing.T) {
}, nil
}).AnyTimes()
code.SetCodeRunner(runner)
coderunner.SetCodeRunner(runner)
mockey.PatchConvey("test http node implicit dependencies", func() {
input := map[string]string{
@ -6059,7 +6058,7 @@ func TestWorkflowRunWithFiles(t *testing.T) {
}, nil
}).AnyTimes()
mockey.Mock(code.GetCodeRunner).Return(runner).Build()
mockey.Mock(coderunner.GetCodeRunner).Return(runner).Build()
idStr := r.load("workflow_wf_file_name.json")
r.publish(idStr, "v0.1.1", true)