module Temporal::Testing::WorkflowOverride

Public Instance Methods

allow_all_releases() click to toggle source
# File lib/temporal/testing/workflow_override.rb, line 14
def allow_all_releases
  disabled_releases.clear
end
allow_release(release_name) click to toggle source
# File lib/temporal/testing/workflow_override.rb, line 18
def allow_release(release_name)
  disabled_releases.delete(release_name.to_s)
end
disable_release(release_name) click to toggle source
# File lib/temporal/testing/workflow_override.rb, line 22
def disable_release(release_name)
  disabled_releases << release_name.to_s
end
disabled_releases() click to toggle source
# File lib/temporal/testing/workflow_override.rb, line 10
def disabled_releases
  @disabled_releases ||= Set.new
end
execute_locally(*input) click to toggle source
# File lib/temporal/testing/workflow_override.rb, line 26
def execute_locally(*input)
  workflow_id = SecureRandom.uuid
  run_id = SecureRandom.uuid
  execution = WorkflowExecution.new
  metadata = Temporal::Metadata::Workflow.new(
    name: workflow_id, run_id: run_id, attempt: 1
  )
  context = Temporal::Testing::LocalWorkflowContext.new(
    execution, workflow_id, run_id, disabled_releases, metadata
  )

  execute_in_context(context, input)
end