Skip to content

Commit

Permalink
Merge pull request #1317 from mesg-foundation/test/orchestrator
Browse files Browse the repository at this point in the history
Add tests for orchestrator
  • Loading branch information
Nicolas Mahé authored Sep 20, 2019
2 parents 6f489c9 + c27ca89 commit 06af76a
Show file tree
Hide file tree
Showing 7 changed files with 462 additions and 16 deletions.
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

0 comments on commit 06af76a

Please sign in to comment.