diff --git a/cmd/solo/subcommand/version.go b/cmd/solo/subcommand/version.go index 122fb129..b4a4294e 100644 --- a/cmd/solo/subcommand/version.go +++ b/cmd/solo/subcommand/version.go @@ -5,8 +5,8 @@ import ( "github.com/spf13/cobra" - "github.com/spaulg/solo/internal/pkg/common/domain/version" "github.com/spaulg/solo/internal/pkg/host/app/context" + "github.com/spaulg/solo/internal/pkg/host/app/version" ) func NewVersionCommand(_ *context.CliContext) *cobra.Command { diff --git a/internal/pkg/architecture_test.go b/internal/pkg/architecture_test.go index 9e0531f8..ee109768 100644 --- a/internal/pkg/architecture_test.go +++ b/internal/pkg/architecture_test.go @@ -45,9 +45,6 @@ func (t *ArchitectureTestSuite) SetupTest() { } func (t *ArchitectureTestSuite) TestLayerDependencies() { - t.T().Skipf("Skipping architecture test as the architecture is still evolving." + - " Re-enable once the architecture is stable.") - configuration := archgo_config.Config{ DependenciesRules: []*archgo_config.DependenciesRule{ // Commands @@ -67,6 +64,7 @@ func (t *ArchitectureTestSuite) TestLayerDependencies() { Internal: []string{ t.moduleName + "/cmd/solo-entrypoint.**", t.moduleName + "/internal/pkg/entrypoint.**", + t.moduleName + "/internal/pkg/common/domain.**", }, }, }, diff --git a/internal/pkg/host/app/audit/state_directory_auditor.go b/internal/pkg/host/app/audit/state_directory_auditor.go index 0e6e07a9..30b066ec 100644 --- a/internal/pkg/host/app/audit/state_directory_auditor.go +++ b/internal/pkg/host/app/audit/state_directory_auditor.go @@ -7,9 +7,9 @@ import ( "sync" "github.com/spaulg/solo/internal/pkg/host/app/context" - "github.com/spaulg/solo/internal/pkg/host/app/event_manager/events" "github.com/spaulg/solo/internal/pkg/host/app/wms/wf" - domain2 "github.com/spaulg/solo/internal/pkg/host/domain" + "github.com/spaulg/solo/internal/pkg/host/domain" + "github.com/spaulg/solo/internal/pkg/host/domain/events" ) const auditLogsPath = "audit_logs" @@ -19,25 +19,25 @@ const metaFileSuffix = ".meta.json" type StateDirectoryAuditor struct { soloCtx *context.CliContext logger *slog.Logger - config *domain2.Config - project domain2.Project + config *domain.Config + project domain.Project mu sync.Mutex outputDirectory string - executionEventRepository domain2.ExecutionEventRepository - workflowLogMetaRepository domain2.WorkflowLogMetaRepository - workflowStepLogMetaRepository domain2.WorkflowStepLogMetaRepository - logWriter domain2.LogWriter + executionEventRepository domain.ExecutionEventRepository + workflowLogMetaRepository domain.WorkflowLogMetaRepository + workflowStepLogMetaRepository domain.WorkflowStepLogMetaRepository + logWriter domain.LogWriter } func NewAuditor( soloCtx *context.CliContext, logger *slog.Logger, - config *domain2.Config, - project domain2.Project, - executionEventRepository domain2.ExecutionEventRepository, - workflowLogMetaRepository domain2.WorkflowLogMetaRepository, - workflowStepLogMetaRepository domain2.WorkflowStepLogMetaRepository, - logWriter domain2.LogWriter, + config *domain.Config, + project domain.Project, + executionEventRepository domain.ExecutionEventRepository, + workflowLogMetaRepository domain.WorkflowLogMetaRepository, + workflowStepLogMetaRepository domain.WorkflowStepLogMetaRepository, + logWriter domain.LogWriter, ) *StateDirectoryAuditor { outputDirectory := path.Join( project.GetStateDirectoryRoot(), @@ -61,7 +61,7 @@ func NewAuditor( func (t *StateDirectoryAuditor) RecordExecutionEvent(callback func() error) error { eventFile := path.Join(t.outputDirectory, executionEventFile) - workflowEvent := domain2.NewExecutionEvent(t.soloCtx.CommandPath, t.soloCtx.CommandArgs) + workflowEvent := domain.NewExecutionEvent(t.soloCtx.CommandPath, t.soloCtx.CommandArgs) if err := t.executionEventRepository.Save(eventFile, workflowEvent); err != nil { return fmt.Errorf("failed to record workflow event start: %w", err) } @@ -113,7 +113,7 @@ func (t *StateDirectoryAuditor) writeStepOutput(e *wf.StepOutputEvent) { } if meta == nil { - meta = domain2.NewWorkflowStepLogMeta() + meta = domain.NewWorkflowStepLogMeta() if err := t.workflowStepLogMetaRepository.Save(filePath, meta); err != nil { t.logger.Error(fmt.Sprintf( @@ -187,7 +187,7 @@ func (t *StateDirectoryAuditor) writeStepResult(e *wf.StepCompleteEvent) { } if metaJSON == nil { - metaJSON = domain2.NewWorkflowStepLogMeta() + metaJSON = domain.NewWorkflowStepLogMeta() } metaJSON.SetExecutionInfo(e.ExitCode, e.Command, e.Arguments, e.Cwd) @@ -213,7 +213,7 @@ func (t *StateDirectoryAuditor) writeStepResult(e *wf.StepCompleteEvent) { } if workflowMeta == nil { - workflowMeta = domain2.NewWorkflowLogMeta() + workflowMeta = domain.NewWorkflowLogMeta() } workflowMeta.AppendStep(e.ContainerName, e.StepID) diff --git a/internal/pkg/host/app/auditor.go b/internal/pkg/host/app/auditor.go index 982f8995..66207b02 100644 --- a/internal/pkg/host/app/auditor.go +++ b/internal/pkg/host/app/auditor.go @@ -1,7 +1,7 @@ package app import ( - "github.com/spaulg/solo/internal/pkg/host/app/event_manager/events" + "github.com/spaulg/solo/internal/pkg/host/domain/events" ) type Auditor interface { diff --git a/internal/pkg/host/app/event_manager/manager.go b/internal/pkg/host/app/event_manager/manager.go index e7ff0355..2e25804d 100644 --- a/internal/pkg/host/app/event_manager/manager.go +++ b/internal/pkg/host/app/event_manager/manager.go @@ -3,11 +3,11 @@ package event_manager import ( "sync" - events2 "github.com/spaulg/solo/internal/pkg/host/app/event_manager/events" + "github.com/spaulg/solo/internal/pkg/host/domain/events" ) type Manager struct { - subscribers map[events2.Subscriber]chan events2.Event + subscribers map[events.Subscriber]chan events.Event mu sync.RWMutex wg sync.WaitGroup } @@ -28,18 +28,18 @@ func GetEventManagerInstance() *Manager { func NewEventManager() *Manager { return &Manager{ - subscribers: make(map[events2.Subscriber]chan events2.Event), + subscribers: make(map[events.Subscriber]chan events.Event), } } -func (t *Manager) Subscribe(eventSubscriber events2.Subscriber) { +func (t *Manager) Subscribe(eventSubscriber events.Subscriber) { t.mu.Lock() defer t.mu.Unlock() - subscriberChannel := make(chan events2.Event, 30) + subscriberChannel := make(chan events.Event, 30) t.subscribers[eventSubscriber] = subscriberChannel - go func(subscriber events2.Subscriber) { + go func(subscriber events.Subscriber) { for val := range subscriberChannel { subscriber.Publish(val) t.wg.Done() @@ -47,7 +47,7 @@ func (t *Manager) Subscribe(eventSubscriber events2.Subscriber) { }(eventSubscriber) } -func (t *Manager) Unsubscribe(eventSubscriber events2.Subscriber) { +func (t *Manager) Unsubscribe(eventSubscriber events.Subscriber) { t.mu.Lock() defer t.mu.Unlock() @@ -57,7 +57,7 @@ func (t *Manager) Unsubscribe(eventSubscriber events2.Subscriber) { } } -func (t *Manager) Publish(event events2.Event) { +func (t *Manager) Publish(event events.Event) { t.mu.RLock() defer t.mu.RUnlock() diff --git a/internal/pkg/host/app/project_control.go b/internal/pkg/host/app/project_control.go index 528b38e6..2ae26e47 100644 --- a/internal/pkg/host/app/project_control.go +++ b/internal/pkg/host/app/project_control.go @@ -9,10 +9,10 @@ import ( workflowcommon "github.com/spaulg/solo/internal/pkg/common/domain/wms" "github.com/spaulg/solo/internal/pkg/host/app/context" - "github.com/spaulg/solo/internal/pkg/host/app/event_manager/events" "github.com/spaulg/solo/internal/pkg/host/app/project" "github.com/spaulg/solo/internal/pkg/host/app/wms" "github.com/spaulg/solo/internal/pkg/host/domain" + "github.com/spaulg/solo/internal/pkg/host/domain/events" "github.com/spaulg/solo/internal/pkg/host/infra/grpc" ) diff --git a/internal/pkg/host/app/version/retrieval.go b/internal/pkg/host/app/version/retrieval.go new file mode 100644 index 00000000..27f2575c --- /dev/null +++ b/internal/pkg/host/app/version/retrieval.go @@ -0,0 +1,9 @@ +package version + +import ( + domain_version "github.com/spaulg/solo/internal/pkg/common/domain/version" +) + +func Get() domain_version.Info { + return domain_version.Get() +} diff --git a/internal/pkg/host/app/wms/wf/guard.go b/internal/pkg/host/app/wms/wf/guard.go index 30f98cf3..5301a4d9 100644 --- a/internal/pkg/host/app/wms/wf/guard.go +++ b/internal/pkg/host/app/wms/wf/guard.go @@ -2,7 +2,7 @@ package wf import ( workflowcommon "github.com/spaulg/solo/internal/pkg/common/domain/wms" - "github.com/spaulg/solo/internal/pkg/host/app/event_manager/events" + "github.com/spaulg/solo/internal/pkg/host/domain/events" ) type Guard interface { diff --git a/internal/pkg/host/app/wms/workflow_guard.go b/internal/pkg/host/app/wms/workflow_guard.go index 5ef5b050..233cea8b 100644 --- a/internal/pkg/host/app/wms/workflow_guard.go +++ b/internal/pkg/host/app/wms/workflow_guard.go @@ -10,9 +10,9 @@ import ( "time" workflowcommon "github.com/spaulg/solo/internal/pkg/common/domain/wms" - "github.com/spaulg/solo/internal/pkg/host/app/event_manager/events" "github.com/spaulg/solo/internal/pkg/host/app/wms/wf" domain2 "github.com/spaulg/solo/internal/pkg/host/domain" + "github.com/spaulg/solo/internal/pkg/host/domain/events" ) type WorkflowGuard struct { diff --git a/internal/pkg/host/app/wms/workflow_runner.go b/internal/pkg/host/app/wms/workflow_runner.go index ea7ccbdf..be3f9f92 100644 --- a/internal/pkg/host/app/wms/workflow_runner.go +++ b/internal/pkg/host/app/wms/workflow_runner.go @@ -3,9 +3,10 @@ package wms import ( "fmt" - "github.com/spaulg/solo/internal/pkg/host/app/event_manager/events" wf2 "github.com/spaulg/solo/internal/pkg/host/app/wms/wf" domain2 "github.com/spaulg/solo/internal/pkg/host/domain" + "github.com/spaulg/solo/internal/pkg/host/domain/events" + "github.com/spaulg/solo/internal/pkg/host/infra/grpc/service_definitions/wfsession" ) type WorkflowRunner struct { @@ -29,7 +30,7 @@ func NewWorkflowRunner( } } -func (t *WorkflowRunner) RunWorkflow(workflowSession wf2.Session) error { +func (t *WorkflowRunner) RunWorkflow(workflowSession wfsession.Session) error { // Handle previously run once-only workflows hasServiceWorkflowRun, err := workflowSession.HasServiceWorkflowRun(workflowSession.GetServiceName()) if err != nil { @@ -69,7 +70,7 @@ func (t *WorkflowRunner) RunWorkflow(workflowSession wf2.Session) error { return workflowSession.MarkCompletion() } -func (t *WorkflowRunner) handleRunWorkflow(workflowSession wf2.Session) (bool, error) { +func (t *WorkflowRunner) handleRunWorkflow(workflowSession wfsession.Session) (bool, error) { workflowSuccess := true t.eventManager.Publish(&wf2.StartedEvent{ @@ -117,7 +118,7 @@ func (t *WorkflowRunner) handleRunWorkflow(workflowSession wf2.Session) (bool, e Shell: step.GetShell(), }) - return workflowSession.RunCommand(&wf2.RunCommandRequest{ + return workflowSession.RunCommand(&wfsession.RunCommandRequest{ Command: step.GetCommand(), Arguments: step.GetArguments(), WorkingDirectory: step.GetWorkingDirectory(), diff --git a/internal/pkg/host/app/wms/workflow_runner_test.go b/internal/pkg/host/app/wms/workflow_runner_test.go index cdd82271..87569a17 100644 --- a/internal/pkg/host/app/wms/workflow_runner_test.go +++ b/internal/pkg/host/app/wms/workflow_runner_test.go @@ -11,6 +11,7 @@ import ( "github.com/spaulg/solo/internal/pkg/host/app/wms/wf" "github.com/spaulg/solo/internal/pkg/host/domain" "github.com/spaulg/solo/internal/pkg/host/domain/config" + "github.com/spaulg/solo/internal/pkg/host/infra/grpc/service_definitions/wfsession" "github.com/spaulg/solo/test" "github.com/spaulg/solo/test/mocks/host/app/events" "github.com/spaulg/solo/test/mocks/host/app/wms" @@ -147,7 +148,7 @@ func (t *WorkflowRunnerTestSuite) testWorkflowExecFor(wfName commonworkflow.Work Shell: "/bin/sh", }).Return() - t.workflowSession.On("RunCommand", &wf.RunCommandRequest{ + t.workflowSession.On("RunCommand", &wfsession.RunCommandRequest{ Command: "/bin/sh", Arguments: []string{"-c", "echo \"Hello World\""}, WorkingDirectory: "/", @@ -160,7 +161,7 @@ func (t *WorkflowRunnerTestSuite) testWorkflowExecFor(wfName commonworkflow.Work t.Nil(err) // progress - t.workflowSession.On("RecvCommandResponse").Return(&wf.CommandResponse{ + t.workflowSession.On("RecvCommandResponse").Return(&wfsession.CommandResponse{ Stdout: "Hello World", Stderr: "", ExitCode: &exitCode, @@ -518,7 +519,7 @@ func (t *WorkflowRunnerTestSuite) testServerRecvErrorFor(wfName commonworkflow.W Shell: "/bin/sh", }).Return() - t.workflowSession.On("RunCommand", &wf.RunCommandRequest{ + t.workflowSession.On("RunCommand", &wfsession.RunCommandRequest{ Command: "/bin/sh", Arguments: []string{"-c", "echo \"Hello World\""}, WorkingDirectory: "/", diff --git a/internal/pkg/host/app/event_manager/events/event.go b/internal/pkg/host/domain/events/event.go similarity index 100% rename from internal/pkg/host/app/event_manager/events/event.go rename to internal/pkg/host/domain/events/event.go diff --git a/internal/pkg/host/app/event_manager/events/manager.go b/internal/pkg/host/domain/events/manager.go similarity index 100% rename from internal/pkg/host/app/event_manager/events/manager.go rename to internal/pkg/host/domain/events/manager.go diff --git a/internal/pkg/host/app/event_manager/events/subscriber.go b/internal/pkg/host/domain/events/subscriber.go similarity index 100% rename from internal/pkg/host/app/event_manager/events/subscriber.go rename to internal/pkg/host/domain/events/subscriber.go diff --git a/internal/pkg/host/infra/container/docker.go b/internal/pkg/host/infra/container/docker.go index 4a343dd9..90078953 100644 --- a/internal/pkg/host/infra/container/docker.go +++ b/internal/pkg/host/infra/container/docker.go @@ -17,8 +17,8 @@ import ( "github.com/compose-spec/compose-go/v2/types" "google.golang.org/grpc/metadata" - "github.com/spaulg/solo/internal/pkg/host/app/event_manager/events" domain2 "github.com/spaulg/solo/internal/pkg/host/domain" + "github.com/spaulg/solo/internal/pkg/host/domain/events" "github.com/spaulg/solo/internal/pkg/host/infra/container/progress" ) diff --git a/internal/pkg/host/infra/container/orchestrator_factory.go b/internal/pkg/host/infra/container/orchestrator_factory.go index 145ee566..9c3abd99 100644 --- a/internal/pkg/host/infra/container/orchestrator_factory.go +++ b/internal/pkg/host/infra/container/orchestrator_factory.go @@ -6,8 +6,8 @@ import ( "log/slog" "os/exec" - "github.com/spaulg/solo/internal/pkg/host/app/event_manager/events" domain2 "github.com/spaulg/solo/internal/pkg/host/domain" + "github.com/spaulg/solo/internal/pkg/host/domain/events" ) type OrchestratorFactory struct { diff --git a/internal/pkg/host/infra/container/progress/stream.go b/internal/pkg/host/infra/container/progress/stream.go index 5304cae3..a9763838 100644 --- a/internal/pkg/host/infra/container/progress/stream.go +++ b/internal/pkg/host/infra/container/progress/stream.go @@ -7,14 +7,14 @@ import ( "io" "log/slog" - "github.com/spaulg/solo/internal/pkg/host/app/event_manager/events" - domain2 "github.com/spaulg/solo/internal/pkg/host/domain" + "github.com/spaulg/solo/internal/pkg/host/domain" + "github.com/spaulg/solo/internal/pkg/host/domain/events" ) type ProgressEventPublisher struct { logger *slog.Logger - config *domain2.Config - project domain2.Project + config *domain.Config + project domain.Project eventManager events.Manager projectName string stream io.ReadCloser @@ -22,8 +22,8 @@ type ProgressEventPublisher struct { func NewProgressEventPublisher( logger *slog.Logger, - config *domain2.Config, - project domain2.Project, + config *domain.Config, + project domain.Project, eventManager events.Manager, projectName string, stream io.ReadCloser, diff --git a/internal/pkg/host/infra/grpc/service_definitions/wfsession/command_response.go b/internal/pkg/host/infra/grpc/service_definitions/wfsession/command_response.go new file mode 100644 index 00000000..a9a1496a --- /dev/null +++ b/internal/pkg/host/infra/grpc/service_definitions/wfsession/command_response.go @@ -0,0 +1,7 @@ +package wfsession + +type CommandResponse struct { + Stdout string + Stderr string + ExitCode *uint8 +} diff --git a/internal/pkg/host/infra/grpc/service_definitions/wfsession/run_command_request.go b/internal/pkg/host/infra/grpc/service_definitions/wfsession/run_command_request.go new file mode 100644 index 00000000..9096affe --- /dev/null +++ b/internal/pkg/host/infra/grpc/service_definitions/wfsession/run_command_request.go @@ -0,0 +1,7 @@ +package wfsession + +type RunCommandRequest struct { + Command string + Arguments []string + WorkingDirectory string +} diff --git a/internal/pkg/host/app/wms/wf/session.go b/internal/pkg/host/infra/grpc/service_definitions/wfsession/session.go similarity index 70% rename from internal/pkg/host/app/wms/wf/session.go rename to internal/pkg/host/infra/grpc/service_definitions/wfsession/session.go index 8fa4eae7..ecfdc0cc 100644 --- a/internal/pkg/host/app/wms/wf/session.go +++ b/internal/pkg/host/infra/grpc/service_definitions/wfsession/session.go @@ -1,21 +1,9 @@ -package wf +package wfsession import ( commonworkflow "github.com/spaulg/solo/internal/pkg/common/domain/wms" ) -type RunCommandRequest struct { - Command string - Arguments []string - WorkingDirectory string -} - -type CommandResponse struct { - Stdout string - Stderr string - ExitCode *uint8 -} - type Session interface { GetWorkflowName() commonworkflow.WorkflowName HasServiceWorkflowRun(serviceName string) (bool, error) diff --git a/internal/pkg/host/infra/grpc/service_definitions/workflow_runner.go b/internal/pkg/host/infra/grpc/service_definitions/workflow_runner.go index 6fdd1014..1475ffe6 100644 --- a/internal/pkg/host/infra/grpc/service_definitions/workflow_runner.go +++ b/internal/pkg/host/infra/grpc/service_definitions/workflow_runner.go @@ -1,9 +1,9 @@ package service_definitions import ( - "github.com/spaulg/solo/internal/pkg/host/app/wms/wf" + "github.com/spaulg/solo/internal/pkg/host/infra/grpc/service_definitions/wfsession" ) type WorkflowRunner interface { - RunWorkflow(workflowSession wf.Session) error + RunWorkflow(workflowSession wfsession.Session) error } diff --git a/internal/pkg/host/infra/grpc/service_definitions/workflow_session.go b/internal/pkg/host/infra/grpc/service_definitions/workflow_session.go index 15099568..6ddd6a93 100644 --- a/internal/pkg/host/infra/grpc/service_definitions/workflow_session.go +++ b/internal/pkg/host/infra/grpc/service_definitions/workflow_session.go @@ -9,9 +9,9 @@ import ( commonworkflow "github.com/spaulg/solo/internal/pkg/common/domain/wms" "github.com/spaulg/solo/internal/pkg/common/infra/grpc/services" - "github.com/spaulg/solo/internal/pkg/host/app/wms/wf" "github.com/spaulg/solo/internal/pkg/host/domain" interceptors2 "github.com/spaulg/solo/internal/pkg/host/infra/grpc/interceptors" + "github.com/spaulg/solo/internal/pkg/host/infra/grpc/service_definitions/wfsession" ) type WorkflowSession struct { @@ -133,7 +133,7 @@ func (t *WorkflowSession) GetWorkingDirectory() (string, error) { return serviceWorkingDirectory, err } -func (t *WorkflowSession) RunCommand(request *wf.RunCommandRequest) error { +func (t *WorkflowSession) RunCommand(request *wfsession.RunCommandRequest) error { return t.server.Send(&services.WorkflowStreamResponse{ Action: services.WorkflowAction_RUN_COMMAND_ACTION, RunCommand: &services.WorkflowRunCommand{ @@ -144,7 +144,7 @@ func (t *WorkflowSession) RunCommand(request *wf.RunCommandRequest) error { }) } -func (t *WorkflowSession) RecvCommandResponse() (*wf.CommandResponse, error) { +func (t *WorkflowSession) RecvCommandResponse() (*wfsession.CommandResponse, error) { result, err := t.server.Recv() if err != nil { @@ -163,7 +163,7 @@ func (t *WorkflowSession) RecvCommandResponse() (*wf.CommandResponse, error) { exitCodePtr = &exitCode } - return &wf.CommandResponse{ + return &wfsession.CommandResponse{ Stdout: result.RunCommandResult.Stdout, Stderr: result.RunCommandResult.Stderr, ExitCode: exitCodePtr, diff --git a/internal/pkg/host/infra/grpc/service_definitions/workflow_session_test.go b/internal/pkg/host/infra/grpc/service_definitions/workflow_session_test.go index 930709ae..9e107038 100644 --- a/internal/pkg/host/infra/grpc/service_definitions/workflow_session_test.go +++ b/internal/pkg/host/infra/grpc/service_definitions/workflow_session_test.go @@ -11,8 +11,8 @@ import ( commonworkflow "github.com/spaulg/solo/internal/pkg/common/domain/wms" "github.com/spaulg/solo/internal/pkg/common/infra/grpc/services" - "github.com/spaulg/solo/internal/pkg/host/app/wms/wf" "github.com/spaulg/solo/internal/pkg/host/infra/grpc/interceptors" + "github.com/spaulg/solo/internal/pkg/host/infra/grpc/service_definitions/wfsession" "github.com/spaulg/solo/test/mocks/grpc" "github.com/spaulg/solo/test/mocks/host/app/wms" "github.com/spaulg/solo/test/mocks/host/domain/compose" @@ -276,7 +276,7 @@ func (t *WorkflowSessionTestSuite) TestRunCommand() { }, }).Return(nil) - err = workflowSession.RunCommand(&wf.RunCommandRequest{ + err = workflowSession.RunCommand(&wfsession.RunCommandRequest{ Command: "test_command", Arguments: []string{"arg1", "arg2"}, WorkingDirectory: "/tmp", diff --git a/test/mocks/host/app/audit/auditor.go b/test/mocks/host/app/audit/auditor.go index fc4ba284..955dfd6d 100644 --- a/test/mocks/host/app/audit/auditor.go +++ b/test/mocks/host/app/audit/auditor.go @@ -3,7 +3,7 @@ package audit import ( "github.com/stretchr/testify/mock" - "github.com/spaulg/solo/internal/pkg/host/app/event_manager/events" + "github.com/spaulg/solo/internal/pkg/host/domain/events" ) type MockAuditor struct { diff --git a/test/mocks/host/app/events/manager.go b/test/mocks/host/app/events/manager.go index 54c96a1b..d7f9ac89 100644 --- a/test/mocks/host/app/events/manager.go +++ b/test/mocks/host/app/events/manager.go @@ -3,22 +3,22 @@ package events import ( "github.com/stretchr/testify/mock" - events3 "github.com/spaulg/solo/internal/pkg/host/app/event_manager/events" + events2 "github.com/spaulg/solo/internal/pkg/host/domain/events" ) type MockEventManager struct { mock.Mock } -func (m *MockEventManager) Subscribe(eventSubscriber events3.Subscriber) { +func (m *MockEventManager) Subscribe(eventSubscriber events2.Subscriber) { m.Called(eventSubscriber) } -func (m *MockEventManager) Unsubscribe(eventSubscriber events3.Subscriber) { +func (m *MockEventManager) Unsubscribe(eventSubscriber events2.Subscriber) { m.Called(eventSubscriber) } -func (m *MockEventManager) Publish(data events3.Event) { +func (m *MockEventManager) Publish(data events2.Event) { m.Called(data) } diff --git a/test/mocks/host/app/events/subscriber.go b/test/mocks/host/app/events/subscriber.go index 4dd55091..3b1a7614 100644 --- a/test/mocks/host/app/events/subscriber.go +++ b/test/mocks/host/app/events/subscriber.go @@ -3,7 +3,7 @@ package events import ( "github.com/stretchr/testify/mock" - events_types "github.com/spaulg/solo/internal/pkg/host/app/event_manager/events" + events_types "github.com/spaulg/solo/internal/pkg/host/domain/events" ) type MockSubscriber struct { diff --git a/test/mocks/host/app/wms/workflow_guard.go b/test/mocks/host/app/wms/workflow_guard.go index f43c8aab..681b388b 100644 --- a/test/mocks/host/app/wms/workflow_guard.go +++ b/test/mocks/host/app/wms/workflow_guard.go @@ -4,7 +4,7 @@ import ( "github.com/stretchr/testify/mock" workflowcommon "github.com/spaulg/solo/internal/pkg/common/domain/wms" - events_types "github.com/spaulg/solo/internal/pkg/host/app/event_manager/events" + events_types "github.com/spaulg/solo/internal/pkg/host/domain/events" ) type MockWorkflowGuard struct { diff --git a/test/mocks/host/app/wms/workflow_runner.go b/test/mocks/host/app/wms/workflow_runner.go index dc854663..d8aee866 100644 --- a/test/mocks/host/app/wms/workflow_runner.go +++ b/test/mocks/host/app/wms/workflow_runner.go @@ -3,14 +3,14 @@ package wms import ( "github.com/stretchr/testify/mock" - "github.com/spaulg/solo/internal/pkg/host/app/wms/wf" + "github.com/spaulg/solo/internal/pkg/host/infra/grpc/service_definitions/wfsession" ) type MockWorkflowRunner struct { mock.Mock } -func (m *MockWorkflowRunner) RunWorkflow(workflowSession wf.Session) error { +func (m *MockWorkflowRunner) RunWorkflow(workflowSession wfsession.Session) error { args := m.Called(workflowSession) return args.Error(0) } diff --git a/test/mocks/host/infra/grpc/service_definitions/workflow_session.go b/test/mocks/host/infra/grpc/service_definitions/workflow_session.go index 76b05629..c948836d 100644 --- a/test/mocks/host/infra/grpc/service_definitions/workflow_session.go +++ b/test/mocks/host/infra/grpc/service_definitions/workflow_session.go @@ -4,7 +4,7 @@ import ( "github.com/stretchr/testify/mock" commonworkflow "github.com/spaulg/solo/internal/pkg/common/domain/wms" - "github.com/spaulg/solo/internal/pkg/host/app/wms/wf" + "github.com/spaulg/solo/internal/pkg/host/infra/grpc/service_definitions/wfsession" ) type MockWorkflowSession struct { @@ -46,14 +46,14 @@ func (m *MockWorkflowSession) GetWorkingDirectory() (string, error) { return args.String(0), args.Error(1) } -func (m *MockWorkflowSession) RunCommand(request *wf.RunCommandRequest) error { +func (m *MockWorkflowSession) RunCommand(request *wfsession.RunCommandRequest) error { args := m.Called(request) return args.Error(0) } -func (m *MockWorkflowSession) RecvCommandResponse() (*wf.CommandResponse, error) { +func (m *MockWorkflowSession) RecvCommandResponse() (*wfsession.CommandResponse, error) { args := m.Called() - if r, ok := args.Get(0).(*wf.CommandResponse); ok { + if r, ok := args.Get(0).(*wfsession.CommandResponse); ok { return r, args.Error(1) }