Skip to content

Commit

Permalink
tidy
Browse files Browse the repository at this point in the history
  • Loading branch information
ettec committed Dec 11, 2024
1 parent b1b51ee commit 59d35a9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,8 @@ func Test_EventHandlerStateSync(t *testing.T) {

if numEvents == expectedNumEvents {
// verify the events are the expected types in the expected order
// Note the below test does not work with the unrefactored workflow registry, event order is essentially random
// Note the below test does not work with the unrefactored workflow registry, event order is essentially
// random in the pre-refactored version
for idx, event := range events {
switch idx % 5 {
case 0:
Expand Down Expand Up @@ -565,14 +566,6 @@ func Test_RegistrySyncer_WorkflowRegistered_InitiallyActivated(t *testing.T) {
// generate a log event
registerWorkflow(t, backendTH, wfRegistryC, giveWorkflow)

/*
string(ForceUpdateSecretsEvent),
string(WorkflowActivatedEvent),
string(WorkflowDeletedEvent),
string(WorkflowPausedEvent),
string(WorkflowRegisteredEvent),
string(WorkflowUpdatedEvent), */

// Require the secrets contents to eventually be updated
require.Eventually(t, func() bool {
_, err := er.Get("test-wf")
Expand Down
8 changes: 4 additions & 4 deletions core/services/workflows/syncer/workflow_registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,6 @@ type WorkflowLoadConfig struct {
// FetcherFunc is an abstraction for fetching the contents stored at a URL.
type FetcherFunc func(ctx context.Context, url string) ([]byte, error)

type ContractReaderFactory interface {
NewContractReader(context.Context, []byte) (types.ContractReader, error)
}

// ContractReader is a subset of types.ContractReader defined locally to enable mocking.
type ContractReader interface {
Start(ctx context.Context) error
Expand All @@ -104,6 +100,10 @@ type ContractReader interface {
GetLatestValueWithHeadData(ctx context.Context, readName string, confidenceLevel primitives.ConfidenceLevel, params any, returnVal any) (head *types.Head, err error)
}

type ContractReaderFactory interface {
NewContractReader(context.Context, []byte) (types.ContractReader, error)
}

// WorkflowRegistrySyncer is the public interface of the package.
type WorkflowRegistrySyncer interface {
services.Service
Expand Down

0 comments on commit 59d35a9

Please sign in to comment.