Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tests for orchestrator #1317

Merged
merged 5 commits into from
Sep 20, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions orchestrator/mocks/EventSDK.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

77 changes: 77 additions & 0 deletions orchestrator/mocks/ExecutionSDK.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

35 changes: 35 additions & 0 deletions orchestrator/mocks/ProcessSDK.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 1 addition & 16 deletions orchestrator/orchestrator.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,12 @@ import (
"github.com/mesg-foundation/engine/hash"
"github.com/mesg-foundation/engine/process"
"github.com/mesg-foundation/engine/protobuf/types"
eventsdk "github.com/mesg-foundation/engine/sdk/event"
executionsdk "github.com/mesg-foundation/engine/sdk/execution"
processesdk "github.com/mesg-foundation/engine/sdk/process"
"github.com/sirupsen/logrus"
)

// Orchestrator manages the executions based on the definition of the processes
type Orchestrator struct {
event *eventsdk.Event
eventStream *eventsdk.Listener

execution *executionsdk.Execution
executionStream *executionsdk.Listener

process *processesdk.Process

ErrC chan error
}

// New creates a new Process instance
func New(event *eventsdk.Event, execution *executionsdk.Execution, process *processesdk.Process) *Orchestrator {
func New(event EventSDK, execution ExecutionSDK, process ProcessSDK) *Orchestrator {
return &Orchestrator{
event: event,
execution: execution,
Expand Down
Loading