Module: Cadence::Testing::WorkflowOverride

Included in:
Workflow
Defined in:
lib/cadence/testing/workflow_override.rb

Instance Method Summary collapse

Instance Method Details

#allow_all_releasesObject



12
13
14
# File 'lib/cadence/testing/workflow_override.rb', line 12

def allow_all_releases
  disabled_releases.clear
end

#allow_release(release_name) ⇒ Object



16
17
18
# File 'lib/cadence/testing/workflow_override.rb', line 16

def allow_release(release_name)
  disabled_releases.delete(release_name.to_s)
end

#disable_release(release_name) ⇒ Object



20
21
22
# File 'lib/cadence/testing/workflow_override.rb', line 20

def disable_release(release_name)
  disabled_releases << release_name.to_s
end

#disabled_releasesObject



8
9
10
# File 'lib/cadence/testing/workflow_override.rb', line 8

def disabled_releases
  @disabled_releases ||= Set.new
end

#execute_locally(*input) ⇒ Object



24
25
26
27
28
29
30
31
32
33
# File 'lib/cadence/testing/workflow_override.rb', line 24

def execute_locally(*input)
  workflow_id = SecureRandom.uuid
  run_id = SecureRandom.uuid
  execution = WorkflowExecution.new
  context = Cadence::Testing::LocalWorkflowContext.new(
    execution, workflow_id, run_id, disabled_releases
  )

  execute_in_context(context, input)
end